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
Unify how products are managed inside a parent resource (#14515)
Damian Legawiec1dea4a72d337
diff --git a/CLAUDE.md b/CLAUDE.mdindex 0da28452e2..7940fa136e 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -76,7 +76,7 @@ Pending design work (drafts, no implementation yet):- `6.1-exchange-rates.md` — `Spree::ExchangeRate` + `ExchangeRateProvider` (ECB feed as the credential-free default, registry copied from `tax_providers`/`delivery_rate_providers`, keyed providers via `Spree::Integration`). **Rates fill fields, they never price anything** — a merchant gets editable suggestions for the other currencies and what persists is a plain number they own; Spree's "one explicit amount per currency, no FX" stance is unchanged. Never at charge time: EU VAT Directive Art. 91 pins the rate to the instant VAT becomes chargeable, so a commission invoice's VAT figure must be frozen with its rate/date/source or the platform cannot reproduce its own filed documents (Shopify converts at capture and is the wrong pattern here; Vendure/Medusa/Saleor never convert in core). Rates are stored historically and looked up **most-recent-on-or-before**, never exact-date (the ECB skips weekends); cross-currency derives through the base per Art. 91, never stored as a third row; rate precision is NOT money's `decimal(_,2)`. **Constraints now:** never set `Money.default_bank` or call `exchange_to` (the empty rate store raising `UnknownRate` is correct); new money configuration is born per currency, never one amount + a currency column; no conversion endpoint on any API. Also records two live promotion bugs found while researching it — `Calculator::FlatRate` silently discounts **zero** on a currency mismatch, and `Promotion::Rules::ItemTotal` stores a bare threshold with no currency — both independent of this feature.Shipped plans:-- `6.0-b2b-companies-and-catalogs.md` — B2B companies as a **multi-level organization tree** + Catalogs pulled into 6.0 (**implemented 2026-08-25**; replaced the unreleased Company→CompanyLocation→CompanyContact prototype outright — migrations rewritten in place, no bridges). One `spree_companies` table: self-referential `parent_id`, `kind` = `company` (legal entity) | `division`, depth capped at `MAX_DEPTH` (5), roots must be `company`; **`#legal_entity` (nearest self-or-ancestor company node) is the single tax anchor** — TaxIdentifier/TaxExemptionCertificate refuse division owners, and purchases read `company_legal_entity`, never the node. `CompanyAddress` (owned rows, labeled, one default per kind via Channel-style demotion + partial index), `CompanyMembership` (always customer-backed; standing = node + subtree, checked via `Customer#standing_for?`/`company_standing(store:)` — never node equality), `CompanyInvitation` (plaintext token, 30-day expiry, pending-scoped uniqueness; mail in `spree/emails`, acceptance via `CompanyInvitations::Accept` running `Customers::Create`; both member-adding surfaces converge on `Companies::AddMember` by email). Carts/orders carry `company_id` (any node; cart-side standing validation, sole-membership resolution in `resolved_company`, frozen at completion). **Catalogs:** `Catalog` (assortment + optional PriceList) + positioned `CatalogProduct` + polymorphic `CatalogAssignment` (CustomerGroup|Company — buyer audiences only, company assignments cover the subtree; narrowed 2026-08-28 from the original four: Channel/Market were write-only — a channel's catalog is `spree_channels.default_catalog_id`, a market catalog returns only with a designed regional-assortment reader); visibility = `Products::ForContext` (union of effective catalogs, wired into the store products listing), pricing = catalog price lists nearest-node-first in `Pricing::Resolver` (catalog-bound lists excluded from generic rule matching — a rule-less list must not leak to everyone). Store API self-service (`/store/account/companies`, `/store/companies/*`, unauthenticated invitation lookup/accept, writable cart `company_id`) authorizes by **standing + `Storefront::AccessPolicy`** (company branch answers yes for any member — OSS has no company roles; Enterprise narrows via the policy class + checkout hooks). Dashboard: lazy tree list, node page (sub-units/members+invitations/address book; tax cards hidden on divisions), catalogs pages; slots renamed `company_membership.*`, `company.form_*` only. **Constraints:** never reference the deleted location/contact models; no governance fields on OSS models; `kind` stays the fixed two (divergence = STI, never a second table); catalog/company lookups store-scoped including incidental ids.+- `6.0-b2b-companies-and-catalogs.md` — B2B companies as a **multi-level organization tree** + Catalogs pulled into 6.0 (**implemented 2026-08-25**; replaced the unreleased Company→CompanyLocation→CompanyContact prototype outright — migrations rewritten in place, no bridges). One `spree_companies` table: self-referential `parent_id`, `kind` = `company` (legal entity) | `division`, depth capped at `MAX_DEPTH` (5), roots must be `company`; **`#legal_entity` (nearest self-or-ancestor company node) is the single tax anchor** — TaxIdentifier/TaxExemptionCertificate refuse division owners, and purchases read `company_legal_entity`, never the node. `CompanyAddress` (owned rows, labeled, one default per kind via Channel-style demotion + partial index), `CompanyMembership` (always customer-backed; standing = node + subtree, checked via `Customer#standing_for?`/`company_standing(store:)` — never node equality), `CompanyInvitation` (plaintext token, 30-day expiry, pending-scoped uniqueness; mail in `spree/emails`, acceptance via `CompanyInvitations::Accept` running `Customers::Create`; both member-adding surfaces converge on `Companies::AddMember` by email). Carts/orders carry `company_id` (any node; cart-side standing validation, sole-membership resolution in `resolved_company`, frozen at completion). **Catalogs:** `Catalog` (assortment + optional PriceList) + `CatalogProduct` (membership only — **no position**: a catalog decides what a buyer sees, never the order they see it in; category/collection membership stays positioned) + polymorphic `CatalogAssignment` (CustomerGroup|Company — buyer audiences only, company assignments cover the subtree; narrowed 2026-08-28 from the original four: Channel/Market were write-only — a channel's catalog is `spree_channels.default_catalog_id`, a market catalog returns only with a designed regional-assortment reader); visibility = `Products::ForContext` (union of effective catalogs, wired into the store products listing), pricing = catalog price lists nearest-node-first in `Pricing::Resolver` (catalog-bound lists excluded from generic rule matching — a rule-less list must not leak to everyone). Store API self-service (`/store/account/companies`, `/store/companies/*`, unauthenticated invitation lookup/accept, writable cart `company_id`) authorizes by **standing + `Storefront::AccessPolicy`** (company branch answers yes for any member — OSS has no company roles; Enterprise narrows via the policy class + checkout hooks). Dashboard: lazy tree list, node page (sub-units/members+invitations/address book; tax cards hidden on divisions), catalogs pages; slots renamed `company_membership.*`, `company.form_*` only. **Constraints:** never reference the deleted location/contact models; no governance fields on OSS models; `kind` stays the fixed two (divergence = STI, never a second table); catalog/company lookups store-scoped including incidental ids.- `5.4-store-api-bridges.md` — Bridge 6.0 naming into 5.4 Store API (PR #13782)- `5.4-spree-starter-and-create-spree-app.md` — Replace monorepo server/ with spree-starter template repo- `5.4-option-type-enhancements.md` — `kind` (dropdown/color_swatch/buttons) on OptionType + `color_code` on OptionValuediff --git a/docs/api-reference/admin.yaml b/docs/api-reference/admin.yamlindex 713546d68c..e853f4588b 100644--- a/docs/api-reference/admin.yaml+++ b/docs/api-reference/admin.yaml@@ -92,9 +92,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMCwidXNlcl90eXBlIjoiYWRtaW4iLCJqdGkiOiIxNzZlZTdjNy1iZGM5LTRjNTEtYTMxYi0xMDA2MTk3NzRmZjQiLCJpc3MiOiJzcHJlZSIsImF1ZCI6ImFkbWluX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.OKfR80QvwdCVWWz5tevevHyFFnvTuPlEq_Mp18jvSJM+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjE3NmVlN2M3LWJkYzktNGM1MS1hMzFiLTEwMDYxOTc3NGZmNCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.t4Ntas5E8dwfI8wxMdwcC-XVFXWzaFSAFL8_Mv4HnlUuser:- id: adm_PQNMcnNFWw+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Gavinlast_name: Swift@@ -104,7 +104,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_PQNMcnNFWw+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -204,9 +204,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMiwidXNlcl90eXBlIjoiYWRtaW4iLCJqdGkiOiJhYjdjOGIwMS02NDBmLTQyYWYtYWU2NS00MWNjZjk5NWJlZTAiLCJpc3MiOiJzcHJlZSIsImF1ZCI6ImFkbWluX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.-fC-51GZWDnVcvYUU7YBNRxmd6mcD5kXwR0Agw2gc5M+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImFiN2M4YjAxLTY0MGYtNDJhZi1hZTY1LTQxY2NmOTk1YmVlMCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.oXS2FwkI2rK4WOX4QUNW4oTPu7gzMmB9Y9oqsJpW7SYuser:- id: adm_YHETxCGlb0+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Clarinelast_name: Jenkins@@ -216,7 +216,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_YHETxCGlb0+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -318,7 +318,7 @@ paths:application/json:example:user:- id: adm_chYuasQi8r+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Zenobialast_name: Sanford@@ -328,7 +328,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_Ae5s1igzRC+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -447,7 +447,7 @@ paths:application/json:example:user:- id: adm_U5KLWZg9DA+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Phebelast_name: Bosco@@ -457,7 +457,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_lNoiGAYKIU+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -654,9 +654,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyNTYsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiMGJlN2EzZGYtYTJjNi00NmQ4LWE1NmItYTg0ODgwYjJkZmI0IiwiaXNzIjoic3ByZWUiLCJhdWQiOiJhZG1pbl9hcGkiLCJleHAiOjE3Njg0ODIwMDB9.--J8vufEYOtAXHFUaxspYwSvFVlc60RrPP1a50GaX-A+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjBiZTdhM2RmLWEyYzYtNDZkOC1hNTZiLWE4NDg4MGIyZGZiNCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzY4NDgyMDAwfQ.Vo2RzprqsH2XBa8DaSQ6awyXqlBA5QDFA5R7ygTezXYuser:- id: adm_psXklVeMgb+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Olgalast_name: Schneider@@ -666,7 +666,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_gMqHJdmfrX+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -732,9 +732,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozNzMsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiNmMyODU4OTktMTEzNS00MGEyLWE0MGItMTg2M2I4NzBkNGNjIiwiaXNzIjoic3ByZWUiLCJhdWQiOiJhZG1pbl9hcGkiLCJleHAiOjE3Njg0Nzg3MDB9.gfbSWVpFgP0PfBtLnQNcyuIN3QTApVGQJMhAQ_x-Uuc+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjZjMjg1ODk5LTExMzUtNDBhMi1hNDBiLTE4NjNiODcwZDRjYyIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.Go2eUEiXf7rVD5mwtNMqkWqUGcBfhxk3b7JT8dw8uiEuser:- id: adm_Us8LWZg9DA+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Olivialast_name: Owner@@ -744,7 +744,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_UsALWZg9DA+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -2301,7 +2301,7 @@ paths:content:application/json:example:- id: ao_VqXmZF31wY+ id: ao_gbHJdmfrXBorigin: https://admin.example.comcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -2389,7 +2389,7 @@ paths:content:application/json:example:- id: ao_OIJLhNcSbf+ id: ao_UkLWZg9DAJorigin: https://shop.example.comcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -2451,7 +2451,7 @@ paths:content:application/json:example:- id: ao_p6klVeMgbn+ id: ao_UkLWZg9DAJorigin: https://www.example.comcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -2569,7 +2569,7 @@ paths:application/json:example:data:- - id: key_2KY5XM6frI+ - id: key_UkLWZg9DAJname: Storefront keykey_type: publishabletoken_prefix:@@ -2581,7 +2581,7 @@ paths:channel_id:plaintext_token: pk_K6zNkaVogFy735ukK6E7Qs1Fcreated_by_email:- - id: key_HOVtlDrOmL+ - id: key_gbHJdmfrXBname: Backend integrationkey_type: secrettoken_prefix: sk_JiXS5S1gJ@@ -2594,7 +2594,7 @@ paths:channel_id:plaintext_token:created_by_email:- - id: key_ed6l8wVqSM+ - id: key_EfhxLZ9ck8name: velitkey_type: secrettoken_prefix: sk_vihKVmP6r@@ -2666,7 +2666,7 @@ paths:content:application/json:example:- id: key_L3pHOn63Vw+ id: key_VqXmZF31wYname: CI keykey_type: secrettoken_prefix: sk_kCkDUvba1@@ -2762,7 +2762,7 @@ paths:content:application/json:example:- id: key_5OQZnCRf8J+ id: key_UkLWZg9DAJname: Storefront keykey_type: publishabletoken_prefix:@@ -2823,7 +2823,7 @@ paths:content:application/json:example:- id: key_D6Psx31WaT+ id: key_gbHJdmfrXBname: Backend integration (renamed)key_type: secrettoken_prefix: sk_ZPBGFa2TH@@ -2926,7 +2926,7 @@ paths:content:application/json:example:- id: key_8DR0I7fEbw+ id: key_EfhxLZ9ck8name: fugiatkey_type: secrettoken_prefix: sk_L5LVfygvH@@ -2988,7 +2988,7 @@ paths:content:application/json:example:- id: key_QiA48cIW7A+ id: key_gbHJdmfrXBname: Backend integrationkey_type: secrettoken_prefix: sk_11yGX4rad@@ -3127,7 +3127,7 @@ paths:content:application/json:example:- id: ctg_EfhxLZ9ck8+ id: ctg_gbHJdmfrXBname: Shirtspermalink: clothing/shirtsposition: 0@@ -3136,7 +3136,7 @@ paths:meta_description:meta_keywords:children_count: 0- parent_id: ctg_gbHJdmfrXB+ parent_id: ctg_UkLWZg9DAJdescription: ''description_html: ''image_url:@@ -3235,7 +3235,7 @@ paths:content:application/json:example:- id: ctg_uw2YK1rnl0+ id: ctg_UkLWZg9DAJname: Clothingpermalink: clothingposition: 0@@ -3307,7 +3307,7 @@ paths:content:application/json:example:- id: ctg_AXs1igzRC6+ id: ctg_UkLWZg9DAJname: Apparelpermalink: clothingposition: 0@@ -3424,7 +3424,7 @@ paths:content:application/json:example:- id: ctg_98FqgRua4h+ id: ctg_gbHJdmfrXBname: Footwearpermalink: clothing/footwearposition: 0@@ -3433,7 +3433,7 @@ paths:meta_description:meta_keywords:children_count: 0- parent_id: ctg_nJqfPa3Cpe+ parent_id: ctg_UkLWZg9DAJdescription: ''description_html: ''image_url:@@ -3525,14 +3525,14 @@ paths:- data- metapost:- summary: Add a product to a category+ summary: Add products to a categorytags:- Categoriessecurity:- api_key: []bearer_auth: []description: |-- Classifies a product under the category (appended to the end).+ Classifies products under the category in bulk (appended to the end). Already-classified products are skipped; the count reports what was added.**Required scope:** `write_categories` (for API-key authentication).parameters:@@ -3555,98 +3555,34 @@ paths:type: stringresponses:'201':- description: product added+ description: products addedcontent:application/json:example:- id: prod_UkLWZg9DAJ- name: Product 16461- slug: product-16461- meta_title:- meta_description:- meta_keywords:- variant_count: 1- available_on:- preorder_ships_at:- purchasable: true- preorder: false- in_stock: false- backorderable: true- available: true- description: Ab maxime ad est doloribus modi quisquam illum atque.- Perspiciatis ipsam dolores placeat autem eligendi saepe occaecati.- Qui atque beatae quo dolorum accusantium excepturi. Earum necessitatibus- id tempore minima ad. Quas et tenetur quisquam ut perspiciatis ipsum- nulla accusantium. Odit nostrum dolores neque sit ipsa qui veritatis.- Perspiciatis quisquam magni nobis non quas hic voluptate officia.- Voluptatem id odio non earum aliquam facere sunt consectetur. Consequuntur- sequi cupiditate maxime optio eveniet tempora dolorem. Iure voluptatum- dicta praesentium nostrum cum. Voluptate veniam quam accusantium- expedita modi. Maxime cumque eius saepe iusto perspiciatis reprehenderit- alias fugit. Iste culpa soluta occaecati dolorum architecto error- aut totam. Modi voluptatum eius tenetur perferendis ratione consequuntur- tempore. A ea est hic culpa. Dolores delectus provident esse enim- eligendi. Recusandae laborum sed aliquid ad repellendus. Nisi eaque- non laboriosam quibusdam omnis adipisci asperiores odit. Quaerat- mollitia ab distinctio repudiandae occaecati minus autem aliquid.- description_html: |-- Ab maxime ad est doloribus modi quisquam illum atque. Perspiciatis ipsam dolores placeat autem eligendi saepe occaecati. Qui atque beatae quo dolorum accusantium excepturi. Earum necessitatibus id tempore minima ad. Quas et tenetur quisquam ut perspiciatis ipsum nulla accusantium.- Odit nostrum dolores neque sit ipsa qui veritatis. Perspiciatis quisquam magni nobis non quas hic voluptate officia. Voluptatem id odio non earum aliquam facere sunt consectetur.- Consequuntur sequi cupiditate maxime optio eveniet tempora dolorem. Iure voluptatum dicta praesentium nostrum cum. Voluptate veniam quam accusantium expedita modi.- Maxime cumque eius saepe iusto perspiciatis reprehenderit alias fugit. Iste culpa soluta occaecati dolorum architecto error aut totam. Modi voluptatum eius tenetur perferendis ratione consequuntur tempore. A ea est hic culpa.- Dolores delectus provident esse enim eligendi. Recusandae laborum sed aliquid ad repellendus. Nisi eaque non laboriosam quibusdam omnis adipisci asperiores odit. Quaerat mollitia ab distinctio repudiandae occaecati minus autem aliquid.- default_variant_id: variant_UkLWZg9DAJ- buy_box_variant_id: variant_UkLWZg9DAJ- thumbnail_url:- tags: []- price:- id: price_UkLWZg9DAJ- amount: '19.99'- amount_in_cents: 1999- compare_at_amount:- compare_at_amount_in_cents:- currency: USD- display_amount: "$19.99"- display_compare_at_amount:- price_list_id:- variant_id: variant_UkLWZg9DAJ- created_at: '2026-01-15T12:00:00.000Z'- updated_at: '2026-01-15T12:00:00.000Z'- original_price:- seller_id:- external_references: {}- status: active- metadata: {}- deleted_at:- created_at: '2026-01-15T12:00:00.000Z'- updated_at: '2026-01-15T12:00:00.000Z'- delivery_profile_id: fp_UkLWZg9DAJ- seller_name:- product_type_id:- tax_category_id: taxcat_UkLWZg9DAJ- schema:- "$ref": "#/components/schemas/Product"+ added_count: 1requestBody:content:application/json:schema:type: objectproperties:- product_id:- type: string- example: prod_abc123+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123required:- - product_id- "/api/v3/admin/categories/{category_id}/products/{id}":+ - product_idsdelete:- summary: Remove a product from a category+ summary: Remove products from a categorytags:- Categoriessecurity:- api_key: []bearer_auth: []description: |-- Removes a product from the category's manual classification.+ Removes products from the category's manual classification in bulk. Ids that are not classified are ignored; the count reports what was removed.**Required scope:** `write_categories` (for API-key authentication).parameters:@@ -3667,15 +3603,27 @@ paths:description: Category IDschema:type: string- - name: id- in: path- required: true- description: Product ID- schema:- type: stringresponses:- '204':- description: product removed+ '200':+ description: products removed+ content:+ application/json:+ example:+ removed_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids"/api/v3/admin/categories/{category_id}/products/{id}/reposition":patch:summary: Reposition a category product@@ -3883,7 +3831,7 @@ paths:content:application/json:example:- id: ch_VqXmZF31wY+ id: ch_EfhxLZ9ck8name: Marketplacecode: marketplaceactive: true@@ -3984,7 +3932,7 @@ paths:content:application/json:example:- id: ch_uw2YK1rnl0+ id: ch_gbHJdmfrXBname: Wholesalecode: wholesaleactive: true@@ -4041,7 +3989,7 @@ paths:content:application/json:example:- id: ch_OIJLhNcSbf+ id: ch_gbHJdmfrXBname: Wholesale (Updated)code: wholesaleactive: true@@ -4423,7 +4371,7 @@ paths:content:application/json:example:- id: orule_msx3nOJap6+ id: orule_VqXmZF31wYposition: 3active: truecreated_at: '2026-01-15T12:00:00.000Z'@@ -4701,18 +4649,6 @@ paths:application/json:example:data:- - id: cfdef_gbHJdmfrXB- namespace: custom- key: order_notes- label: Order Notes- field_type: short_text- resource_type: Spree::Order- storefront_visible: true- searchable: false- sortable: false- filter_key: cf_custom_order_notes- created_at: '2026-01-15T12:00:00.000Z'- updated_at: '2026-01-15T12:00:00.000Z'- id: cfdef_UkLWZg9DAJnamespace: specskey: fabric@@ -4725,6 +4661,18 @@ paths:filter_key: cf_specs_fabriccreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'+ - id: cfdef_gbHJdmfrXB+ namespace: custom+ key: order_notes+ label: Order Notes+ field_type: short_text+ resource_type: Spree::Order+ storefront_visible: true+ searchable: false+ sortable: false+ filter_key: cf_custom_order_notes+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'meta:page: 1limit: 25@@ -4783,7 +4731,7 @@ paths:content:application/json:example:- id: cfdef_uw2YK1rnl0+ id: cfdef_EfhxLZ9ck8namespace: specskey: originlabel: Country of Origin@@ -4892,7 +4840,7 @@ paths:content:application/json:example:- id: cfdef_OIJLhNcSbf+ id: cfdef_UkLWZg9DAJnamespace: specskey: fabriclabel: Title@@ -4953,7 +4901,7 @@ paths:content:application/json:example:- id: cfdef_p6klVeMgbn+ id: cfdef_UkLWZg9DAJnamespace: specskey: fabriclabel: Fabric Composition@@ -5202,7 +5150,7 @@ paths:content:application/json:example:- id: cg_AXs1igzRC6+ id: cg_EfhxLZ9ck8name: Wholesale 2description: B2B accountscustomers_count: 1@@ -5312,14 +5260,14 @@ paths:content:application/json:example:- id: cg_vEmzDoNU0H+ id: cg_UkLWZg9DAJname: VIPsdescription: Top spenderscustomers_count: 1created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'customers:- - id: cust_p6klVeMgbn+ - id: cust_UkLWZg9DAJemail: [email protected]first_name: Danlast_name: Ebert@@ -5342,7 +5290,7 @@ paths:display_total_spent: "$0.00"last_order_completed_at:customer_group_ids:- - cg_vEmzDoNU0H+ - cg_UkLWZg9DAJschema:"$ref": "#/components/schemas/CustomerGroup"'404':@@ -5407,7 +5355,7 @@ paths:content:application/json:example:- id: cg_s18jaGonyx+ id: cg_UkLWZg9DAJname: VIP customers (Q1)description: Top spenderscustomers_count: 0@@ -5551,7 +5499,7 @@ paths:application/json:example:data:- - id: addr_uw2YK1rnl0+ - id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -5577,8 +5525,8 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'latitude:longitude:- customer_id: cust_nJqfPa3Cpe- owner_id: cust_nJqfPa3Cpe+ customer_id: cust_UkLWZg9DAJ+ owner_id: cust_UkLWZg9DAJowner_type: Spree::Customermeta:page: 1@@ -5651,7 +5599,7 @@ paths:content:application/json:example:- id: addr_AXs1igzRC6+ id: addr_gbHJdmfrXBlabel: Officefirst_name: Janelast_name: Doe@@ -5677,8 +5625,8 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'latitude:longitude:- customer_id: cust_98FqgRua4h- owner_id: cust_98FqgRua4h+ customer_id: cust_UkLWZg9DAJ+ owner_id: cust_UkLWZg9DAJowner_type: Spree::CustomerrequestBody:content:@@ -5770,7 +5718,7 @@ paths:content:application/json:example:- id: addr_p6klVeMgbn+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -5796,8 +5744,8 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'latitude:longitude:- customer_id: cust_xhoCpeNMWu- owner_id: cust_xhoCpeNMWu+ customer_id: cust_UkLWZg9DAJ+ owner_id: cust_UkLWZg9DAJowner_type: Spree::CustomerrequestBody:content:@@ -5933,7 +5881,7 @@ paths:name: Spree Commercedefault: falsegateway_payment_profile_id:- customer_id: cust_2KY5XM6frI+ customer_id: cust_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJmetadata: {}created_at: '2026-01-15T12:00:00.000Z'@@ -6016,7 +5964,7 @@ paths:content:application/json:example:- id: card_gbHJdmfrXB+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -6024,8 +5972,8 @@ paths:name: Spree Commercedefault: falsegateway_payment_profile_id:- customer_id: cust_HOVtlDrOmL- payment_method_id: pm_gbHJdmfrXB+ customer_id: cust_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJmetadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -6155,8 +6103,8 @@ paths:metadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- customer_id: cust_s18jaGonyx- created_by_id: adm_Sm1IszOMIv+ customer_id: cust_UkLWZg9DAJ+ created_by_id: adm_UkLWZg9DAJmeta:page: 1limit: 25@@ -6220,7 +6168,7 @@ paths:content:application/json:example:- id: credit_EfhxLZ9ck8+ id: credit_gbHJdmfrXBamount: '25.0'amount_used: '0.0'amount_remaining: '25.0'@@ -6232,8 +6180,8 @@ paths:metadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- customer_id: cust_GZUcnUYI5A- created_by_id: adm_hwPBvQ85Ws+ customer_id: cust_UkLWZg9DAJ+ created_by_id: adm_gbHJdmfrXBrequestBody:content:application/json:@@ -6308,7 +6256,7 @@ paths:content:application/json:example:- id: credit_VqXmZF31wY+ id: credit_UkLWZg9DAJamount: '50.0'amount_used: '0.0'amount_remaining: '50.0'@@ -6320,8 +6268,8 @@ paths:metadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- customer_id: cust_ROeNhrwyV9- created_by_id: adm_IxJvBlcSU2+ customer_id: cust_UkLWZg9DAJ+ created_by_id: adm_UkLWZg9DAJrequestBody:content:application/json:@@ -6463,7 +6411,7 @@ paths:application/json:example:data:- - id: cust_PQNMcnNFWw+ - id: cust_UkLWZg9DAJemail: [email protected]first_name: Janelast_name: Doe@@ -6482,7 +6430,7 @@ paths:default_billing_address_id:default_shipping_address_id:orders_count: 0- total_spent: '0.0'+ total_spent: '0'display_total_spent: "$0.00"last_order_completed_at:customer_group_ids: []@@ -6547,7 +6495,7 @@ paths:content:application/json:example:- id: cust_YHETxCGlb0+ id: cust_gbHJdmfrXBemail: [email protected]first_name: Newlast_name: Customer@@ -6663,7 +6611,7 @@ paths:content:application/json:example:- id: cust_5OQZnCRf8J+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Janelast_name: Doe@@ -6682,7 +6630,7 @@ paths:default_billing_address_id:default_shipping_address_id:orders_count: 0- total_spent: '0.0'+ total_spent: '0'display_total_spent: "$0.00"last_order_completed_at:customer_group_ids: []@@ -6737,7 +6685,7 @@ paths:content:application/json:example:- id: cust_F0GX8NaP3Y+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Updatedlast_name: Doe@@ -7200,7 +7148,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: products- user_id: adm_2BQY5XM6fr+ user_id: adm_UkLWZg9DAJdone: falsestore_id: store_UkLWZg9DAJseller_id:@@ -7271,13 +7219,13 @@ paths:content:application/json:example:- id: exp_EfhxLZ9ck8+ id: exp_gbHJdmfrXBnumber: EF1002format: csvcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: products- user_id: adm_HZaVtlDrOm+ user_id: adm_UkLWZg9DAJdone: falsestore_id: store_UkLWZg9DAJseller_id:@@ -7374,13 +7322,13 @@ paths:content:application/json:example:- id: exp_VqXmZF31wY+ id: exp_UkLWZg9DAJnumber: EF1001format: csvcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: products- user_id: adm_eVO6l8wVqS+ user_id: adm_UkLWZg9DAJdone: falsestore_id: store_UkLWZg9DAJseller_id:@@ -7563,14 +7511,14 @@ paths:application/json:example:data:- - id: ful_AXs1igzRC6+ - id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_HOVtlDrOmL+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -7590,8 +7538,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_xhoCpeNMWu- variant_id: variant_F0GX8NaP3Y+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -7599,8 +7547,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_xhoCpeNMWu- stock_location_id: sloc_kOKT9MVfb0+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: falsemeta:@@ -7669,14 +7617,14 @@ paths:content:application/json:example:- id: ful_nJqfPa3Cpe+ id: ful_gbHJdmfrXBnumber: R1001-F1tracking: INPOST-12345tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_GZUcnUYI5A+ selected_delivery_rate_id: dr_EfhxLZ9ck8cost: '100.0'display_cost: "$100.00"total: '100.0'@@ -7696,8 +7644,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_vEmzDoNU0H- variant_id: variant_kOKT9MVfb0+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -7705,8 +7653,8 @@ paths:pre_tax_amount: '0.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_vEmzDoNU0H- stock_location_id: sloc_3uWpPTcf5W+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: false'422':@@ -7845,14 +7793,14 @@ paths:content:application/json:example:- id: ful_vEmzDoNU0H+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_YHETxCGlb0+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -7872,8 +7820,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_ed6l8wVqSM- variant_id: variant_msx3nOJap6+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -7881,8 +7829,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_ed6l8wVqSM- stock_location_id: sloc_msx3nOJap6+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: falsepatch:@@ -7943,14 +7891,14 @@ paths:content:application/json:example:- id: ful_2KY5XM6frI+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: 1Z999AA10123456784tracking_url: https://www.ups.com/track?tracknum=1Z999AA10123456784tracking_carrier: upstracking_carrier_name: UPSpickup_point_data:- selected_delivery_rate_id: dr_F0GX8NaP3Y+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -7970,8 +7918,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_s18jaGonyx- variant_id: variant_5CQZnCRf8J+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -7979,8 +7927,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_s18jaGonyx- stock_location_id: sloc_5CQZnCRf8J+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: falserequestBody:@@ -8055,14 +8003,14 @@ paths:content:application/json:example:- id: ful_HOVtlDrOmL+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_3uWpPTcf5W+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -8082,8 +8030,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_GZUcnUYI5A- variant_id: variant_M2nyloHRUQ+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8091,8 +8039,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_GZUcnUYI5A- stock_location_id: sloc_M2nyloHRUQ+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: false"/api/v3/admin/orders/{order_id}/fulfillments/{id}/purchase_label":@@ -8159,14 +8107,14 @@ paths:content:application/json:example:- id: ful_ed6l8wVqSM+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: LBL-123tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_msx3nOJap6+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -8186,8 +8134,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_ROeNhrwyV9- variant_id: variant_prklVeMgbn+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8195,8 +8143,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_ROeNhrwyV9- stock_location_id: sloc_prklVeMgbn+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments:- kind: labelurl: https://carrier.example/label.pdf@@ -8271,14 +8219,14 @@ paths:content:application/json:example:- id: ful_GZUcnUYI5A+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_so8jaGonyx+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -8298,8 +8246,8 @@ paths:estimated_delivery_at:delivered_at: '2026-01-15T12:00:00.000Z'items:- - item_id: li_PQNMcnNFWw- variant_id: variant_rsClYtECFI+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8307,8 +8255,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_PQNMcnNFWw- stock_location_id: sloc_rsClYtECFI+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: false'422':@@ -8391,14 +8339,14 @@ paths:content:application/json:example:- id: ful_L3pHOn63Vw+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_QiA48cIW7A+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -8418,8 +8366,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_YHETxCGlb0- variant_id: variant_aAtNvLSUAr+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8427,8 +8375,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_YHETxCGlb0- stock_location_id: sloc_aAtNvLSUAr+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: false"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":@@ -8489,14 +8437,14 @@ paths:content:application/json:example:- id: ful_PQNMcnNFWw+ id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_8cR0I7fEbw+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -8516,8 +8464,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_5OQZnCRf8J- variant_id: variant_QiA48cIW7A+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8525,8 +8473,8 @@ paths:pre_tax_amount: '100.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_5OQZnCRf8J- stock_location_id: sloc_QiA48cIW7A+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_UkLWZg9DAJdocuments: []provider_generates_labels: false"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":@@ -8598,14 +8546,14 @@ paths:application/json:example:data:- - id: ful_YHETxCGlb0+ - id: ful_gbHJdmfrXBnumber: R1001-F1tracking:tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_qp31JYFduR+ selected_delivery_rate_id: dr_EfhxLZ9ck8cost: '10.0'display_cost: "$10.00"total: '10.0'@@ -8625,8 +8573,8 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_F0GX8NaP3Y- variant_id: variant_QDA48cIW7A+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1metadata: {}tracking_details:@@ -8634,8 +8582,8 @@ paths:pre_tax_amount: '0.0'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- order_id: or_F0GX8NaP3Y- stock_location_id: sloc_8cR0I7fEbw+ order_id: or_UkLWZg9DAJ+ stock_location_id: sloc_gbHJdmfrXBdocuments: []provider_generates_labels: falserequestBody:@@ -8815,7 +8763,7 @@ paths:content:application/json:example:- id: gcb_EfhxLZ9ck8+ id: gcb_gbHJdmfrXBcodes_count: 5currency: USDprefix: NEWCAMP@@ -8823,7 +8771,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'amount: '25.0'expires_at: '2030-12-31'- created_by_id: adm_L50pHOn63V+ created_by_id: adm_UkLWZg9DAJschema:"$ref": "#/components/schemas/GiftCardBatch"'422':@@ -8920,7 +8868,7 @@ paths:content:application/json:example:- id: gcb_uw2YK1rnl0+ id: gcb_UkLWZg9DAJcodes_count: 2currency: USDprefix: WELCOME@@ -9030,7 +8978,7 @@ paths:application/json:example:data:- - id: gc_s18jaGonyx+ - id: gc_UkLWZg9DAJcode: C5BC700C4EF16A06status: activecurrency: USD@@ -9049,7 +8997,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'customer_id:created_by_id:- - id: gc_GZUcnUYI5A+ - id: gc_gbHJdmfrXBcode: 3BECEA5A776AD146status: activecurrency: USD@@ -9152,7 +9100,7 @@ paths:content:application/json:example:- id: gc_YHETxCGlb0+ id: gc_EfhxLZ9ck8code: A68048412201A26Bstatus: activecurrency: USD@@ -9170,7 +9118,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'customer_id:- created_by_id: adm_Fp1GX8NaP3+ created_by_id: adm_UkLWZg9DAJschema:"$ref": "#/components/schemas/GiftCard"'422':@@ -9276,7 +9224,7 @@ paths:content:application/json:example:- id: gc_kOKT9MVfb0+ id: gc_UkLWZg9DAJcode: 06BEABE5C26AA7E5status: activecurrency: USD@@ -9354,7 +9302,7 @@ paths:content:application/json:example:- id: gc_5CQZnCRf8J+ id: gc_UkLWZg9DAJcode: E34E66F15D82A3CDstatus: activecurrency: USD@@ -9483,7 +9431,7 @@ paths:seller_id:owner_type: storeowner_id: store_UkLWZg9DAJ- user_id: adm_pQSklVeMgb+ user_id: adm_UkLWZg9DAJprocessing_errors:preferred_delimiter: ","seller_name:@@ -9663,7 +9611,7 @@ paths:content:application/json:example:- id: imp_EfhxLZ9ck8+ id: imp_gbHJdmfrXBnumber: IM1002rows_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -9674,13 +9622,13 @@ paths:seller_id:owner_type: storeowner_id: store_UkLWZg9DAJ- user_id: adm_s6i8jaGony+ user_id: adm_UkLWZg9DAJprocessing_errors:preferred_delimiter: ","seller_name:original_filename: import.csvoriginal_byte_size: 44- original_file_url: "/api/v3/admin/imports/imp_EfhxLZ9ck8/download"+ original_file_url: "/api/v3/admin/imports/imp_gbHJdmfrXB/download"completed_rows_count: 0failed_rows_count: 0schema_fields:@@ -10125,7 +10073,7 @@ paths:content:application/json:example:- id: imp_AXs1igzRC6+ id: imp_UkLWZg9DAJnumber: IM1001rows_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -10136,13 +10084,13 @@ paths:seller_id:owner_type: storeowner_id: store_UkLWZg9DAJ- user_id: adm_QRPA48cIW7+ user_id: adm_UkLWZg9DAJprocessing_errors:preferred_delimiter: ","seller_name:original_filename: products_import.csvoriginal_byte_size: 3627- original_file_url: "/api/v3/admin/imports/imp_AXs1igzRC6/download"+ original_file_url: "/api/v3/admin/imports/imp_UkLWZg9DAJ/download"completed_rows_count: 0failed_rows_count: 0schema_fields:@@ -10374,7 +10322,7 @@ paths:content:application/json:example:- id: imp_xhoCpeNMWu+ id: imp_gbHJdmfrXBnumber: IM1002rows_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -10385,13 +10333,13 @@ paths:seller_id:owner_type: storeowner_id: store_UkLWZg9DAJ- user_id: adm_oPWlrKdXja+ user_id: adm_UkLWZg9DAJprocessing_errors:preferred_delimiter: ","seller_name:original_filename: products_import.csvoriginal_byte_size: 3627- original_file_url: "/api/v3/admin/imports/imp_xhoCpeNMWu/download"+ original_file_url: "/api/v3/admin/imports/imp_gbHJdmfrXB/download"completed_rows_count: 0failed_rows_count: 0schema_fields:@@ -10518,163 +10466,163 @@ paths:csv_headers: []sample_row: {}mappings:- - id: immap_qp31JYFduR+ - id: immap_UkLWZg9DAJschema_field: slugfile_column: slugrequired: true- - id: immap_JgaEBgznCp+ - id: immap_gbHJdmfrXBschema_field: skufile_column: skurequired: true- - id: immap_tXyJwvFCuK+ - id: immap_EfhxLZ9ck8schema_field: namefile_column: namerequired: true- - id: immap_NJzXvxTk8u+ - id: immap_VqXmZF31wYschema_field: pricefile_column: pricerequired: true- - id: immap_XLbb5HTmVa+ - id: immap_uw2YK1rnl0schema_field: statusfile_column: statusrequired: false- - id: immap_k2KT9MVfb0+ - id: immap_OIJLhNcSbfschema_field: descriptionfile_column: descriptionrequired: false- - id: immap_Z5MUPd7wVj+ - id: immap_AXs1igzRC6schema_field: meta_titlefile_column: meta_titlerequired: false- - id: immap_STIszOMIvc+ - id: immap_p6klVeMgbnschema_field: meta_descriptionfile_column: meta_descriptionrequired: false- - id: immap_LYpHOn63Vw+ - id: immap_nJqfPa3Cpeschema_field: meta_keywordsfile_column: meta_keywordsrequired: false- - id: immap_Kj5Q8YFGzd+ - id: immap_98FqgRua4hschema_field: tagsfile_column: tagsrequired: false- - id: immap_hDBvQ85Ws9+ - id: immap_xhoCpeNMWuschema_field: compare_at_pricefile_column: compare_at_pricerequired: false- - id: immap_IOvBlcSU2T+ - id: immap_vEmzDoNU0Hschema_field: currencyfile_column: currencyrequired: false- - id: immap_K95Q8YFGzd+ - id: immap_2KY5XM6frIschema_field: widthfile_column: widthrequired: false- - id: immap_iIDfaj7G4u+ - id: immap_HOVtlDrOmLschema_field: heightfile_column: heightrequired: false- - id: immap_6AgxZbenF4+ - id: immap_ed6l8wVqSMschema_field: depthfile_column: depthrequired: false- - id: immap_Aks1igzRC6+ - id: immap_s18jaGonyxschema_field: dimensions_unitfile_column: dimensions_unitrequired: false- - id: immap_lmiGAYKIUz+ - id: immap_GZUcnUYI5Aschema_field: weightfile_column: weightrequired: false- - id: immap_yar3EWPH85+ - id: immap_ROeNhrwyV9schema_field: weight_unitfile_column: weight_unitrequired: false- - id: immap_zNcwP3ZbDr+ - id: immap_L3pHOn63Vwschema_field: available_onfile_column: available_onrequired: false- - id: immap_ccuasQi8rC+ - id: immap_PQNMcnNFWwschema_field: discontinue_onfile_column: discontinue_onrequired: false- - id: immap_UkpLWZg9DA+ - id: immap_C9SrJgpzQ4schema_field: track_inventoryfile_column: track_inventoryrequired: false- - id: immap_bnnZn4Y5Fq+ - id: immap_YHETxCGlb0schema_field: inventory_countfile_column: inventory_countrequired: false- - id: immap_UkKLWZg9DA+ - id: immap_5OQZnCRf8Jschema_field: inventory_backorderablefile_column: inventory_backorderablerequired: false- - id: immap_gXZHJdmfrX+ - id: immap_F0GX8NaP3Yschema_field: tax_categoryfile_column: tax_categoryrequired: false- - id: immap_Ej9hxLZ9ck+ - id: immap_kOKT9MVfb0schema_field: product_typefile_column:required: false- - id: immap_VZ3XmZF31w+ - id: immap_3uWpPTcf5Wschema_field: hs_codefile_column:required: false- - id: immap_uEf2YK1rnl+ - id: immap_D6Psx31WaTschema_field: country_of_originfile_column:required: false- - id: immap_OtvJLhNcSb+ - id: immap_msx3nOJap6schema_field: customs_descriptionfile_column:required: false- - id: immap_ARbs1igzRC+ - id: immap_5CQZnCRf8Jschema_field: image1_srcfile_column: image1_srcrequired: false- - id: immap_p5gklVeMgb+ - id: immap_M2nyloHRUQschema_field: image2_srcfile_column: image2_srcrequired: false- - id: immap_nWaqfPa3Cp+ - id: immap_prklVeMgbnschema_field: image3_srcfile_column: image3_srcrequired: false- - id: immap_9URFqgRua4+ - id: immap_so8jaGonyxschema_field: option1_namefile_column: option1_namerequired: false- - id: immap_xiBoCpeNMW+ - id: immap_rsClYtECFIschema_field: option1_valuefile_column: option1_valuerequired: false- - id: immap_vohmzDoNU0+ - id: immap_8DR0I7fEbwschema_field: option2_namefile_column: option2_namerequired: false- - id: immap_2h5Y5XM6fr+ - id: immap_aAtNvLSUArschema_field: option2_valuefile_column: option2_valuerequired: false- - id: immap_HbJVtlDrOm+ - id: immap_QiA48cIW7Aschema_field: option3_namefile_column: option3_namerequired: false- - id: immap_eH46l8wVqS+ - id: immap_QDA48cIW7Aschema_field: option3_valuefile_column: option3_valuerequired: false- - id: immap_se78jaGony+ - id: immap_8cR0I7fEbwschema_field: category1file_column: category1required: false- - id: immap_GpMUcnUYI5+ - id: immap_oqlrKdXjaPschema_field: category2file_column: category2required: false- - id: immap_RgJeNhrwyV+ - id: immap_48Olu6p4zZschema_field: category3file_column: category3required: false@@ -10734,7 +10682,7 @@ paths:content:application/json:example:- id: imp_2KY5XM6frI+ id: imp_gbHJdmfrXBnumber: IM1002rows_count: 1created_at: '2026-01-15T12:00:00.000Z'@@ -10745,13 +10693,13 @@ paths:seller_id:owner_type: storeowner_id: store_UkLWZg9DAJ- user_id: adm_4teOlu6p4z+ user_id: adm_UkLWZg9DAJprocessing_errors:preferred_delimiter: ","seller_name:original_filename: products_import.csvoriginal_byte_size: 3627- original_file_url: "/api/v3/admin/imports/imp_2KY5XM6frI/download"+ original_file_url: "/api/v3/admin/imports/imp_gbHJdmfrXB/download"completed_rows_count: 0failed_rows_count: 1schema_fields:@@ -10919,13 +10867,13 @@ paths:application/json:example:data:- - id: imrow_EfhxLZ9ck8+ - id: imrow_gbHJdmfrXBrow_number: 2status: failedvalidation_errors: boomcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- import_id: imp_HOVtlDrOmL+ import_id: imp_UkLWZg9DAJitem_type:item_id:data:@@ -11123,7 +11071,7 @@ paths:content:application/json:example:- id: mkt_VqXmZF31wY+ id: mkt_EfhxLZ9ck8name: France onlycurrency: EURdefault_locale: fr@@ -11262,7 +11210,7 @@ paths:content:application/json:example:- id: mkt_OIJLhNcSbf+ id: mkt_gbHJdmfrXBname: EUcurrency: USDdefault_locale: en@@ -11343,7 +11291,7 @@ paths:content:application/json:example:- id: mkt_p6klVeMgbn+ id: mkt_gbHJdmfrXBname: European Unioncurrency: USDdefault_locale: en@@ -11623,7 +11571,7 @@ paths:content:application/json:example:- id: opt_VqXmZF31wY+ id: opt_gbHJdmfrXBname: materiallabel: Materialposition: 2@@ -11748,7 +11696,7 @@ paths:content:application/json:example:- id: opt_OIJLhNcSbf+ id: opt_UkLWZg9DAJname: foo-size-5label: Sizeposition: 1@@ -11822,7 +11770,7 @@ paths:content:application/json:example:- id: opt_p6klVeMgbn+ id: opt_UkLWZg9DAJname: foo-size-7label: Updated Labelposition: 1@@ -11983,7 +11931,7 @@ paths:included: falserate: '0.15'tax_rate_id:- line_item_id: li_uw2YK1rnl0+ line_item_id: li_UkLWZg9DAJfulfillment_id:fee_id:amount: '1.5'@@ -12064,7 +12012,7 @@ paths:value_type:value:promotion_id:- line_item_id: li_OIJLhNcSbf+ line_item_id: li_UkLWZg9DAJfulfillment_id:amount: "-2.0"display_amount: "-$2.00"@@ -12138,14 +12086,14 @@ paths:application/json:example:data:- - id: disc_gbHJdmfrXB+ - id: disc_UkLWZg9DAJlabel: Appeasementkind: manualcode:value_type: flatvalue: '3.0'promotion_id:- line_item_id: li_AXs1igzRC6+ line_item_id: li_UkLWZg9DAJfulfillment_id:amount: "-3.0"display_amount: "-$3.00"@@ -12346,7 +12294,7 @@ paths:content:application/json:example:- id: gc_QiA48cIW7A+ id: gc_UkLWZg9DAJcode: 16C1B414C44A2F41status: activecurrency: USD@@ -12497,15 +12445,15 @@ paths:application/json:example:data:- - id: li_D6Psx31WaT- variant_id: variant_qp31JYFduR+ - id: li_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBseller_id:preorder: falsepreorder_ships_at:quantity: 2currency: USD- name: Product 409180- slug: product-409180+ name: Product 429180+ slug: product-429180options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -12528,7 +12476,7 @@ paths:thumbnail_url:option_values:- id: optval_UkLWZg9DAJ- option_type_id: opt_xhoCpeNMWu+ option_type_id: opt_UkLWZg9DAJname: size-1label: Sposition: 1@@ -12544,7 +12492,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'cost_price: '17.0'- tax_category_id: taxcat_8cR0I7fEbw+ tax_category_id: taxcat_UkLWZg9DAJmeta:page: 1limit: 25@@ -12608,15 +12556,15 @@ paths:content:application/json:example:- id: li_5CQZnCRf8J- variant_id: variant_XLbb5HTmVa+ id: li_gbHJdmfrXB+ variant_id: variant_VqXmZF31wYseller_id:preorder: falsepreorder_ships_at:quantity: 3currency: USD- name: Product 4299- slug: product-4299+ name: Product 4499+ slug: product-4499options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -12638,8 +12586,8 @@ paths:compare_at_amount:thumbnail_url:option_values:- - id: optval_EfhxLZ9ck8- option_type_id: opt_2KY5XM6frI+ - id: optval_gbHJdmfrXB+ option_type_id: opt_gbHJdmfrXBname: size-3label: Sposition: 1@@ -12655,7 +12603,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'cost_price: '17.0'- tax_category_id: taxcat_oqlrKdXjaP+ tax_category_id: taxcat_UkLWZg9DAJrequestBody:content:application/json:@@ -12741,15 +12689,15 @@ paths:content:application/json:example:- id: li_M2nyloHRUQ- variant_id: variant_Z5MUPd7wVj+ id: li_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBseller_id:preorder: falsepreorder_ships_at:quantity: 2currency: USD- name: Product 432714- slug: product-432714+ name: Product 452714+ slug: product-452714options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -12771,8 +12719,8 @@ paths:compare_at_amount:thumbnail_url:option_values:- - id: optval_VqXmZF31wY- option_type_id: opt_HOVtlDrOmL+ - id: optval_UkLWZg9DAJ+ option_type_id: opt_UkLWZg9DAJname: size-4label: Sposition: 1@@ -12788,7 +12736,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'cost_price: '17.0'- tax_category_id: taxcat_48Olu6p4zZ+ tax_category_id: taxcat_UkLWZg9DAJpatch:summary: Update an itemtags:@@ -12847,15 +12795,15 @@ paths:content:application/json:example:- id: li_prklVeMgbn- variant_id: variant_LYpHOn63Vw+ id: li_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBseller_id:preorder: falsepreorder_ships_at:quantity: 5currency: USD- name: Product 449758- slug: product-449758+ name: Product 469758+ slug: product-469758options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -12877,8 +12825,8 @@ paths:compare_at_amount:thumbnail_url:option_values:- - id: optval_uw2YK1rnl0- option_type_id: opt_ed6l8wVqSM+ - id: optval_UkLWZg9DAJ+ option_type_id: opt_UkLWZg9DAJname: size-5label: Sposition: 1@@ -12894,7 +12842,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'cost_price: '17.0'- tax_category_id: taxcat_qp31JYFduR+ tax_category_id: taxcat_UkLWZg9DAJrequestBody:content:application/json:@@ -13009,7 +12957,7 @@ paths:content:application/json:example:- id: or_qp31JYFduR+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -13087,7 +13035,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_p5gklVeMgb+ customer_id: cust_UkLWZg9DAJrequestBody:content:application/json:@@ -13254,7 +13202,7 @@ paths:application/json:example:data:- - id: or_tXyJwvFCuK+ - id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -13332,7 +13280,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_9URFqgRua4+ customer_id: cust_UkLWZg9DAJmeta:page: 1limit: 25@@ -13476,7 +13424,7 @@ paths:content:application/json:example:- id: or_STIszOMIvc+ id: or_gbHJdmfrXBmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -13545,7 +13493,7 @@ paths:approved_at:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- preferred_stock_location_id: sloc_Aks1igzRC6+ preferred_stock_location_id: sloc_UkLWZg9DAJseller_id:order_group_id:tags: []@@ -13731,7 +13679,7 @@ paths:content:application/json:example:- id: or_LYpHOn63Vw+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -13809,7 +13757,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_HbJVtlDrOm+ customer_id: cust_UkLWZg9DAJ'404':description: order not foundcontent:@@ -13874,7 +13822,7 @@ paths:content:application/json:example:- id: or_hDBvQ85Ws9+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -13952,7 +13900,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_se78jaGony+ customer_id: cust_UkLWZg9DAJrequestBody:content:application/json:@@ -14129,7 +14077,7 @@ paths:content:application/json:example:- id: or_K95Q8YFGzd+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -14207,7 +14155,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_RgJeNhrwyV+ customer_id: cust_UkLWZg9DAJ'422':description: order cannot be completedcontent:@@ -14284,7 +14232,7 @@ paths:content:application/json:example:- id: or_6AgxZbenF4+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -14360,9 +14308,9 @@ paths:internal_note:internal_note_html:approver_id:- canceler_id: adm_E9UhxLZ9ck+ canceler_id: adm_UkLWZg9DAJcreated_by_id:- customer_id: cust_PcANMcnNFW+ customer_id: cust_UkLWZg9DAJrequestBody:content:application/json:@@ -14423,7 +14371,7 @@ paths:content:application/json:example:- id: or_Aks1igzRC6+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -14498,10 +14446,10 @@ paths:tags: []internal_note:internal_note_html:- approver_id: adm_VqTXmZF31w+ approver_id: adm_UkLWZg9DAJcanceler_id:created_by_id:- customer_id: cust_CvFSrJgpzQ+ customer_id: cust_UkLWZg9DAJ"/api/v3/admin/orders/{id}/resume":patch:summary: Resume a canceled order@@ -14553,7 +14501,7 @@ paths:content:application/json:example:- id: or_lmiGAYKIUz+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -14629,9 +14577,9 @@ paths:internal_note:internal_note_html:approver_id:- canceler_id: adm_ujG2YK1rnl+ canceler_id: adm_UkLWZg9DAJcreated_by_id:- customer_id: cust_YBVETxCGlb+ customer_id: cust_UkLWZg9DAJ"/api/v3/admin/orders/{id}/resend_confirmation":post:summary: Resend confirmation email@@ -14683,7 +14631,7 @@ paths:content:application/json:example:- id: or_yar3EWPH85+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -14761,7 +14709,7 @@ paths:approver_id:canceler_id:created_by_id:- customer_id: cust_5sJQZnCRf8+ customer_id: cust_UkLWZg9DAJ"/api/v3/admin/payment_methods":get:summary: List payment methods@@ -14821,7 +14769,7 @@ paths:application/json:example:data:- - id: pm_K95Q8YFGzd+ - id: pm_UkLWZg9DAJname: Checkdescription:type: check@@ -14970,7 +14918,7 @@ paths:content:application/json:example:- id: pm_Aks1igzRC6+ id: pm_UkLWZg9DAJname: Checkdescription:type: check@@ -15053,17 +15001,17 @@ paths:application/json:example:data:- - id: py_ed6l8wVqSM- payment_method_id: pm_so8jaGonyx+ - id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code: BGS-343039b69b86number: R1001-P1status: completedamount: '110.0'display_amount: "$110.00"source_type: credit_card- source_id: card_GZUcnUYI5A+ source_id: card_UkLWZg9DAJsource:- id: card_GZUcnUYI5A+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -15072,7 +15020,7 @@ paths:default: falsegateway_payment_profile_id:customer_id:- payment_method_id: pm_rsClYtECFI+ payment_method_id: pm_gbHJdmfrXBmetadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -15083,7 +15031,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'captured_amount: '0.0'- order_id: or_so8jaGonyx+ order_id: or_UkLWZg9DAJmeta:page: 1limit: 25@@ -15148,8 +15096,8 @@ paths:content:application/json:example:- id: py_GZUcnUYI5A- payment_method_id: pm_QiA48cIW7A+ id: py_gbHJdmfrXB+ payment_method_id: pm_EfhxLZ9ck8response_code:number: R1002-P1status: checkout@@ -15165,7 +15113,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'captured_amount: '0.0'- order_id: or_8DR0I7fEbw+ order_id: or_gbHJdmfrXBrequestBody:content:application/json:@@ -15254,17 +15202,17 @@ paths:content:application/json:example:- id: py_ROeNhrwyV9- payment_method_id: pm_QDA48cIW7A+ id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code: BGS-4a236d40ef07number: R1001-P1status: completedamount: '110.0'display_amount: "$110.00"source_type: credit_card- source_id: card_L3pHOn63Vw+ source_id: card_UkLWZg9DAJsource:- id: card_L3pHOn63Vw+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -15273,7 +15221,7 @@ paths:default: falsegateway_payment_profile_id:customer_id:- payment_method_id: pm_8cR0I7fEbw+ payment_method_id: pm_gbHJdmfrXBmetadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -15284,7 +15232,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'captured_amount: '0.0'- order_id: or_aAtNvLSUAr+ order_id: or_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/payments/{id}/capture":patch:summary: Capture a payment@@ -15343,17 +15291,17 @@ paths:content:application/json:example:- id: py_L3pHOn63Vw- payment_method_id: pm_oqlrKdXjaP+ id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code: BGS-ccc19f06b194number: R1001-P1status: completedamount: '110.0'display_amount: "$110.00"source_type: credit_card- source_id: card_PQNMcnNFWw+ source_id: card_UkLWZg9DAJsource:- id: card_PQNMcnNFWw+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -15362,7 +15310,7 @@ paths:default: falsegateway_payment_profile_id:customer_id:- payment_method_id: pm_48Olu6p4zZ+ payment_method_id: pm_gbHJdmfrXBmetadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -15373,7 +15321,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'captured_amount: '110.0'- order_id: or_QiA48cIW7A+ order_id: or_UkLWZg9DAJ'422':description: capture failedcontent:@@ -15441,17 +15389,17 @@ paths:content:application/json:example:- id: py_C9SrJgpzQ4- payment_method_id: pm_tXyJwvFCuK+ id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code: void-BGS-11f2e975ba0cnumber: R1001-P1status: voidamount: '110.0'display_amount: "$110.00"source_type: credit_card- source_id: card_YHETxCGlb0+ source_id: card_UkLWZg9DAJsource:- id: card_YHETxCGlb0+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -15460,7 +15408,7 @@ paths:default: falsegateway_payment_profile_id:customer_id:- payment_method_id: pm_NJzXvxTk8u+ payment_method_id: pm_gbHJdmfrXBmetadata: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -15471,7 +15419,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'captured_amount: '0.0'- order_id: or_8cR0I7fEbw+ order_id: or_UkLWZg9DAJ"/api/v3/admin/price_lists":get:summary: List price lists@@ -15562,7 +15510,6 @@ paths:currently_active: falseproducts_count: 0prices_count: 0- product_ids: []- id: pl_gbHJdmfrXBname: Holidaydescription:@@ -15577,7 +15524,6 @@ paths:currently_active: falseproducts_count: 0prices_count: 0- product_ids: []meta:page: 1limit: 25@@ -15625,8 +15571,8 @@ paths:// Server-to-server one-shot create. Ship the rules that gate the list// and the exact per-variant prices in a single request — variants in// `prices` implicitly become part of the list (upserted on the unique- // key `(variant_id, currency, price_list_id)`), so there's no need to- // pre-declare `product_ids` separately.+ // key `(variant_id, currency, price_list_id)`). Curating whole products+ // goes through `client.priceLists.products` instead.const priceList = await client.priceLists.create({name: 'EU wholesale',description: 'Tiered pricing for verified B2B customers',@@ -15674,11 +15620,11 @@ paths:type: stringresponses:'201':- description: price list created (server-to-server — rules + prices, no product_ids)+ description: price list created (server-to-server — rules + prices)content:application/json:example:- id: pl_p6klVeMgbn+ id: pl_EfhxLZ9ck8name: EU wholesaledescription:status: draft@@ -15692,8 +15638,6 @@ paths:currently_active: falseproducts_count: 1prices_count: 2- product_ids:- - prod_Ej9hxLZ9ckschema:"$ref": "#/components/schemas/PriceList"'422':@@ -15740,13 +15684,6 @@ paths:position:type: integerexample: 1- product_ids:- type: array- items:- type: string- description: Prefixed product ids to seed the list with.- example:- - prod_aBc123rules:type: arraydescription: STI-typed price rules to attach on create. Existing@@ -15764,12 +15701,12 @@ paths:additionalProperties: trueprices: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.'+ description: 'Server-to-server shape: ship the exact per-variant+ prices the list should contain. Each row upserts on the unique+ key `(variant_id, currency, price_list_id)` — `prices` alone tells+ the server which variants belong to the list and what the override+ amount is. Curating whole products goes through the nested `/price_lists/{id}/products`+ surface instead.'items:type: objectrequired:@@ -15842,7 +15779,7 @@ paths:content:application/json:example:- id: pl_xhoCpeNMWu+ id: pl_UkLWZg9DAJname: Wholesaledescription:status: draft@@ -15856,7 +15793,6 @@ paths:currently_active: falseproducts_count: 0prices_count: 0- product_ids: []schema:"$ref": "#/components/schemas/PriceList"'404':@@ -15918,7 +15854,7 @@ paths:content:application/json:example:- id: pl_C9SrJgpzQ4+ id: pl_UkLWZg9DAJname: Wholesale (Q3)description:status: draft@@ -15932,7 +15868,6 @@ paths:currently_active: falseproducts_count: 0prices_count: 0- product_ids: []schema:"$ref": "#/components/schemas/PriceList"requestBody:@@ -15959,14 +15894,6 @@ paths:- anyposition:type: integer- product_ids:- type: array- items:- type: string- description: Prefixed product ids — reconciles list membership (adds- + removes).- example:- - prod_aBc123rules:type: arrayitems:@@ -16107,7 +16034,7 @@ paths:content:application/json:example:- id: pl_kOKT9MVfb0+ id: pl_UkLWZg9DAJname: Wholesaledescription:status: active@@ -16121,7 +16048,6 @@ paths:currently_active: trueproducts_count: 0prices_count: 0- product_ids: []schema:"$ref": "#/components/schemas/PriceList""/api/v3/admin/price_lists/{id}/deactivate":@@ -16171,7 +16097,7 @@ paths:content:application/json:example:- id: pl_D6Psx31WaT+ id: pl_UkLWZg9DAJname: Price List 1description:status: inactive@@ -16185,7 +16111,6 @@ paths:currently_active: falseproducts_count: 0prices_count: 0- product_ids: []schema:"$ref": "#/components/schemas/PriceList""/api/v3/admin/prices":@@ -16285,7 +16210,7 @@ paths:application/json:example:data:- - id: price_86PR0I7fEb+ - id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -16294,10 +16219,10 @@ paths:display_amount: "$19.99"display_compare_at_amount:price_list_id:- variant_id: variant_eH46l8wVqS+ variant_id: variant_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- - id: price_arstNvLSUA+ - id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -16306,10 +16231,10 @@ paths:display_amount: "$19.99"display_compare_at_amount:price_list_id:- variant_id: variant_se78jaGony+ variant_id: variant_gbHJdmfrXBcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- - id: price_Q8DA48cIW7+ - id: price_EfhxLZ9ck8amount: '5.0'amount_in_cents: 500compare_at_amount:@@ -16317,8 +16242,8 @@ paths:currency: USDdisplay_amount: "$5.00"display_compare_at_amount:- price_list_id: pl_5CQZnCRf8J- variant_id: variant_se78jaGony+ price_list_id: pl_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'meta:@@ -16392,7 +16317,7 @@ paths:content:application/json:example:- id: price_q0k31JYFdu+ id: price_uw2YK1rnl0amount: '9.99'amount_in_cents: 999compare_at_amount:@@ -16401,7 +16326,7 @@ paths:display_amount: "€9.99"display_compare_at_amount:price_list_id:- variant_id: variant_LKWpHOn63V+ variant_id: variant_EfhxLZ9ck8created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'schema:@@ -16480,7 +16405,7 @@ paths:content:application/json:example:- id: price_NuazXvxTk8+ id: price_EfhxLZ9ck8amount: '5.0'amount_in_cents: 500compare_at_amount:@@ -16488,8 +16413,8 @@ paths:currency: USDdisplay_amount: "$5.00"display_compare_at_amount:- price_list_id: pl_prklVeMgbn- variant_id: variant_CvFSrJgpzQ+ price_list_id: pl_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'schema:@@ -16546,7 +16471,7 @@ paths:content:application/json:example:- id: price_KAw5Q8YFGz+ id: price_EfhxLZ9ck8amount: '12.34'amount_in_cents: 1234compare_at_amount:@@ -16554,8 +16479,8 @@ paths:currency: USDdisplay_amount: "$12.34"display_compare_at_amount:- price_list_id: pl_rsClYtECFI- variant_id: variant_kQJKT9MVfb+ price_list_id: pl_UkLWZg9DAJ+ variant_id: variant_gbHJdmfrXBcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'schema:@@ -16872,7 +16797,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'storefront_visible: true- custom_field_definition_id: cfdef_HOVtlDrOmL+ custom_field_definition_id: cfdef_UkLWZg9DAJmeta:page: 1limit: 25@@ -16934,7 +16859,7 @@ paths:content:application/json:example:- id: cf_EfhxLZ9ck8+ id: cf_gbHJdmfrXBlabel: Descriptiontype: Spree::CustomFields::LongTextfield_type: long_text@@ -16943,7 +16868,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'storefront_visible: true- custom_field_definition_id: cfdef_s18jaGonyx+ custom_field_definition_id: cfdef_gbHJdmfrXB'422':description: duplicate definition for the same productcontent:@@ -17034,7 +16959,7 @@ paths:content:application/json:example:- id: cf_uw2YK1rnl0+ id: cf_UkLWZg9DAJlabel: Titletype: Spree::CustomFields::ShortTextfield_type: short_text@@ -17043,7 +16968,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'storefront_visible: true- custom_field_definition_id: cfdef_ROeNhrwyV9+ custom_field_definition_id: cfdef_UkLWZg9DAJpatch:summary: Update a product custom fieldtags:@@ -17099,7 +17024,7 @@ paths:content:application/json:example:- id: cf_OIJLhNcSbf+ id: cf_UkLWZg9DAJlabel: Titletype: Spree::CustomFields::ShortTextfield_type: short_text@@ -17108,7 +17033,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'storefront_visible: true- custom_field_definition_id: cfdef_L3pHOn63Vw+ custom_field_definition_id: cfdef_UkLWZg9DAJrequestBody:content:application/json:@@ -17201,7 +17126,7 @@ paths:application/json:example:data:- resource_id: prod_5sJQZnCRf8+ resource_id: prod_UkLWZg9DAJresource_type: producttranslations:de:@@ -17338,9 +17263,9 @@ paths:application/json:example:data:- - id: prod_FLTGX8NaP3- name: Product 856550- slug: product-856550+ - id: prod_UkLWZg9DAJ+ name: Product 846550+ slug: product-846550meta_title:meta_description:meta_keywords:@@ -17358,12 +17283,12 @@ paths:description_html: Saepe quas nemo facilis nam. Voluptatem facerenam impedit sunt minus possimus totam ullam. Pariatur ullam sedtenetur quibusdam deleniti.- default_variant_id: variant_JyHaEBgznC- buy_box_variant_id: variant_JyHaEBgznC+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_xDjoCpeNMW+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -17372,7 +17297,7 @@ paths:display_amount: "$19.99"display_compare_at_amount:price_list_id:- variant_id: variant_JyHaEBgznC+ variant_id: variant_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'original_price:@@ -17386,7 +17311,7 @@ paths:delivery_profile_id: fp_UkLWZg9DAJseller_name:product_type_id:- tax_category_id: taxcat_GpMUcnUYI5+ tax_category_id: taxcat_UkLWZg9DAJmeta:page: 1limit: 25@@ -17497,7 +17422,7 @@ paths:content:application/json:example:- id: prod_DzgPsx31Wa+ id: prod_gbHJdmfrXBname: New Productslug: new-productmeta_title:@@ -17513,8 +17438,8 @@ paths:available: falsedescription:description_html:- default_variant_id: variant_XMpbb5HTmV- buy_box_variant_id: variant_XMpbb5HTmV+ default_variant_id: variant_gbHJdmfrXB+ buy_box_variant_id: variant_gbHJdmfrXBthumbnail_url:tags: []price:@@ -17732,9 +17657,9 @@ paths:content:application/json:example:- id: prod_5sSQZnCRf8- name: Product 892061- slug: product-892061+ id: prod_UkLWZg9DAJ+ name: Product 882061+ slug: product-882061meta_title:meta_description:meta_keywords:@@ -17750,12 +17675,12 @@ paths:velit laborum iure. Harum sit eaque nam ipsam maiores.description_html: Illo error explicabo cupiditate consequatur. Etexpedita velit laborum iure. Harum sit eaque nam ipsam maiores.- default_variant_id: variant_ZqQMUPd7wV- buy_box_variant_id: variant_ZqQMUPd7wV+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_eVO6l8wVqS+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -17764,7 +17689,7 @@ paths:display_amount: "$19.99"display_compare_at_amount:price_list_id:- variant_id: variant_ZqQMUPd7wV+ variant_id: variant_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'original_price:@@ -17778,7 +17703,7 @@ paths:delivery_profile_id: fp_UkLWZg9DAJseller_name:product_type_id:- tax_category_id: taxcat_CvFSrJgpzQ+ tax_category_id: taxcat_UkLWZg9DAJschema:"$ref": "#/components/schemas/Product"'404':@@ -17845,9 +17770,9 @@ paths:content:application/json:example:- id: prod_p5CklVeMgb+ id: prod_UkLWZg9DAJname: Updated Name- slug: product-915339+ slug: product-905339meta_title:meta_description:meta_keywords:@@ -17873,12 +17798,12 @@ paths:Laborum nostrum nemo fugit temporibus consectetur omnis. Necessitatibus voluptas ut delectus aperiam incidunt tenetur. Alias at perspiciatis laborum similique. Fugit adipisci iure porro architecto odit.Alias enim quis rem reprehenderit temporibus. Hic quae rem aspernatur tempore in. Praesentium assumenda sequi quis quasi. Laboriosam est tempore doloribus cumque inventore vero laborum minus. Reiciendis autem quia eligendi possimus beatae enim.Impedit nemo quae odit dolor velit possimus commodi. Sequi ullam dolorum odio at quam vitae. Corporis ipsa alias tempora accusantium. Adipisci sapiente illum id voluptatum aut illo tempora.- default_variant_id: variant_LKEpHOn63V- buy_box_variant_id: variant_LKEpHOn63V+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_GknUcnUYI5+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -17887,7 +17812,7 @@ paths:display_amount: "$19.99"display_compare_at_amount:price_list_id:- variant_id: variant_LKEpHOn63V+ variant_id: variant_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'original_price:@@ -17901,7 +17826,7 @@ paths:delivery_profile_id: fp_UkLWZg9DAJseller_name:product_type_id:- tax_category_id: taxcat_5sJQZnCRf8+ tax_category_id: taxcat_UkLWZg9DAJschema:"$ref": "#/components/schemas/Product"'422':@@ -18987,7 +18912,7 @@ paths:content:application/json:example:- id: pol_p6klVeMgbn+ id: pol_OIJLhNcSbfname: Wholesale Policyslug: wholesale-policybody: Trade orders ship within five working days.@@ -19079,7 +19004,7 @@ paths:content:application/json:example:- id: pol_98FqgRua4h+ id: pol_uw2YK1rnl0name: Restocking Policyslug: restocking-policybody: Return anything unopened within 30 days.@@ -19145,7 +19070,7 @@ paths:content:application/json:example:- id: pol_vEmzDoNU0H+ id: pol_uw2YK1rnl0name: Restocking Policyslug: restocking-policybody: Return anything unopened within 60 days.@@ -19336,7 +19261,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: free_shipping- promotion_id: promo_gbHJdmfrXB+ promotion_id: promo_UkLWZg9DAJpreferences: {}preference_schema: []label: Free shipping@@ -19397,11 +19322,11 @@ paths:content:application/json:example:- id: pact_gbHJdmfrXB+ id: pact_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: free_shipping- promotion_id: promo_EfhxLZ9ck8+ promotion_id: promo_UkLWZg9DAJpreferences: {}preference_schema: []label: Free shipping@@ -19530,7 +19455,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: currency- promotion_id: promo_OIJLhNcSbf+ promotion_id: promo_UkLWZg9DAJpreferences:currency: USDpreference_schema:@@ -19597,11 +19522,11 @@ paths:content:application/json:example:- id: prorule_gbHJdmfrXB+ id: prorule_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: currency- promotion_id: promo_AXs1igzRC6+ promotion_id: promo_UkLWZg9DAJpreferences:currency: EURpreference_schema:@@ -19689,11 +19614,11 @@ paths:content:application/json:example:- id: prorule_EfhxLZ9ck8+ id: prorule_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: currency- promotion_id: promo_nJqfPa3Cpe+ promotion_id: promo_UkLWZg9DAJpreferences:currency: GBPpreference_schema:@@ -19795,7 +19720,7 @@ paths:application/json:example:data:- - id: promo_xhoCpeNMWu+ - id: promo_UkLWZg9DAJname: Summer Saledescription:code: summer@@ -19914,7 +19839,7 @@ paths:content:application/json:example:- id: promo_ed6l8wVqSM+ id: promo_gbHJdmfrXBname: Black Fridaydescription:code: blackfriday-os@@ -19932,12 +19857,12 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'action_ids:- - pact_VqXmZF31wY- - pact_uw2YK1rnl0+ - pact_UkLWZg9DAJ+ - pact_gbHJdmfrXBrule_ids:- - prorule_uw2YK1rnl0- - prorule_OIJLhNcSbf- - prorule_AXs1igzRC6+ - prorule_UkLWZg9DAJ+ - prorule_gbHJdmfrXB+ - prorule_EfhxLZ9ck8'422':description: invalid paramscontent:@@ -20092,7 +20017,7 @@ paths:content:application/json:example:- id: promo_GZUcnUYI5A+ id: promo_UkLWZg9DAJname: Summer Saledescription:code: summer@@ -20201,7 +20126,7 @@ paths:content:application/json:example:- id: promo_PQNMcnNFWw+ id: promo_UkLWZg9DAJname: Summer Saledescription:code: summer@@ -20514,18 +20439,18 @@ paths:label: Item totaldescription:preference_schema:- - key: amount_min- type: decimal- default: 100.0- - key: operator_min- type: string- default: ">"- key: amount_maxtype: decimaldefault:- key: operator_maxtype: stringdefault: "<"+ - key: amount_min+ type: decimal+ default: 100.0+ - key: operator_min+ type: string+ default: ">"- type: marketlabel: Market(s)description:@@ -20545,12 +20470,12 @@ paths:label: Option Value(s)description:preference_schema:- - key: match_policy- type: string- default: any- key: eligible_valuestype: arraydefault: []+ - key: match_policy+ type: string+ default: any- type: productlabel: Product(s)description:@@ -20691,8 +20616,8 @@ paths:id: re_UkLWZg9DAJtransaction_id: BGS-c5ae59a82a25amount: '5.0'- payment_id: py_5OQZnCRf8J- refund_reason_id: rr_gbHJdmfrXB+ payment_id: py_UkLWZg9DAJ+ refund_reason_id: rr_UkLWZg9DAJoriginator_id:originator_type:metadata: {}@@ -21579,7 +21504,7 @@ paths:deleted_at:amount: '0.19'amount_percentage: 19.0- tax_category_id: taxcat_kQYKT9MVfb+ tax_category_id: taxcat_UkLWZg9DAJstore_id: store_UkLWZg9DAJcountry_code: DEstate_code:@@ -21652,7 +21577,7 @@ paths:content:application/json:example:- id: tax_VqXmZF31wY+ id: tax_gbHJdmfrXBname: VATincluded_in_price: trueshow_rate_in_label: true@@ -21662,7 +21587,7 @@ paths:deleted_at:amount: '0.19'amount_percentage: 19.0- tax_category_id: taxcat_Sm1IszOMIv+ tax_category_id: taxcat_UkLWZg9DAJstore_id: store_UkLWZg9DAJcountry_code: DEstate_code:@@ -21748,7 +21673,7 @@ paths:content:application/json:example:- id: tax_OIJLhNcSbf+ id: tax_UkLWZg9DAJname: TaxRate - 312890included_in_price: trueshow_rate_in_label: true@@ -21758,7 +21683,7 @@ paths:deleted_at:amount: '0.19'amount_percentage: 19.0- tax_category_id: taxcat_KAw5Q8YFGz+ tax_category_id: taxcat_UkLWZg9DAJstore_id: store_UkLWZg9DAJcountry_code: DEstate_code:@@ -21790,7 +21715,7 @@ paths:content:application/json:example:- id: tax_AXs1igzRC6+ id: tax_UkLWZg9DAJname: TaxRate - 470830included_in_price: trueshow_rate_in_label: true@@ -21800,7 +21725,7 @@ paths:deleted_at:amount: '0.07'amount_percentage: 7.0- tax_category_id: taxcat_hwPBvQ85Ws+ tax_category_id: taxcat_UkLWZg9DAJstore_id: store_UkLWZg9DAJcountry_code: DEstate_code:@@ -21994,7 +21919,7 @@ paths:application/json:example:data:- - resource_id: opt_aAtNvLSUAr+ - resource_id: opt_UkLWZg9DAJresource_type: option_typetranslations:de:@@ -22008,7 +21933,7 @@ paths:- de- en- fr- - resource_id: optval_kOKT9MVfb0+ - resource_id: optval_UkLWZg9DAJresource_type: option_valuetranslations:de:@@ -22180,7 +22105,7 @@ paths:content:application/json:example:- id: adm_gbHJdmfrXB+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Lynelllast_name: Heaney@@ -22190,7 +22115,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_gbHJdmfrXB+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -22247,7 +22172,7 @@ paths:content:application/json:example:- id: adm_EfhxLZ9ck8+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Renamedlast_name: King@@ -22257,7 +22182,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'avatar_url:roles:- - id: role_EfhxLZ9ck8+ - id: role_UkLWZg9DAJname: adminstores:- id: store_UkLWZg9DAJ@@ -22375,7 +22300,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'- role_id: role_JrVaEBgznC+ role_id: role_UkLWZg9DAJrole_name: admininviter_email: [email protected]acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=bcFtaxxWh2f6dkZb6EQNpKhJ"@@ -22439,16 +22364,16 @@ paths:content:application/json:example:- id: inv_EfhxLZ9ck8+ id: inv_gbHJdmfrXBemail: [email protected]status: pendingcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'- role_id: role_tSZyJwvFCu+ role_id: role_UkLWZg9DAJrole_name: admininviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_EfhxLZ9ck8?token=VVL8HRJRDHaZmJ4pQEhtz6ey"+ acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=VVL8HRJRDHaZmJ4pQEhtz6ey"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -22560,16 +22485,16 @@ paths:content:application/json:example:- id: inv_uw2YK1rnl0+ id: inv_UkLWZg9DAJemail: [email protected]status: pendingcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'- role_id: role_Xnkbb5HTmV+ role_id: role_UkLWZg9DAJrole_name: admininviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_uw2YK1rnl0?token=FxDpzwwoQd483CL8xLvY7u6R"+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=FxDpzwwoQd483CL8xLvY7u6R"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -22995,7 +22920,7 @@ paths:application/json:example:data:- - id: role_p8mklVeMgb+ - id: role_UkLWZg9DAJname: admindescription:created_at: '2026-01-15T12:00:00.000Z'@@ -23108,7 +23033,7 @@ paths:content:application/json:example:- id: role_rogClYtECF+ id: role_gbHJdmfrXBname: order_managerdescription: Handles daily orderscreated_at: '2026-01-15T12:00:00.000Z'@@ -23203,7 +23128,7 @@ paths:content:application/json:example:- id: role_QgcA48cIW7+ id: role_gbHJdmfrXBname: supportdescription:created_at: '2026-01-15T12:00:00.000Z'@@ -23380,7 +23305,7 @@ paths:application/json:example:data:- - id: sloc_KAw5Q8YFGz+ - id: sloc_UkLWZg9DAJname: Brooklyn warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -23498,7 +23423,7 @@ paths:content:application/json:example:- id: sloc_KAF5Q8YFGz+ id: sloc_gbHJdmfrXBname: Manhattan storeaddress1:city:@@ -23679,7 +23604,7 @@ paths:content:application/json:example:- id: sloc_6VsgxZbenF+ id: sloc_UkLWZg9DAJname: Brooklyn warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -23772,7 +23697,7 @@ paths:content:application/json:example:- id: sloc_lPxiGAYKIU+ id: sloc_UkLWZg9DAJname: Renamed warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -24006,9 +23931,9 @@ paths:application/json:example:data:- - id: variant_RHaeNhrwyV- product_id: prod_ARKs1igzRC- sku: SKU-141+ - id: variant_UkLWZg9DAJ+ product_id: prod_UkLWZg9DAJ+ sku: SKU-140options_text: ''track_inventory: truemedia_count: 0@@ -24023,7 +23948,7 @@ paths:width:depth:price:- id: price_Sx7IszOMIv+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -24051,15 +23976,15 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'preorderable: false- tax_category_id: taxcat_KAF5Q8YFGz+ tax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1166804+ product_name: Product 1156804delivery_profile_id: fp_UkLWZg9DAJ- - id: variant_L50pHOn63V- product_id: prod_ARKs1igzRC- sku: SKU-142+ - id: variant_gbHJdmfrXB+ product_id: prod_UkLWZg9DAJ+ sku: SKU-141options_text: 'Size: S'track_inventory: truemedia_count: 0@@ -24074,7 +23999,7 @@ paths:width: 126.5depth: 56.58price:- id: price_L5hpHOn63V+ id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -24086,8 +24011,8 @@ paths:original_price:seller_id:option_values:- - id: optval_D6Psx31WaT- option_type_id: opt_QDA48cIW7A+ - id: optval_UkLWZg9DAJ+ option_type_id: opt_UkLWZg9DAJname: size-25label: Sposition: 1@@ -24114,11 +24039,11 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'preorderable: false- tax_category_id: taxcat_KAF5Q8YFGz+ tax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1166804+ product_name: Product 1156804delivery_profile_id: fp_UkLWZg9DAJmeta:page: 1@@ -24195,8 +24120,8 @@ paths:content:application/json:example:- id: variant_YjXETxCGlb- product_id: prod_lPxiGAYKIU+ id: variant_EfhxLZ9ck8+ product_id: prod_UkLWZg9DAJsku: NEW-SKU-001options_text: 'Size: XL'track_inventory: true@@ -24212,7 +24137,7 @@ paths:width:depth:price:- id: price_IoavBlcSU2+ id: price_EfhxLZ9ck8amount: '24.99'amount_in_cents: 2499compare_at_amount:@@ -24224,8 +24149,8 @@ paths:original_price:seller_id:option_values:- - id: optval_5CQZnCRf8J- option_type_id: opt_oqlrKdXjaP+ - id: optval_gbHJdmfrXB+ option_type_id: opt_gbHJdmfrXBname: xllabel: XLposition: 1@@ -24252,11 +24177,11 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'preorderable: false- tax_category_id: taxcat_iNvDfaj7G4+ tax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1171771+ product_name: Product 1161771delivery_profile_id: fp_UkLWZg9DAJ'422':description: validation error@@ -24433,9 +24358,9 @@ paths:content:application/json:example:- id: variant_31YWpPTcf5- product_id: prod_z2zcwP3ZbD- sku: SKU-148+ id: variant_gbHJdmfrXB+ product_id: prod_UkLWZg9DAJ+ sku: SKU-147options_text: 'Size: S'track_inventory: truemedia_count: 0@@ -24450,7 +24375,7 @@ paths:width: 166.27depth: 20.71price:- id: price_Ae5s1igzRC+ id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -24462,8 +24387,8 @@ paths:original_price:seller_id:option_values:- - id: optval_prklVeMgbn- option_type_id: opt_qp31JYFduR+ - id: optval_UkLWZg9DAJ+ option_type_id: opt_UkLWZg9DAJname: size-28label: Sposition: 1@@ -24490,11 +24415,11 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'preorderable: false- tax_category_id: taxcat_ARKs1igzRC+ tax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1194025+ product_name: Product 1184025delivery_profile_id: fp_UkLWZg9DAJ'404':description: variant not found@@ -24565,8 +24490,8 @@ paths:content:application/json:example:- id: variant_MWEnyloHRU- product_id: prod_UKkLWZg9DA+ id: variant_gbHJdmfrXB+ product_id: prod_UkLWZg9DAJsku: UPDATED-SKUoptions_text: 'Size: S'track_inventory: true@@ -24582,7 +24507,7 @@ paths:width: 57.61depth: 3.72price:- id: price_chYuasQi8r+ id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -24594,8 +24519,8 @@ paths:original_price:seller_id:option_values:- - id: optval_rsClYtECFI- option_type_id: opt_tXyJwvFCuK+ - id: optval_UkLWZg9DAJ+ option_type_id: opt_UkLWZg9DAJname: size-30label: Sposition: 1@@ -24622,11 +24547,11 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'preorderable: false- tax_category_id: taxcat_yStr3EWPH8+ tax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1215672+ product_name: Product 1205672delivery_profile_id: fp_UkLWZg9DAJrequestBody:content:@@ -24876,9 +24801,9 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'delivered_at: '2026-01-15T12:00:00.000Z'payload:+ event: order.createddata:id: 1- event: order.createdwebhook_endpoint_id: whe_UkLWZg9DAJwebhook_endpoint_url: https://shop.example.com/webhooks- id: whd_gbHJdmfrXB@@ -24894,9 +24819,9 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'delivered_at: '2026-01-15T12:00:00.000Z'payload:+ event: order.createddata:id: 1- event: order.createdwebhook_endpoint_id: whe_UkLWZg9DAJwebhook_endpoint_url: https://shop.example.com/webhooksmeta:@@ -24986,7 +24911,7 @@ paths:content:application/json:example:- id: whd_OIJLhNcSbf+ id: whd_gbHJdmfrXBevent_name: order.createdevent_id:response_code: 500@@ -24999,10 +24924,10 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'delivered_at: '2026-01-15T12:00:00.000Z'payload:+ event: order.createddata:id: 1- event: order.created- webhook_endpoint_id: whe_EfhxLZ9ck8+ webhook_endpoint_id: whe_UkLWZg9DAJwebhook_endpoint_url: https://shop.example.com/webhooks'404':description: delivery not found@@ -25077,7 +25002,7 @@ paths:content:application/json:example:- id: whd_xhoCpeNMWu+ id: whd_EfhxLZ9ck8event_name: order.createdevent_id:response_code:@@ -25090,10 +25015,10 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'delivered_at:payload:+ event: order.createddata:id: 1- event: order.created- webhook_endpoint_id: whe_uw2YK1rnl0+ webhook_endpoint_id: whe_UkLWZg9DAJwebhook_endpoint_url: https://shop.example.com/webhooks"/api/v3/admin/webhook_endpoints":get:@@ -25181,7 +25106,7 @@ paths:application/json:example:data:- - id: whe_OIJLhNcSbf+ - id: whe_UkLWZg9DAJname: Order pipelineurl: https://shop.example.com/webhooks/ordersactive: true@@ -25279,7 +25204,7 @@ paths:content:application/json:example:- id: whe_nJqfPa3Cpe+ id: whe_gbHJdmfrXBname: CI integrationurl: https://ci.example.com/webhooksactive: true@@ -25403,7 +25328,7 @@ paths:content:application/json:example:- id: whe_xhoCpeNMWu+ id: whe_UkLWZg9DAJname: Order pipelineurl: https://shop.example.com/webhooks/ordersactive: true@@ -25483,7 +25408,7 @@ paths:content:application/json:example:- id: whe_2KY5XM6frI+ id: whe_UkLWZg9DAJname: Order pipeline (renamed)url: https://shop.example.com/webhooks/ordersactive: true@@ -25641,7 +25566,7 @@ paths:content:application/json:example:- id: whd_vEmzDoNU0H+ id: whd_UkLWZg9DAJevent_name: webhook.testevent_id:response_code:@@ -25661,7 +25586,7 @@ paths:message: This is a test webhook from Spree.metadata:spree_version: 6.0.0.alpha- webhook_endpoint_id: whe_s18jaGonyx+ webhook_endpoint_id: whe_UkLWZg9DAJwebhook_endpoint_url: https://shop.example.com/webhooks/orders"/api/v3/admin/webhook_endpoints/{id}/enable":parameters:@@ -25716,7 +25641,7 @@ paths:content:application/json:example:- id: whe_GZUcnUYI5A+ id: whe_UkLWZg9DAJname: Order pipelineurl: https://shop.example.com/webhooks/ordersactive: true@@ -25794,7 +25719,7 @@ paths:content:application/json:example:- id: whe_ROeNhrwyV9+ id: whe_UkLWZg9DAJname: Order pipelineurl: https://shop.example.com/webhooks/ordersactive: false@@ -25932,7 +25857,7 @@ paths:content:application/json:example:- id: cat_EfhxLZ9ck8+ id: cat_gbHJdmfrXBname: VIP Assortmentactive: trueposition: 2@@ -26028,7 +25953,7 @@ paths:example:id: cata_UkLWZg9DAJcreated_at: '2026-01-15T12:00:00.000Z'- catalog_id: cat_uw2YK1rnl0+ catalog_id: cat_UkLWZg9DAJassignable_type: companyassignable_id: comp_UkLWZg9DAJassignable_name: Acme Corp 1@@ -26050,6 +25975,159 @@ paths:required:- assignable_type- assignable_id+ "/api/v3/admin/catalogs/{catalog_id}/products":+ get:+ summary: List catalog products+ tags:+ - Catalogs+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ The catalog's curated assortment, listed by product name — membership carries no order.++ **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: catalog_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: products found+ content:+ application/json:+ example:+ data: []+ meta:+ page: 1+ limit: 25+ count: 0+ pages: 1+ from: 0+ to: 0+ in: 0+ previous:+ next:+ schema:+ type: object+ properties:+ data:+ type: array+ items:+ "$ref": "#/components/schemas/Product"+ meta:+ "$ref": "#/components/schemas/PaginationMeta"+ required:+ - data+ - meta+ post:+ summary: Add products to a catalog+ tags:+ - Catalogs+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Curates products into the assortment in bulk. Already-present products are skipped; the count reports what was added.++ **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: catalog_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '201':+ description: products added+ content:+ application/json:+ example:+ added_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids+ delete:+ summary: Remove products from a catalog+ tags:+ - Catalogs+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Removes products from the assortment in bulk. Ids that are not members are ignored; the count reports what was removed.++ **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: catalog_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: products removed+ content:+ application/json:+ example:+ removed_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids"/api/v3/admin/collections":get:summary: List collections@@ -26169,7 +26247,7 @@ paths:content:application/json:example:- id: coll_EfhxLZ9ck8+ id: coll_gbHJdmfrXBname: On Salepermalink: on-saleposition: 2@@ -26297,7 +26375,7 @@ paths:content:application/json:example:- id: coll_uw2YK1rnl0+ id: coll_UkLWZg9DAJname: Summer Salepermalink: summer-saleposition: 1@@ -26362,7 +26440,7 @@ paths:content:application/json:example:- id: coll_AXs1igzRC6+ id: coll_UkLWZg9DAJname: Winter Salepermalink: summer-saleposition: 1@@ -26519,14 +26597,14 @@ paths:- data- metapost:- summary: Add a product to a collection+ summary: Add products to a collectiontags:- Collectionssecurity:- api_key: []bearer_auth: []description: |-- Curates a product into the collection (appended to the end).+ Curates products into the collection in bulk (appended to the end). Already-curated products are skipped; the count reports what was added.**Required scope:** `write_collections` (for API-key authentication).parameters:@@ -26549,93 +26627,34 @@ paths:type: stringresponses:'201':- description: product added+ description: products addedcontent:application/json:example:- id: prod_OIJLhNcSbf- name: Product 66648- slug: product-66648- meta_title:- meta_description:- meta_keywords:- variant_count: 1- available_on:- preorder_ships_at:- purchasable: true- preorder: false- in_stock: false- backorderable: true- available: true- description: Minima aperiam molestias magni veniam. Porro rem inventore- eos odio corporis temporibus. Minus illum voluptatem ipsa at excepturi.- Amet consectetur beatae culpa sequi ab consequuntur nulla asperiores.- Repellat doloribus incidunt corrupti non. Quidem explicabo harum- eius beatae assumenda nemo ipsam amet. Quasi nesciunt molestiae- doloribus quam incidunt voluptas non iusto. Voluptate dolores distinctio- delectus harum voluptas. Porro delectus minus earum ipsam nam. Nobis- eveniet recusandae architecto ea ab. Nam temporibus numquam maxime- debitis ea sapiente. Quia ducimus enim consequuntur iure. Quibusdam- nihil velit consequatur aspernatur repellendus. Sit ex incidunt- sapiente nostrum. Accusantium enim exercitationem tenetur distinctio- unde.- description_html: |-- Minima aperiam molestias magni veniam. Porro rem inventore eos odio corporis temporibus. Minus illum voluptatem ipsa at excepturi. Amet consectetur beatae culpa sequi ab consequuntur nulla asperiores.- Repellat doloribus incidunt corrupti non. Quidem explicabo harum eius beatae assumenda nemo ipsam amet. Quasi nesciunt molestiae doloribus quam incidunt voluptas non iusto. Voluptate dolores distinctio delectus harum voluptas.- Porro delectus minus earum ipsam nam. Nobis eveniet recusandae architecto ea ab. Nam temporibus numquam maxime debitis ea sapiente. Quia ducimus enim consequuntur iure.- Quibusdam nihil velit consequatur aspernatur repellendus. Sit ex incidunt sapiente nostrum. Accusantium enim exercitationem tenetur distinctio unde.- default_variant_id: variant_OIJLhNcSbf- buy_box_variant_id: variant_OIJLhNcSbf- thumbnail_url:- tags: []- price:- id: price_OIJLhNcSbf- amount: '19.99'- amount_in_cents: 1999- compare_at_amount:- compare_at_amount_in_cents:- currency: USD- display_amount: "$19.99"- display_compare_at_amount:- price_list_id:- variant_id: variant_OIJLhNcSbf- created_at: '2026-01-15T12:00:00.000Z'- updated_at: '2026-01-15T12:00:00.000Z'- original_price:- seller_id:- external_references: {}- status: active- metadata: {}- deleted_at:- created_at: '2026-01-15T12:00:00.000Z'- updated_at: '2026-01-15T12:00:00.000Z'- delivery_profile_id: fp_UkLWZg9DAJ- seller_name:- product_type_id:- tax_category_id: taxcat_OIJLhNcSbf- schema:- "$ref": "#/components/schemas/Product"+ added_count: 1requestBody:content:application/json:schema:type: objectproperties:- product_id:- type: string- example: prod_abc123+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123required:- - product_id- "/api/v3/admin/collections/{collection_id}/products/{id}":+ - product_idsdelete:- summary: Remove a product from a collection+ summary: Remove products from a collectiontags:- Collectionssecurity:- api_key: []bearer_auth: []description: |-- Removes a product from the collection's manual curation.+ Removes products from the collection's manual curation in bulk. Ids that are not curated are ignored; the count reports what was removed.**Required scope:** `write_collections` (for API-key authentication).parameters:@@ -26656,15 +26675,27 @@ paths:description: Collection IDschema:type: string- - name: id- in: path- required: true- description: Product ID- schema:- type: stringresponses:- '204':- description: product removed+ '200':+ description: products removed+ content:+ application/json:+ example:+ removed_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":patch:summary: Reposition a collection product@@ -26936,7 +26967,7 @@ paths:content:application/json:example:- id: cline_EfhxLZ9ck8+ id: cline_UkLWZg9DAJkind: percentagecurrency: USDtaxability_reason:@@ -26952,9 +26983,9 @@ paths:display_amount: "$10.00"display_tax_amount: "$2.10"display_total: "$12.10"- order_id: or_EfhxLZ9ck8- seller_id: sel_EfhxLZ9ck8- line_item_id: li_EfhxLZ9ck8+ order_id: or_UkLWZg9DAJ+ seller_id: sel_UkLWZg9DAJ+ line_item_id: li_UkLWZg9DAJfulfillment_id:commission_rate_id:seller_name: Sparks Audio@@ -27174,7 +27205,7 @@ paths:content:application/json:example:- id: crate_VqXmZF31wY+ id: crate_gbHJdmfrXBname: Audio sellerscode:enabled: true@@ -27458,7 +27489,7 @@ paths:content:application/json:example:- id: crate_AXs1igzRC6+ id: crate_UkLWZg9DAJname: Standardcode:enabled: true@@ -27546,7 +27577,7 @@ paths:content:application/json:example:- id: crate_nJqfPa3Cpe+ id: crate_UkLWZg9DAJname: Standardcode:enabled: true@@ -27692,8 +27723,8 @@ paths:example:data:- id: cmem_UkLWZg9DAJ- company_id: comp_gbHJdmfrXB- customer_id: cust_uw2YK1rnl0+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -27747,9 +27778,9 @@ paths:content:application/json:example:- id: cmem_gbHJdmfrXB- company_id: comp_EfhxLZ9ck8- customer_id: cust_OIJLhNcSbf+ id: cmem_UkLWZg9DAJ+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -27833,7 +27864,7 @@ paths:verified_at:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- company_id: comp_VqXmZF31wY+ company_id: comp_UkLWZg9DAJcountry_code:state_code:active: false@@ -27907,7 +27938,7 @@ paths:content:application/json:example:- id: cert_EfhxLZ9ck8+ id: cert_gbHJdmfrXBcertificate_number: DE-RESALE-7reason_code: resalestatus: pending@@ -27918,7 +27949,7 @@ paths:verified_at:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- company_id: comp_uw2YK1rnl0+ company_id: comp_UkLWZg9DAJcountry_code: DEstate_code:active: false@@ -27926,7 +27957,7 @@ paths:can_be_deleted: truedocument_filename: resale.pdfdocument_byte_size: 20- document_url: "/api/v3/admin/companies/comp_uw2YK1rnl0/tax_exemption_certificates/cert_EfhxLZ9ck8/download"+ document_url: "/api/v3/admin/companies/comp_UkLWZg9DAJ/tax_exemption_certificates/cert_gbHJdmfrXB/download"'422':description: invalid requestcontent:@@ -28038,7 +28069,7 @@ paths:content:application/json:example:- id: cert_uw2YK1rnl0+ id: cert_UkLWZg9DAJcertificate_number: DE-RESALE-1reason_code: resalestatus: verified@@ -28049,7 +28080,7 @@ paths:verified_at: '2026-01-15T12:00:00.000Z'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- company_id: comp_AXs1igzRC6+ company_id: comp_UkLWZg9DAJcountry_code:state_code:active: true@@ -28118,7 +28149,7 @@ paths:content:application/json:example:- id: cert_AXs1igzRC6+ id: cert_gbHJdmfrXBcertificate_number: CERT-1reason_code: resalestatus: revoked@@ -28129,7 +28160,7 @@ paths:verified_at: '2026-01-15T12:00:00.000Z'created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- company_id: comp_p6klVeMgbn+ company_id: comp_UkLWZg9DAJcountry_code:state_code:active: false@@ -28302,7 +28333,7 @@ paths:content:application/json:example:- id: txi_EfhxLZ9ck8+ id: txi_gbHJdmfrXBkind: gb_vatvalue: GB123456789validation_status:@@ -28453,7 +28484,7 @@ paths:application/json:example:data:- - id: comp_ed6l8wVqSM+ - id: comp_UkLWZg9DAJname: Acme Industrialkind: companyparent_id:@@ -28521,7 +28552,7 @@ paths:content:application/json:example:- id: comp_GZUcnUYI5A+ id: comp_gbHJdmfrXBname: Globex Corporationkind: companyparent_id:@@ -28946,14 +28977,14 @@ paths:content:application/json:example:- id: og_VqXmZF31wY+ id: og_EfhxLZ9ck8name: EU warehouseposition: 2created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- delivery_profile_id: fp_EfhxLZ9ck8+ delivery_profile_id: fp_gbHJdmfrXBstock_location_ids:- - sloc_2KY5XM6frI+ - sloc_UkLWZg9DAJdelivery_zones_count: 0delivery_methods_count: 0requestBody:@@ -29024,7 +29055,7 @@ paths:content:application/json:example:- id: fp_VqXmZF31wY+ id: fp_gbHJdmfrXBname: Bulky 1768478400.0default: falseposition: 2@@ -29035,13 +29066,13 @@ paths:offers_pickup: falseoffers_shipping: falsestock_location_ids:- - sloc_HOVtlDrOmL+ - sloc_UkLWZg9DAJorigin_groups:- - id: og_uw2YK1rnl0+ - id: og_gbHJdmfrXBname:position: 1stock_location_ids:- - sloc_HOVtlDrOmL+ - sloc_UkLWZg9DAJproducts_count: 0delivery_methods_count: 0delivery_zones_count: 0@@ -29233,7 +29264,7 @@ paths:content:application/json:example:- id: dm_gbHJdmfrXB+ id: dm_UkLWZg9DAJname: Expresscode:estimated_transit_business_days_min:@@ -29395,15 +29426,15 @@ paths:- type: Spree::Calculator::Shipping::PerItemname: Flat rate per package itempreference_schema:+ - key: currency+ type: string+ default: USD- key: amountstype: hashdefault: {}- key: amounttype: decimaldefault: 0- - key: currency- type: string- default: USD- type: Spree::Calculator::Shipping::PriceSackname: Price sackpreference_schema:@@ -29422,15 +29453,15 @@ paths:- type: Spree::Calculator::Shipping::DigitalDeliveryname: Digital Deliverypreference_schema:+ - key: currency+ type: string+ default: USD- key: amountstype: hashdefault: {}- key: amounttype: decimaldefault: 0- - key: currency- type: string- default: USD"/api/v3/admin/delivery_zones":post:summary: Create delivery zone@@ -29679,7 +29710,7 @@ paths:content:application/json:example:- id: int_gbHJdmfrXB+ id: int_UkLWZg9DAJname: Carrieractive: falsecreated_at: '2026-01-15T12:00:00.000Z'@@ -29872,7 +29903,7 @@ paths:example:data:- id: media_UkLWZg9DAJ- product_id: prod_2KY5XM6frI+ product_id: prod_UkLWZg9DAJvariant_ids: []position: 1alt: Front view@@ -29884,13 +29915,13 @@ paths:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--4f57bffa946ff08023fba76b210056e5ca311892/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--8217067efbaa75aad81d81fa9996198d83011914/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--5341c9c3983d4f9be22765b16b6a54e7c2f737b9/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f67e43ebe49c4b0d73d1f66a2ab343506e30f41e/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--17c7b5777e5156ac3f276faf4fc215242a23d605/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--f976925e3e43305cbbc7f39bc420ba509a60874e/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--babf6d500aaca35a65a8fec003ef3c01809baa0c/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b77ecd0fc713785bdf67008c26822f4cc6a0d4f6/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--76866a5912e575bef633b388a58010da81243ce5/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--3c65a0bc45934d992a45bd51bd6e871c1525a1a3/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--ae5752fe9360a435f2f4eeacf090b4fd8a51d13d/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--29ef070f5138a5a0fbe8f6d0ceb110d7b29de07a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -29898,10 +29929,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--fd6aea80ae425980dd99c2ef60f05cb58868eb8f/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e- viewable_id: prod_2KY5XM6frI- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTksInB1ciI6ImJsb2JfaWQifX0=--8a15ad40350849be1e97de65f6cb26881e3bdf6e/thinking-cat.jpg?disposition=attachment+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7f00ee5789e0eaf9bcfb0a15a6527c0770241e18/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174+ viewable_id: prod_UkLWZg9DAJ+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: productmeta:@@ -29959,7 +29990,7 @@ paths:content:application/json:example:- id: media_EfhxLZ9ck8+ id: media_gbHJdmfrXBproduct_id:variant_ids: []position: 1@@ -29972,13 +30003,13 @@ paths:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/library-upload.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--4f57bffa946ff08023fba76b210056e5ca311892/library-upload.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--8217067efbaa75aad81d81fa9996198d83011914/library-upload.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--5341c9c3983d4f9be22765b16b6a54e7c2f737b9/library-upload.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f67e43ebe49c4b0d73d1f66a2ab343506e30f41e/library-upload.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--17c7b5777e5156ac3f276faf4fc215242a23d605/library-upload.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--f976925e3e43305cbbc7f39bc420ba509a60874e/library-upload.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/library-upload.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--babf6d500aaca35a65a8fec003ef3c01809baa0c/library-upload.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b77ecd0fc713785bdf67008c26822f4cc6a0d4f6/library-upload.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--76866a5912e575bef633b388a58010da81243ce5/library-upload.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--3c65a0bc45934d992a45bd51bd6e871c1525a1a3/library-upload.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--ae5752fe9360a435f2f4eeacf090b4fd8a51d13d/library-upload.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--29ef070f5138a5a0fbe8f6d0ceb110d7b29de07a/library-upload.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -29986,10 +30017,10 @@ paths:filename: library-upload.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--fd6aea80ae425980dd99c2ef60f05cb58868eb8f/library-upload.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7f00ee5789e0eaf9bcfb0a15a6527c0770241e18/library-upload.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56dbviewable_id:- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MjEsInB1ciI6ImJsb2JfaWQifX0=--e27abd5308ec056c04decdbca19109da13bc2616/library-upload.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--5f7aaa13caf8a354e70fd24c8e37feebf15a56db/library-upload.jpg?disposition=attachmentmetadata: {}viewable_type:schema:@@ -30063,9 +30094,9 @@ paths:example:data:- kind: media- name: Product 153397+ name: Product 173397owner_type: Spree::Product- owner_id: prod_ed6l8wVqSM+ owner_id: prod_UkLWZg9DAJfield: attachmentschema:type: object@@ -30133,8 +30164,8 @@ paths:content:application/json:example:- id: media_OIJLhNcSbf- product_id: prod_GZUcnUYI5A+ id: media_gbHJdmfrXB+ product_id: prod_gbHJdmfrXBvariant_ids: []position: 1alt: Front view@@ -30146,13 +30177,13 @@ paths:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--4f57bffa946ff08023fba76b210056e5ca311892/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--8217067efbaa75aad81d81fa9996198d83011914/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--5341c9c3983d4f9be22765b16b6a54e7c2f737b9/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f67e43ebe49c4b0d73d1f66a2ab343506e30f41e/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--17c7b5777e5156ac3f276faf4fc215242a23d605/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--f976925e3e43305cbbc7f39bc420ba509a60874e/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--babf6d500aaca35a65a8fec003ef3c01809baa0c/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b77ecd0fc713785bdf67008c26822f4cc6a0d4f6/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--76866a5912e575bef633b388a58010da81243ce5/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--3c65a0bc45934d992a45bd51bd6e871c1525a1a3/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--ae5752fe9360a435f2f4eeacf090b4fd8a51d13d/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--29ef070f5138a5a0fbe8f6d0ceb110d7b29de07a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -30160,10 +30191,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--fd6aea80ae425980dd99c2ef60f05cb58868eb8f/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b- viewable_id: prod_GZUcnUYI5A- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MjMsInB1ciI6ImJsb2JfaWQifX0=--6968d5698b9d77045eb82c5421be1e1bd081c07b/thinking-cat.jpg?disposition=attachment+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7f00ee5789e0eaf9bcfb0a15a6527c0770241e18/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174+ viewable_id: prod_gbHJdmfrXB+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: productschema:@@ -30185,6 +30216,159 @@ paths:example: 1required:- source_media_id+ "/api/v3/admin/price_lists/{price_list_id}/products":+ get:+ summary: List price list products+ tags:+ - Price Lists+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ The products the list prices, listed by name — membership is derived from the price rows.++ **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: price_list_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: products found+ content:+ application/json:+ example:+ data: []+ meta:+ page: 1+ limit: 25+ count: 0+ pages: 1+ from: 0+ to: 0+ in: 0+ previous:+ next:+ schema:+ type: object+ properties:+ data:+ type: array+ items:+ "$ref": "#/components/schemas/Product"+ meta:+ "$ref": "#/components/schemas/PaginationMeta"+ required:+ - data+ - meta+ post:+ summary: Add products to a price list+ tags:+ - Price Lists+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Adds products to the list in bulk, materializing a placeholder price per variant and store currency. Already-present products are skipped.++ **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: price_list_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '201':+ description: products added+ content:+ application/json:+ example:+ added_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids+ delete:+ summary: Remove products from a price list+ tags:+ - Price Lists+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Removes products from the list in bulk, hard-deleting their price rows. Ids that are not members are ignored.++ **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: price_list_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: products removed+ content:+ application/json:+ example:+ removed_count: 1+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ example:+ - prod_abc123+ required:+ - product_ids"/api/v3/admin/product_types":get:summary: List product types@@ -30309,7 +30493,7 @@ paths:content:application/json:example:- id: pt_VqXmZF31wY+ id: pt_gbHJdmfrXBname: Hoodieproducts_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -30410,7 +30594,7 @@ paths:content:application/json:example:- id: pt_OIJLhNcSbf+ id: pt_UkLWZg9DAJname: T-Shirtproducts_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -30464,7 +30648,7 @@ paths:content:application/json:example:- id: pt_p6klVeMgbn+ id: pt_UkLWZg9DAJname: Premium T-Shirtproducts_count: 0created_at: '2026-01-15T12:00:00.000Z'@@ -30746,7 +30930,7 @@ paths:content:application/json:example:- id: selreq_gbHJdmfrXB+ id: selreq_UkLWZg9DAJposition: 1active: truerequired: true@@ -30896,6 +31080,9 @@ paths:accepted_content_types: []association_fields: []preference_schema:+ - key: require_about+ type: boolean+ default: true- key: require_logotype: booleandefault: true@@ -30905,9 +31092,6 @@ paths:- key: require_contact_emailtype: booleandefault: true- - key: require_about- type: boolean- default: true- type: billing_addressname: Billing addressdescription: The address your payouts are billed from@@ -31106,7 +31290,7 @@ paths:content:application/json:example:- id: selreq_EfhxLZ9ck8+ id: selreq_UkLWZg9DAJposition: 1active: truerequired: true@@ -31276,7 +31460,7 @@ paths:application/json:example:data:- - id: sel_uw2YK1rnl0+ - id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -31392,7 +31576,7 @@ paths:content:application/json:example:- id: sel_p6klVeMgbn+ id: sel_gbHJdmfrXBname: Northwind Booksslug: northwind-booksabout: ''@@ -31536,7 +31720,7 @@ paths:content:application/json:example:- id: sel_98FqgRua4h+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -31630,7 +31814,7 @@ paths:content:application/json:example:- id: sel_2KY5XM6frI+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -31661,7 +31845,7 @@ paths:legal_name:registration_number:billing_address:- id: addr_oD3lrKdXja+ id: addr_UkLWZg9DAJlabel:first_name:last_name:@@ -31688,7 +31872,7 @@ paths:latitude:longitude:customer_id:- owner_id: sel_2KY5XM6frI+ owner_id: sel_UkLWZg9DAJowner_type: Spree::Sellerschema:"$ref": "#/components/schemas/Seller"@@ -31938,7 +32122,7 @@ paths:content:application/json:example:- id: sel_s18jaGonyx+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -32041,7 +32225,7 @@ paths:content:application/json:example:- id: sel_GZUcnUYI5A+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -32142,7 +32326,7 @@ paths:content:application/json:example:- id: sel_L3pHOn63Vw+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -32241,7 +32425,7 @@ paths:content:application/json:example:- id: sel_PQNMcnNFWw+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -32493,13 +32677,13 @@ paths:application/json:example:data:- - id: sm_VqXmZF31wY+ - id: sm_UkLWZg9DAJquantity: 5kind: adjustedreason: Cycle countcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- stock_level_id: sl_vlBmzDoNU0+ stock_level_id: sl_gbHJdmfrXBorder_id:fulfillment_id:return_id:@@ -32595,13 +32779,13 @@ paths:content:application/json:example:- id: sm_OIJLhNcSbf+ id: sm_UkLWZg9DAJquantity: 5kind: adjustedreason: Cycle countcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'- stock_level_id: sl_s6d8jaGony+ stock_level_id: sl_gbHJdmfrXBorder_id:fulfillment_id:return_id:@@ -37014,10 +37198,6 @@ components:type: numberprices_count:type: number- product_ids:- type: array- items:- type: stringprice_rules:type: arrayitems:@@ -37037,7 +37217,6 @@ components:- currently_active- products_count- prices_count- - product_idsx-typelizer: truePriceRule:type: objectdiff --git a/docs/api-reference/seller.yaml b/docs/api-reference/seller.yamlindex f1c7c56b5b..76abaa0175 100644--- a/docs/api-reference/seller.yaml+++ b/docs/api-reference/seller.yaml@@ -82,9 +82,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0MjQsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiMTk1Zjg5MTYtYjc0ZC00ODYxLWExNDctMmYwOGIzOGIxYjM1IiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzZWxsZXJfYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.oYONGPT1sUFdsYiUmKLYSIKqHiGcChdMwoqfJgmEmm0+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjE5NWY4OTE2LWI3NGQtNDg2MS1hMTQ3LTJmMDhiMzhiMWIzNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic2VsbGVyX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.e2XwsDONtD0x4j9jfjnHhDhAJpzhXBQ2LuIjWS1kY1kuser:- id: adm_IPCvBlcSU2+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Janlast_name: Cummerata@@ -92,7 +92,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'avatar_url:sellers:- - id: sel_C9SrJgpzQ4+ - id: sel_UkLWZg9DAJname: Seller 1status: approvedschema:@@ -148,9 +148,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0MjYsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiN2M4MTM2N2MtMGVhYS00ZTM4LWE2ZGMtMmMxNjM5MjFjZDUyIiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzZWxsZXJfYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.tcfJy4_v2iCtEnsBv47jQB6acAoppq3TqglVe-Go6n0+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjdjODEzNjdjLTBlYWEtNGUzOC1hNmRjLTJjMTYzOTIxY2Q1MiIsImlzcyI6InNwcmVlIiwiYXVkIjoic2VsbGVyX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.N2ttey6pvsPoOdx0F9pdUNbdT1j25ejAzpghXTbB8zouser:- id: adm_iYiDfaj7G4+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Magdalenlast_name: Hayes@@ -158,7 +158,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'avatar_url:sellers:- - id: sel_5OQZnCRf8J+ - id: sel_UkLWZg9DAJname: Seller 3status: approvedschema:@@ -238,13 +238,13 @@ paths:content:application/json:example:- id: inv_AXs1igzRC6+ id: inv_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'accepted_at:status: pending- acceptance_url: "/accept-invitation/inv_AXs1igzRC6?token=RgGhNP1euUCS75Nc3V1Y7YQF"+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=RgGhNP1euUCS75Nc3V1Y7YQF"schema:"$ref": "#/components/schemas/Invitation"'404':@@ -293,9 +293,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0NDUsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiNGZjNWU3MGYtZTU4MC00MTE2LWE5ZTktMGM0OWIwYTFiMzE0IiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzZWxsZXJfYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.-OAiAhSSoUTkmNywNYyeMj6HXvVQ0hKUtjMxzuerLMQ+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjRmYzVlNzBmLWU1ODAtNDExNi1hOWU5LTBjNDliMGExYjMxNCIsImlzcyI6InNwcmVlIiwiYXVkIjoic2VsbGVyX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.H0mJ1zDqTi6mNs_BZBRTJ77OMsWAqeUXvQM09YPLefsuser:- id: adm_xuGoCpeNMW+ id: adm_gbHJdmfrXBemail: [email protected]first_name: Robinlast_name: Ellis@@ -303,7 +303,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'avatar_url:sellers:- - id: sel_qp31JYFduR+ - id: sel_UkLWZg9DAJname: Seller 21status: approvedschema:@@ -409,9 +409,9 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0NjIsInVzZXJfdHlwZSI6ImFkbWluIiwianRpIjoiYmMwMzc1M2EtMTM3Yy00YzVmLWEzMzYtZTMyMGVlM2IyNDljIiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzZWxsZXJfYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.JWWIjLLW6Rh4VEHaNy9RnmcxltYCOrYHsGbNAK1bgVY+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImJjMDM3NTNhLTEzN2MtNGM1Zi1hMzM2LWUzMjBlZTNiMjQ5YyIsImlzcyI6InNwcmVlIiwiYXVkIjoic2VsbGVyX2FwaSIsImV4cCI6MTc2ODQ3ODcwMH0.EASrzbGpJVyAl10SJyzs8na68Wmvedkm7G66wTBq_0kuser:- id: adm_mcVx3nOJap+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Arianalast_name: Wiza@@ -419,7 +419,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'avatar_url:sellers:- - id: sel_bnnZn4Y5Fq+ - id: sel_UkLWZg9DAJname: Seller 42status: approvedschema:@@ -480,7 +480,7 @@ paths:application/json:example:user:- id: adm_RMSeNhrwyV+ id: adm_UkLWZg9DAJemail: [email protected]first_name: Nadialast_name: Effertz@@ -488,7 +488,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'avatar_url:sellers:- - id: sel_Kj5Q8YFGzd+ - id: sel_UkLWZg9DAJname: Seller 30slug: seller-30status: approved@@ -12543,7 +12543,7 @@ paths:application/json:example:data:- - id: pol_ROeNhrwyV9+ - id: pol_uw2YK1rnl0name: Returns Policyslug: returns-policybody: Send anything back within 30 days.@@ -12596,7 +12596,7 @@ paths:content:application/json:example:- id: pol_PQNMcnNFWw+ id: pol_OIJLhNcSbfname: Shipping Policyslug: shipping-policybody: Orders leave the workshop within two working days.@@ -12649,7 +12649,7 @@ paths:content:application/json:example:- id: pol_C9SrJgpzQ4+ id: pol_uw2YK1rnl0name: Returns Policyslug: returns-policybody: Send anything back within 30 days.@@ -12687,7 +12687,7 @@ paths:content:application/json:example:- id: pol_5OQZnCRf8J+ id: pol_uw2YK1rnl0name: Returns Policyslug: returns-policybody: Send anything back within 60 days.@@ -12768,9 +12768,9 @@ paths:application/json:example:data:- - id: prod_HZaVtlDrOm- name: Product 1363250- slug: product-1363250+ - id: prod_UkLWZg9DAJ+ name: Product 1353250+ slug: product-1353250meta_title:meta_description:meta_keywords:@@ -12799,12 +12799,12 @@ paths:Distinctio perferendis quasi nisi exercitationem veritatis minima esse. In velit at corporis nobis. Voluptate mollitia nam pariatur enim. Recusandae necessitatibus earum deserunt sapiente eveniet quidem unde.Consectetur ab perspiciatis veniam dolor tempora. Omnis odit autem quae repellat. Delectus corrupti ea nisi reiciendis atque iure a molestias.Repellendus laboriosam sint molestias debitis in. Minima omnis accusantium modi accusamus doloribus fugit. Accusamus autem sequi perferendis saepe quos perspiciatis.- default_variant_id: variant_kAEKT9MVfb- buy_box_variant_id: variant_kAEKT9MVfb+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_HMtVtlDrOm+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -12814,7 +12814,7 @@ paths:display_compare_at_amount:price_list_id:original_price:- seller_id: sel_ARbs1igzRC+ seller_id: sel_UkLWZg9DAJstatus: activemetadata: {}created_at: '2026-01-15T12:00:00.000Z'@@ -12868,7 +12868,7 @@ paths:content:application/json:example:- id: prod_s6d8jaGony+ id: prod_gbHJdmfrXBname: Hand-thrown mugslug: hand-thrown-mugmeta_title:@@ -12884,12 +12884,12 @@ paths:available: falsedescription:description_html:- default_variant_id: variant_Sx7IszOMIv- buy_box_variant_id: variant_Sx7IszOMIv+ default_variant_id: variant_gbHJdmfrXB+ buy_box_variant_id: variant_gbHJdmfrXBthumbnail_url:tags: []price:- id: price_sg48jaGony+ id: price_gbHJdmfrXBamount: '24.0'amount_in_cents: 2400compare_at_amount:@@ -12899,7 +12899,7 @@ paths:display_compare_at_amount:price_list_id:original_price:- seller_id: sel_p5gklVeMgb+ seller_id: sel_UkLWZg9DAJstatus: draftmetadata: {}created_at: '2026-01-15T12:00:00.000Z'@@ -13008,9 +13008,9 @@ paths:content:application/json:example:- id: prod_RHaeNhrwyV- name: Product 1396710- slug: product-1396710+ id: prod_UkLWZg9DAJ+ name: Product 1386710+ slug: product-1386710meta_title:meta_description:meta_keywords:@@ -13034,12 +13034,12 @@ paths:description_html: |-Aliquid voluptate laudantium necessitatibus quidem eaque. Sapiente at autem eveniet exercitationem odio in dolores. Laborum accusantium nulla autem tempora qui inventore assumenda molestiae. Quisquam voluptas delectus ipsum totam ab incidunt. Sunt excepturi eius provident unde neque in.Earum pariatur enim odit delectus accusamus recusandae. Dolorem eligendi debitis iste voluptate laboriosam ab. Ab aut suscipit illo occaecati. Dolores libero cupiditate provident at itaque temporibus. Adipisci iste beatae quibusdam perferendis ea blanditiis saepe facilis.- default_variant_id: variant_Ksf5Q8YFGz- buy_box_variant_id: variant_Ksf5Q8YFGz+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_RVteNhrwyV+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -13049,7 +13049,7 @@ paths:display_compare_at_amount:price_list_id:original_price:- seller_id: sel_9URFqgRua4+ seller_id: sel_UkLWZg9DAJstatus: activemetadata: {}created_at: '2026-01-15T12:00:00.000Z'@@ -13085,9 +13085,9 @@ paths:content:application/json:example:- id: prod_CmGSrJgpzQ+ id: prod_UkLWZg9DAJname: Hand-thrown mug, large- slug: product-1428212+ slug: product-1418212meta_title:meta_description:meta_keywords:@@ -13107,12 +13107,12 @@ paths:description_html: |-Vel minima recusandae iure deserunt non. Corrupti soluta pariatur recusandae saepe eveniet. Sequi deserunt fugiat architecto animi.Eum facilis veniam a consequatur minus. Dolor iure facilis repellendus tenetur. Nobis harum perferendis ab maiores labore eius eum quo.- default_variant_id: variant_KsG5Q8YFGz- buy_box_variant_id: variant_KsG5Q8YFGz+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_CxUSrJgpzQ+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -13122,7 +13122,7 @@ paths:display_compare_at_amount:price_list_id:original_price:- seller_id: sel_2h5Y5XM6fr+ seller_id: sel_UkLWZg9DAJstatus: activemetadata: {}created_at: '2026-01-15T12:00:00.000Z'@@ -13197,7 +13197,7 @@ paths:content:application/json:example:- id: sel_eH46l8wVqS+ id: sel_UkLWZg9DAJname: Seller 57slug: seller-57about: ''@@ -13274,7 +13274,7 @@ paths:content:application/json:example:- id: sel_GpMUcnUYI5+ id: sel_UkLWZg9DAJname: Acme Suppliesslug: seller-59about: ''@@ -13425,7 +13425,7 @@ paths:application/json:example:data:- - id: sloc_miRx3nOJap+ - id: sloc_UkLWZg9DAJname: Lesha Stromanaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -13490,7 +13490,7 @@ paths:content:application/json:example:- id: sloc_MWEnyloHRU+ id: sloc_gbHJdmfrXBname: Main warehouseaddress1:city: Portland@@ -13605,7 +13605,7 @@ paths:content:application/json:example:- id: sloc_s6i8jaGony+ id: sloc_UkLWZg9DAJname: Marsha Turneraddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -13661,7 +13661,7 @@ paths:content:application/json:example:- id: sloc_aC8tNvLSUA+ id: sloc_UkLWZg9DAJname: Kiln Lane warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -13742,13 +13742,13 @@ paths:application/json:example:data:- - id: inv_xhoCpeNMWu+ - id: inv_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'accepted_at:status: pending- acceptance_url: "/accept-invitation/inv_xhoCpeNMWu?token=gybGAXxVP79yKWNTZLAC94ui"+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=gybGAXxVP79yKWNTZLAC94ui"schema:type: objectproperties:@@ -13788,13 +13788,13 @@ paths:content:application/json:example:- id: inv_vEmzDoNU0H+ id: inv_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'accepted_at:status: pending- acceptance_url: "/accept-invitation/inv_vEmzDoNU0H?token=3uJFfKUSiHtnc9TGAXMJUXsB"+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=3uJFfKUSiHtnc9TGAXMJUXsB"schema:"$ref": "#/components/schemas/Invitation"'404':@@ -13866,7 +13866,7 @@ paths:application/json:example:data:- - id: adm_63VgxZbenF+ - id: adm_UkLWZg9DAJemail: [email protected]first_name: Billlast_name: Towne@@ -13910,13 +13910,13 @@ paths:content:application/json:example:- id: inv_s18jaGonyx+ id: inv_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'expires_at: '2026-01-29T12:00:00.000Z'accepted_at:status: pending- acceptance_url: "/accept-invitation/inv_s18jaGonyx?token=3K6BfBtHGFeQgToPE45qUDWE"+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=3K6BfBtHGFeQgToPE45qUDWE"schema:"$ref": "#/components/schemas/Invitation"'422':@@ -14029,10 +14029,10 @@ paths:application/json:example:direct_upload:- url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJuem5oOGdra3VxendvbDc1ODBxNHNwZmpmMjVxIiwiY29udGVudF90eXBlIjoiYXBwbGljYXRpb24vcGRmIiwiY29udGVudF9sZW5ndGgiOjUxMjM0LCJjaGVja3N1bSI6IlZqaHowNGxRdUVHdXY0bkR2aHNhTlE9PSIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--cac28840dcb0580253f9f4bba0e94154789f8bf0+ url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJuem5oOGdra3VxendvbDc1ODBxNHNwZmpmMjVxIiwiY29udGVudF90eXBlIjoiYXBwbGljYXRpb24vcGRmIiwiY29udGVudF9sZW5ndGgiOjUxMjM0LCJjaGVja3N1bSI6IlZqaHowNGxRdUVHdXY0bkR2aHNhTlE9PSIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--4739345b3df1958ee78bbd4119ff0e6d4f7c0a79headers:Content-Type: application/pdf- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MjQsInB1ciI6ImJsb2JfaWQifX0=--442d70f8804d2dcdb5fa8ac6ae00a4c757c3a083+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--f728cc8f2cc6dc935156331dc163f31d2e271174schema:"$ref": "#/components/schemas/DirectUploadResponse"requestBody:@@ -14093,13 +14093,13 @@ paths:content:application/json:example:- id: exp_AXs1igzRC6+ id: exp_UkLWZg9DAJnumber: EF1001format: csvcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: orders- user_id: adm_cfjuasQi8r+ user_id: adm_UkLWZg9DAJdone: falsefilename:byte_size:@@ -14175,13 +14175,13 @@ paths:content:application/json:example:- id: exp_p6klVeMgbn+ id: exp_UkLWZg9DAJnumber: EF1001format: csvcreated_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'type: orders- user_id: adm_b11Zn4Y5Fq+ user_id: adm_UkLWZg9DAJdone: falsefilename:byte_size:@@ -14279,7 +14279,7 @@ paths:application/json:example:data:- - id: ful_STIszOMIvc+ - id: ful_UkLWZg9DAJnumber: R1001-F1status: unfulfilledtracking: U10000@@ -14293,11 +14293,11 @@ paths:delivery_method_name: UPS Groundstock_location_name: Vernie Lehnerfulfillment_items:- - id: fi_STIszOMIvc+ - id: fi_UkLWZg9DAJquantity: 1- line_item_id: li_Aks1igzRC6- name: Product 1299315- sku: SKU-161+ line_item_id: li_UkLWZg9DAJ+ name: Product 1289315+ sku: SKU-160options_text: ''schema:type: object@@ -14349,7 +14349,7 @@ paths:content:application/json:example:- id: ful_LYpHOn63Vw+ id: ful_UkLWZg9DAJnumber: R1001-F1status: fulfilledtracking: TRACK-1@@ -14363,11 +14363,11 @@ paths:delivery_method_name: UPS Groundstock_location_name: Mirta Hermanfulfillment_items:- - id: fi_LYpHOn63Vw+ - id: fi_UkLWZg9DAJquantity: 1- line_item_id: li_lmiGAYKIUz- name: Product 130961- sku: SKU-162+ line_item_id: li_UkLWZg9DAJ+ name: Product 129961+ sku: SKU-161options_text: ''schema:"$ref": "#/components/schemas/Fulfillment"@@ -14448,7 +14448,7 @@ paths:application/json:example:data:- - id: or_uEf2YK1rnl+ - id: or_UkLWZg9DAJnumber: R1001customer_note:currency: USD@@ -14466,8 +14466,8 @@ paths:total: '110.0'display_total: "$110.00"items:- - id: li_yar3EWPH85- name: Product 13195+ - id: li_UkLWZg9DAJ+ name: Product 13095options_text: ''quantity: 1currency: USD@@ -14475,11 +14475,11 @@ paths:display_price: "$10.00"total: '10.0'display_total: "$10.00"- variant_id: variant_qTK31JYFdu- sku: SKU-163+ variant_id: variant_UkLWZg9DAJ+ sku: SKU-162thumbnail_url:fulfillments:- - id: ful_Kj5Q8YFGzd+ - id: ful_UkLWZg9DAJnumber: R1001-F1status: unfulfilledtracking: U10000@@ -14493,14 +14493,14 @@ paths:delivery_method_name: UPS Groundstock_location_name: Roseline Robertsfulfillment_items:- - id: fi_Kj5Q8YFGzd+ - id: fi_UkLWZg9DAJquantity: 1- line_item_id: li_yar3EWPH85- name: Product 13195- sku: SKU-163+ line_item_id: li_UkLWZg9DAJ+ name: Product 13095+ sku: SKU-162options_text: ''shipping_address:- id: addr_lPxiGAYKIU+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -14522,7 +14522,7 @@ paths:country_iso: USstate_name: New Yorkbilling_address:- id: addr_ARKs1igzRC+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -14597,7 +14597,7 @@ paths:content:application/json:example:- id: or_OtvJLhNcSb+ id: or_UkLWZg9DAJnumber: R1001customer_note:currency: USD@@ -14615,8 +14615,8 @@ paths:total: '110.0'display_total: "$110.00"items:- - id: li_zNcwP3ZbDr- name: Product 1329755+ - id: li_UkLWZg9DAJ+ name: Product 1319755options_text: ''quantity: 1currency: USD@@ -14624,11 +14624,11 @@ paths:display_price: "$10.00"total: '10.0'display_total: "$10.00"- variant_id: variant_JrVaEBgznC- sku: SKU-164+ variant_id: variant_UkLWZg9DAJ+ sku: SKU-163thumbnail_url:fulfillments:- - id: ful_hDBvQ85Ws9+ - id: ful_UkLWZg9DAJnumber: R1001-F1status: unfulfilledtracking: U10000@@ -14642,14 +14642,14 @@ paths:delivery_method_name: UPS Groundstock_location_name: Woodrow Handfulfillment_items:- - id: fi_hDBvQ85Ws9+ - id: fi_UkLWZg9DAJquantity: 1- line_item_id: li_zNcwP3ZbDr- name: Product 1329755- sku: SKU-164+ line_item_id: li_UkLWZg9DAJ+ name: Product 1319755+ sku: SKU-163options_text: ''shipping_address:- id: addr_z2zcwP3ZbD+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -14671,7 +14671,7 @@ paths:country_iso: USstate_name: New Yorkbilling_address:- id: addr_yStr3EWPH8+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -14735,7 +14735,7 @@ paths:content:application/json:example:- id: or_nWaqfPa3Cp+ id: or_UkLWZg9DAJnumber: R1001customer_note:currency: USD@@ -14753,8 +14753,8 @@ paths:total: '110.0'display_total: "$110.00"items:- - id: li_bnnZn4Y5Fq- name: Product 1356554+ - id: li_UkLWZg9DAJ+ name: Product 1346554options_text: ''quantity: 1currency: USD@@ -14762,11 +14762,11 @@ paths:display_price: "$10.00"total: '10.0'display_total: "$10.00"- variant_id: variant_Xnkbb5HTmV- sku: SKU-167+ variant_id: variant_UkLWZg9DAJ+ sku: SKU-166thumbnail_url:fulfillments:- - id: ful_iIDfaj7G4u+ - id: ful_UkLWZg9DAJnumber: R1001-F1status: canceledtracking: U10000@@ -14780,14 +14780,14 @@ paths:delivery_method_name: UPS Groundstock_location_name: Ricky Kutchfulfillment_items:- - id: fi_iIDfaj7G4u+ - id: fi_UkLWZg9DAJquantity: 1- line_item_id: li_bnnZn4Y5Fq- name: Product 1356554- sku: SKU-167+ line_item_id: li_UkLWZg9DAJ+ name: Product 1346554+ sku: SKU-166options_text: ''shipping_address:- id: addr_EwFhxLZ9ck+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -14809,7 +14809,7 @@ paths:country_iso: USstate_name: New Yorkbilling_address:- id: addr_gbMHJdmfrX+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doediff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yamlindex eb833d9e75..c97208be69 100644--- a/docs/api-reference/store.yaml+++ b/docs/api-reference/store.yaml@@ -87,10 +87,10 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDksInVzZXJfdHlwZSI6ImN1c3RvbWVyIiwianRpIjoiZGVmYzlhZmEtNTM5Ni00MTBjLWFkNjgtMThhMGI3YzkyYzAzIiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzdG9yZV9hcGkiLCJleHAiOjE3Njg0ODIwMDB9.KNYIsifwkeCqetLC2USakGGHoOvuZgI5kAgZFMQdrRs+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImRlZmM5YWZhLTUzOTYtNDEwYy1hZDY4LTE4YTBiN2M5MmMwMyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzY4NDgyMDAwfQ.ha-8UOgpGEgYAVWjEqzhLZ9LPtI6uTlsDB3We7qbrdUrefresh_token: CxKP3VYWQzkXqrfxTmPLB446user:- id: cust_ZqQMUPd7wV+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Lennylast_name: Kuhlman@@ -194,10 +194,10 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMTIsInVzZXJfdHlwZSI6ImN1c3RvbWVyIiwianRpIjoiMWYzMzk4ZjYtNzNkOC00N2M2LWE0OTgtNTE0NzcwZTFhNTI1IiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzdG9yZV9hcGkiLCJleHAiOjE3Njg0ODIwMDB9.sscfS2tsLF2Ndy3mH6RV5pTLeLK5vi4HINGl3SIGpBM+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjFmMzM5OGY2LTczZDgtNDdjNi1hNDk4LTUxNDc3MGUxYTUyNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzY4NDgyMDAwfQ.Zpvl-ISrctLW34O3zJFteOf3wMDNvlymVKsbkCIfeewrefresh_token: mWbQ77onTSsXQta8Z4SAVaTUuser:- id: cust_KAw5Q8YFGz+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Tijuanalast_name: Konopelski@@ -390,10 +390,10 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNDUsInVzZXJfdHlwZSI6ImN1c3RvbWVyIiwianRpIjoiN2U4YjY2NzktMGM3Ni00NDUyLWExYzItYmFjZTQxY2E3YjIwIiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzdG9yZV9hcGkiLCJleHAiOjE3Njg0ODIwMDB9.11kcZywz6zSjf_7aX_x1ZIR7Ydck9LTToWAZWkDPpx8+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjdlOGI2Njc5LTBjNzYtNDQ1Mi1hMWMyLWJhY2U0MWNhN2IyMCIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzY4NDgyMDAwfQ.grC4diUECUp8b3p6jJBHAZp_MyiSUQwA4rdQLel_zuMrefresh_token: JNJKeT5cELhdSfb2tWHj3ctpuser:- id: cust_CmGSrJgpzQ+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Lucaslast_name: Stiedemann@@ -507,7 +507,7 @@ paths:application/json:example:data:- - id: ctg_GZUcnUYI5A+ - id: ctg_UkLWZg9DAJname: Catalogpermalink: catalogposition: 0@@ -524,7 +524,7 @@ paths:is_root: trueis_child: falseis_leaf: false- - id: ctg_ROeNhrwyV9+ - id: ctg_gbHJdmfrXBname: category_3permalink: catalog/category-3position: 0@@ -533,7 +533,7 @@ paths:meta_description:meta_keywords:children_count: 1- parent_id: ctg_GZUcnUYI5A+ parent_id: ctg_UkLWZg9DAJdescription: ''description_html: ''image_url:@@ -541,7 +541,7 @@ paths:is_root: falseis_child: trueis_leaf: false- - id: ctg_L3pHOn63Vw+ - id: ctg_EfhxLZ9ck8name: category_4permalink: catalog/category-3/category-4position: 0@@ -550,7 +550,7 @@ paths:meta_description:meta_keywords:children_count: 0- parent_id: ctg_ROeNhrwyV9+ parent_id: ctg_gbHJdmfrXBdescription: ''description_html: ''image_url:@@ -641,7 +641,7 @@ paths:content:application/json:example:- id: ctg_M2nyloHRUQ+ id: ctg_gbHJdmfrXBname: category_12permalink: catalog/category-12position: 0@@ -650,7 +650,7 @@ paths:meta_description:meta_keywords:children_count: 1- parent_id: ctg_5CQZnCRf8J+ parent_id: ctg_UkLWZg9DAJdescription: ''description_html: ''image_url:@@ -724,7 +724,7 @@ paths:application/json:example:data:- - id: coll_s18jaGonyx+ - id: coll_UkLWZg9DAJname: Summer Salepermalink: summer-saleposition: 1@@ -805,7 +805,7 @@ paths:content:application/json:example:- id: coll_YHETxCGlb0+ id: coll_UkLWZg9DAJname: Summer Salepermalink: summer-saleposition: 1@@ -875,9 +875,9 @@ paths:application/json:example:data:- - id: prod_L5hpHOn63V- name: Product 1706979- slug: product-1706979+ - id: prod_UkLWZg9DAJ+ name: Product 1696979+ slug: product-1696979meta_title:meta_description:meta_keywords:@@ -895,12 +895,12 @@ paths:description_html: Accusantium ex dicta error nemo ipsa vel eaqueporro. Laborum ipsam molestias iure aspernatur quos dolorem. Quialibero odio nesciunt debitis eaque.- default_variant_id: variant_LQTpHOn63V- buy_box_variant_id: variant_LQTpHOn63V+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_LQBpHOn63V+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -1050,9 +1050,9 @@ paths:application/json:example:data:- - id: prod_rmeClYtECF- name: Product 2169085- slug: product-2169085+ - id: prod_UkLWZg9DAJ+ name: Product 2159085+ slug: product-2159085meta_title:meta_description:meta_keywords:@@ -1066,12 +1066,12 @@ paths:available: truedescription: A comfortable cotton t-shirt.description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"- default_variant_id: variant_E9UhxLZ9ck- buy_box_variant_id: variant_E9UhxLZ9ck+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_rx6ClYtECF+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -1082,9 +1082,9 @@ paths:price_list_id:original_price:seller_id:- - id: prod_8HzR0I7fEb- name: Product 2178209- slug: product-2178209+ - id: prod_gbHJdmfrXB+ name: Product 2168209+ slug: product-2168209meta_title:meta_description:meta_keywords:@@ -1107,12 +1107,12 @@ paths:description_html: |-Quasi nostrum error iste autem recusandae consequuntur consectetur. Dolorem ea officia rerum a. Asperiores et occaecati laudantium deserunt modi reiciendis rem. Iste soluta tempora odit voluptate cupiditate. Architecto nostrum aliquid est odit minima repudiandae.Doloribus quos est in illum. Occaecati vero soluta asperiores aliquam odio accusamus incidunt. Officia magnam fugiat sint optio ipsa. Deserunt reiciendis aliquid architecto occaecati rem maxime vero doloremque. Recusandae ipsum natus eius assumenda.- default_variant_id: variant_ujG2YK1rnl- buy_box_variant_id: variant_ujG2YK1rnl+ default_variant_id: variant_EfhxLZ9ck8+ buy_box_variant_id: variant_EfhxLZ9ck8thumbnail_url:tags: []price:- id: price_aIetNvLSUA+ id: price_EfhxLZ9ck8amount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -1212,9 +1212,9 @@ paths:content:application/json:example:- id: prod_UQ5LWZg9DA- name: Product 2446885- slug: product-2446885+ id: prod_UkLWZg9DAJ+ name: Product 2436885+ slug: product-2436885meta_title:meta_description:meta_keywords:@@ -1228,12 +1228,12 @@ paths:available: truedescription: A comfortable cotton t-shirt.description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"- default_variant_id: variant_8VER0I7fEb- buy_box_variant_id: variant_8VER0I7fEb+ default_variant_id: variant_UkLWZg9DAJ+ buy_box_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []price:- id: price_OSlJLhNcSb+ id: price_UkLWZg9DAJamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -1245,7 +1245,7 @@ paths:original_price:seller_id:prior_price:- id: _ozTlrKdXja+ id: _AXs1igzRC6amount: '9.99'amount_in_cents: 999currency: USD@@ -1331,13 +1331,13 @@ paths:count: 2- id: out_of_stockcount: 0- - id: opt_6AgxZbenF4+ - id: opt_UkLWZg9DAJtype: optionname: sizelabel: Sizekind: dropdownoptions:- - id: optval_XLbb5HTmVa+ - id: optval_UkLWZg9DAJname: smalllabel: Sposition: 1@@ -1347,7 +1347,7 @@ paths:- id: categoriestype: categoryoptions:- - id: ctg_VZ3XmZF31w+ - id: ctg_gbHJdmfrXBname: Shirtspermalink: category-34/shirtscount: 2@@ -1558,15 +1558,15 @@ paths:discounts: []fees: []items:- - id: li_UkKLWZg9DA- variant_id: variant_6X8gxZbenF+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 144715- slug: product-144715+ name: Product 143715+ slug: product-143715options_text: ''price: '10.0'display_price: "$10.00"@@ -1669,15 +1669,15 @@ paths:discounts: []fees: []items:- - id: li_gXZHJdmfrX- variant_id: variant_Ae5s1igzRC+ - id: li_gbHJdmfrXB+ variant_id: variant_gbHJdmfrXBseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1452171- slug: product-1452171+ name: Product 1442171+ slug: product-1442171options_text: ''price: '10.0'display_price: "$10.00"@@ -1788,13 +1788,13 @@ paths:content:application/json:example:- id: cart_VqXmZF31wY+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_VqXmZF31wY+ number: cart_UkLWZg9DAJtoken: jBrNbC8FSNyavqebdqu7e3uLemail:customer_note:@@ -1958,13 +1958,13 @@ paths:content:application/json:example:- id: cart_OIJLhNcSbf+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_OIJLhNcSbf+ number: cart_UkLWZg9DAJtoken: HnnryvFFwjfx9P6ykByF4Gg2email:customer_note:@@ -1973,9 +1973,9 @@ paths:total_quantity: 0warnings:- code: line_item_removed- message: Product 149307 was removed because it was sold out- line_item_id: li_OtvJLhNcSb- variant_id: variant_chYuasQi8r+ message: Product 148307 was removed because it was sold out+ line_item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJcoupon_code:item_total: '0.0'display_item_total: "$0.00"@@ -2117,13 +2117,13 @@ paths:content:application/json:example:- id: cart_AXs1igzRC6+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_AXs1igzRC6+ number: cart_UkLWZg9DAJtoken: PMVmxRAiLqMivU5QgJqfpQMDemail:customer_note: Leave at door@@ -2176,15 +2176,15 @@ paths:discounts: []fees: []items:- - id: li_ARbs1igzRC- variant_id: variant_U5KLWZg9DA+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1503263- slug: product-1503263+ name: Product 1493263+ slug: product-1493263options_text: ''price: '10.0'display_price: "$10.00"@@ -2398,13 +2398,13 @@ paths:content:application/json:example:- id: cart_nJqfPa3Cpe+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_nJqfPa3Cpe+ number: cart_UkLWZg9DAJtoken: rrGvkDXx3KcQVwLVk8XiVCVkemail: [email protected]customer_note:@@ -2454,15 +2454,15 @@ paths:discounts: []fees: []items:- - id: li_nWaqfPa3Cp- variant_id: variant_U5QLWZg9DA+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1528992- slug: product-1528992+ name: Product 1518992+ slug: product-1518992options_text: ''price: '10.0'display_price: "$10.00"@@ -2488,7 +2488,7 @@ paths:fulfillments: []payments: []billing_address:- id: addr_qTK31JYFdu+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -2510,7 +2510,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_4teOlu6p4z+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -2618,9 +2618,9 @@ paths:content:application/json:example:- id: or_xiBoCpeNMW+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJ- cart_id: cart_vEmzDoNU0H+ cart_id: cart_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJcompany_id:company_name:@@ -2662,15 +2662,15 @@ paths:discounts: []fees: []items:- - id: li_2h5Y5XM6fr- variant_id: variant_Vn0XmZF31w+ - id: li_gbHJdmfrXB+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1554794- slug: product-1554794+ name: Product 1544794+ slug: product-1544794options_text: ''price: '10.0'display_price: "$10.00"@@ -2694,14 +2694,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_lmiGAYKIUz+ - id: ful_gbHJdmfrXBnumber: R1001-F1tracking:tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_NuazXvxTk8+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '10.0'display_cost: "$10.00"total: '10.0'@@ -2721,11 +2721,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_2h5Y5XM6fr- variant_id: variant_Vn0XmZF31w+ - item_id: li_gbHJdmfrXB+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_9URFqgRua4+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -2734,7 +2734,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_N2tzXvxTk8+ id: sloc_UkLWZg9DAJname: Deangelo Prosaccoaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -2746,8 +2746,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_NuazXvxTk8- delivery_method_id: dm_9URFqgRua4+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -2764,7 +2764,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_9URFqgRua4+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -2773,17 +2773,17 @@ paths:pickup: falsepickup_point: falsepayments:- - id: py_5CQZnCRf8J- payment_method_id: pm_UkpLWZg9DA+ - id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code: BGS-518d4ef9738enumber: R1001-P1status: completedamount: '20.0'display_amount: "$20.00"source_type: credit_card- source_id: card_msx3nOJap6+ source_id: card_UkLWZg9DAJsource:- id: card_msx3nOJap6+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -2792,14 +2792,14 @@ paths:default: falsegateway_payment_profile_id:payment_method:- id: pm_UkpLWZg9DA+ id: pm_UkLWZg9DAJname: Checkdescription:type: checksession_required: falsesource_required: falsebilling_address:- id: addr_Sx7IszOMIv+ id: addr_uw2YK1rnl0label:first_name: Johnlast_name: Doe@@ -2821,7 +2821,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_L5hpHOn63V+ id: addr_OIJLhNcSbflabel:first_name: Johnlast_name: Doe@@ -2933,13 +2933,13 @@ paths:content:application/json:example:- id: cart_HOVtlDrOmL+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_HOVtlDrOmL+ number: cart_UkLWZg9DAJtoken: 4ryA4ms4Nim9TfxNW4fZi3auemail:customer_note:@@ -2987,7 +2987,7 @@ paths:shipping_eq_billing_address: truediscounts:- id: discount_UkLWZg9DAJ- promotion_id: promo_F0GX8NaP3Y+ promotion_id: promo_UkLWZg9DAJname: Promodescription:code: save10@@ -2995,15 +2995,15 @@ paths:display_amount: "-$10.00"fees: []items:- - id: li_3T2WpPTcf5- variant_id: variant_pAIklVeMgb+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1824241- slug: product-1824241+ name: Product 1814241+ slug: product-1814241options_text: ''price: '10.0'display_price: "$10.00"@@ -3127,13 +3127,13 @@ paths:content:application/json:example:- id: cart_s18jaGonyx+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_s18jaGonyx+ number: cart_UkLWZg9DAJtoken: gvr8TwNVJpxWf27uUHDj5Lj4email:customer_note:@@ -3186,15 +3186,15 @@ paths:discounts: []fees: []items:- - id: li_ml8x3nOJap- variant_id: variant_rmeClYtECF+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1843461- slug: product-1843461+ name: Product 1833461+ slug: product-1833461options_text: ''price: '10.0'display_price: "$10.00"@@ -3312,13 +3312,13 @@ paths:content:application/json:example:- id: cart_ROeNhrwyV9+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_ROeNhrwyV9+ number: cart_UkLWZg9DAJtoken: KLLfFWg9T6dGonBb65hHjaZremail: [email protected]customer_note:@@ -3365,15 +3365,15 @@ paths:discounts: []fees: []items:- - id: li_M3YnyloHRU- variant_id: variant_aSRtNvLSUA+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1868182- slug: product-1868182+ name: Product 1858182+ slug: product-1858182options_text: ''price: '10.0'display_price: "$10.00"@@ -3397,14 +3397,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_VZ3XmZF31w- number: cart_ROeNhrwyV9-F1+ - id: ful_UkLWZg9DAJ+ number: cart_UkLWZg9DAJ-F1tracking:tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_yStr3EWPH8+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '10.0'display_cost: "$10.00"total: '10.0'@@ -3424,11 +3424,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_M3YnyloHRU- variant_id: variant_aSRtNvLSUA+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_M3YnyloHRU+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -3437,7 +3437,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_9p6FqgRua4+ id: sloc_UkLWZg9DAJname: Monnie O'Keefeaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -3449,8 +3449,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_yStr3EWPH8- delivery_method_id: dm_M3YnyloHRU+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -3467,7 +3467,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_M3YnyloHRU+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -3478,7 +3478,7 @@ paths:payments: []billing_address:shipping_address:- id: addr_n1rqfPa3Cp+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -3599,13 +3599,13 @@ paths:content:application/json:example:- id: cart_PQNMcnNFWw+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_PQNMcnNFWw+ number: cart_UkLWZg9DAJtoken: nZjAPYSKrNaHf2ZVT6eZfNJVemail:customer_note:@@ -3654,15 +3654,15 @@ paths:discounts: []fees: []items:- - id: li_sel8jaGony- variant_id: variant_QezA48cIW7+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1885702- slug: product-1885702+ name: Product 1875702+ slug: product-1875702options_text: ''price: '10.0'display_price: "$10.00"@@ -3687,17 +3687,17 @@ paths:digital_links: []fulfillments: []payments:- - id: py_M2nyloHRUQ- payment_method_id: pm_ARbs1igzRC- response_code: 9-SC-20260115120000000000- number: cart_PQNMcnNFWw-P1+ - id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJ+ response_code: 1-SC-20260115120000000000+ number: cart_UkLWZg9DAJ-P1status: checkoutamount: '10.0'display_amount: "$10.00"source_type: store_credit- source_id: credit_nJqfPa3Cpe+ source_id: credit_UkLWZg9DAJsource:- id: credit_nJqfPa3Cpe+ id: credit_UkLWZg9DAJamount: '10.0'amount_used: '0.0'amount_remaining: '10.0'@@ -3706,7 +3706,7 @@ paths:display_amount_remaining: "$10.00"currency: USDpayment_method:- id: pm_ARbs1igzRC+ id: pm_UkLWZg9DAJname: Store Creditdescription:type: store_credit@@ -3715,14 +3715,14 @@ paths:billing_address:shipping_address:payment_methods:- - id: pm_ARbs1igzRC+ - id: pm_UkLWZg9DAJname: Store Creditdescription:type: store_creditsession_required: falsesource_required: truegift_card:- id: gc_8cR0I7fEbw+ id: gc_UkLWZg9DAJcode: GIFTCODE1status: activecurrency: USD@@ -3841,13 +3841,13 @@ paths:content:application/json:example:- id: cart_F0GX8NaP3Y+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_F0GX8NaP3Y+ number: cart_UkLWZg9DAJtoken: Wgq8NrLX3TUQLroJRYWFdQd5email:customer_note:@@ -3900,15 +3900,15 @@ paths:discounts: []fees: []items:- - id: li_Q8DA48cIW7- variant_id: variant_q1531JYFdu+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1929569- slug: product-1929569+ name: Product 1919569+ slug: product-1919569options_text: ''price: '10.0'display_price: "$10.00"@@ -3933,17 +3933,17 @@ paths:digital_links: []fulfillments: []payments:- - id: py_prklVeMgbn- payment_method_id: pm_p5gklVeMgb- response_code: 10-SC-20260115120000000000- number: cart_F0GX8NaP3Y-P1+ - id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJ+ response_code: 1-SC-20260115120000000000+ number: cart_UkLWZg9DAJ-P1status: invalidamount: '10.0'display_amount: "$10.00"source_type: store_credit- source_id: credit_98FqgRua4h+ source_id: credit_UkLWZg9DAJsource:- id: credit_98FqgRua4h+ id: credit_UkLWZg9DAJamount: '10.0'amount_used: '0.0'amount_remaining: '10.0'@@ -3952,7 +3952,7 @@ paths:display_amount_remaining: "$10.00"currency: USDpayment_method:- id: pm_p5gklVeMgb+ id: pm_UkLWZg9DAJname: Store Creditdescription:type: store_credit@@ -4042,13 +4042,13 @@ paths:content:application/json:example:- id: cart_3uWpPTcf5W+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_3uWpPTcf5W+ number: cart_UkLWZg9DAJtoken: d12LXVnL3KtzGjXePqRawnPcemail:customer_note:@@ -4057,11 +4057,11 @@ paths:total_quantity: 2warnings:- code: delivery_unavailable- message: Product 19563 cannot be delivered to the selected address- line_item_id: li_oD3lrKdXja+ message: Product 19463 cannot be delivered to the selected address+ line_item_id: li_UkLWZg9DAJ- code: delivery_unavailable- message: Product 196298 cannot be delivered to the selected address- line_item_id: li_4aROlu6p4z+ message: Product 195298 cannot be delivered to the selected address+ line_item_id: li_gbHJdmfrXBcoupon_code:item_total: '29.99'display_item_total: "$29.99"@@ -4107,15 +4107,15 @@ paths:discounts: []fees: []items:- - id: li_oD3lrKdXja- variant_id: variant_NYyzXvxTk8+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 19563- slug: product-19563+ name: Product 19463+ slug: product-19463options_text: ''price: '10.0'display_price: "$10.00"@@ -4138,15 +4138,15 @@ paths:thumbnail_url:option_values: []digital_links: []- - id: li_4aROlu6p4z- variant_id: variant_XqKbb5HTmV+ - id: li_gbHJdmfrXB+ variant_id: variant_gbHJdmfrXBseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 196298- slug: product-196298+ name: Product 195298+ slug: product-195298options_text: ''price: '19.99'display_price: "$19.99"@@ -4297,13 +4297,13 @@ paths:content:application/json:example:- id: cart_prklVeMgbn+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_prklVeMgbn+ number: cart_UkLWZg9DAJtoken: Yq5XuZqq7KS7y7n2dMsChnZMemail:customer_note:@@ -4313,7 +4313,7 @@ paths:warnings:- code: purchase_limit_exceededmessage: Quantity You can order at most 10 of this item.- variant_id: variant_h9zBvQ85Ws+ variant_id: variant_UkLWZg9DAJitem_index: 0coupon_code:item_total: '10.0'@@ -4360,15 +4360,15 @@ paths:discounts: []fees: []items:- - id: li_XMpbb5HTmV- variant_id: variant_h9zBvQ85Ws+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 2029165- slug: product-2029165+ name: Product 2019165+ slug: product-2019165options_text: ''price: '10.0'display_price: "$10.00"@@ -4481,13 +4481,13 @@ paths:content:application/json:example:- id: cart_so8jaGonyx+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_so8jaGonyx+ number: cart_UkLWZg9DAJtoken: arTvbVzmU1krWKLbRnWDZ3cLemail:customer_note:@@ -4641,11 +4641,11 @@ paths:customer_external_id:expires_at:amount: '10.0'- payment_method_id: pm_nWaqfPa3Cp- order_id: cart_8DR0I7fEbw- cart_id: cart_8DR0I7fEbw+ payment_method_id: pm_UkLWZg9DAJ+ order_id: cart_UkLWZg9DAJ+ cart_id: cart_UkLWZg9DAJpayment_method:- id: pm_nWaqfPa3Cp+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -4733,7 +4733,7 @@ paths:content:application/json:example:- id: ps_EfhxLZ9ck8+ id: ps_UkLWZg9DAJstatus: pendingcurrency: USDexternal_id: bogus_96d0ebf0a4300304c930f3c0@@ -4742,11 +4742,11 @@ paths:customer_external_id:expires_at:amount: '10.0'- payment_method_id: pm_9URFqgRua4- order_id: cart_aAtNvLSUAr- cart_id: cart_aAtNvLSUAr+ payment_method_id: pm_UkLWZg9DAJ+ order_id: cart_UkLWZg9DAJ+ cart_id: cart_UkLWZg9DAJpayment_method:- id: pm_9URFqgRua4+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -4801,7 +4801,7 @@ paths:content:application/json:example:- id: ps_uw2YK1rnl0+ id: ps_UkLWZg9DAJstatus: pendingcurrency: USDexternal_id: bogus_8a53bedc6c12205d0e31f231@@ -4810,11 +4810,11 @@ paths:customer_external_id:expires_at:amount: '50.0'- payment_method_id: pm_vohmzDoNU0- order_id: cart_QDA48cIW7A- cart_id: cart_QDA48cIW7A+ payment_method_id: pm_UkLWZg9DAJ+ order_id: cart_UkLWZg9DAJ+ cart_id: cart_UkLWZg9DAJpayment_method:- id: pm_vohmzDoNU0+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -4909,7 +4909,7 @@ paths:content:application/json:example:- id: ps_OIJLhNcSbf+ id: ps_UkLWZg9DAJstatus: completedcurrency: USDexternal_id: bogus_f6de6a6c7dddf8f63c45a3f0@@ -4918,11 +4918,11 @@ paths:customer_external_id:expires_at:amount: '10.0'- payment_method_id: pm_2h5Y5XM6fr- order_id: cart_8cR0I7fEbw- cart_id: cart_8cR0I7fEbw+ payment_method_id: pm_UkLWZg9DAJ+ order_id: cart_UkLWZg9DAJ+ cart_id: cart_UkLWZg9DAJpayment_method:- id: pm_2h5Y5XM6fr+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -5012,10 +5012,10 @@ paths:content:application/json:example:- id: py_so8jaGonyx- payment_method_id: pm_YBVETxCGlb+ id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJresponse_code:- number: cart_48Olu6p4zZ-P1+ number: cart_UkLWZg9DAJ-P1status: checkoutamount: '10.0'display_amount: "$10.00"@@ -5023,7 +5023,7 @@ paths:source_id:source:payment_method:- id: pm_YBVETxCGlb+ id: pm_UkLWZg9DAJname: Checkdescription:type: check@@ -5119,13 +5119,13 @@ paths:content:application/json:example:- id: cart_JgaEBgznCp+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_JgaEBgznCp+ number: cart_UkLWZg9DAJtoken: acfBZtWemHae74Y3g18LQg1femail:customer_note:@@ -5174,15 +5174,15 @@ paths:discounts: []fees: []items:- - id: li_z2zcwP3ZbD- variant_id: variant_UAsLWZg9DA+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 2649789- slug: product-2649789+ name: Product 2639789+ slug: product-2639789options_text: ''price: '10.0'display_price: "$10.00"@@ -5207,17 +5207,17 @@ paths:digital_links: []fulfillments: []payments:- - id: py_rsClYtECFI- payment_method_id: pm_FLTGX8NaP3- response_code: 15-SC-20260115120000000000- number: cart_JgaEBgznCp-P1+ - id: py_UkLWZg9DAJ+ payment_method_id: pm_UkLWZg9DAJ+ response_code: 1-SC-20260115120000000000+ number: cart_UkLWZg9DAJ-P1status: checkoutamount: '10.0'display_amount: "$10.00"source_type: store_credit- source_id: credit_ed6l8wVqSM+ source_id: credit_UkLWZg9DAJsource:- id: credit_ed6l8wVqSM+ id: credit_UkLWZg9DAJamount: '50.0'amount_used: '0.0'amount_remaining: '50.0'@@ -5226,7 +5226,7 @@ paths:display_amount_remaining: "$50.00"currency: USDpayment_method:- id: pm_FLTGX8NaP3+ id: pm_UkLWZg9DAJname: Store Creditdescription: Store Credittype: store_credit@@ -5235,7 +5235,7 @@ paths:billing_address:shipping_address:payment_methods:- - id: pm_FLTGX8NaP3+ - id: pm_UkLWZg9DAJname: Store Creditdescription: Store Credittype: store_credit@@ -5325,13 +5325,13 @@ paths:content:application/json:example:- id: cart_NJzXvxTk8u+ id: cart_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJpreferred_stock_location_id:company_id:company_name:- number: cart_NJzXvxTk8u+ number: cart_UkLWZg9DAJtoken: BHWevnp2PQxC1jSWU3ZFLejTemail:customer_note:@@ -5384,15 +5384,15 @@ paths:discounts: []fees: []items:- - id: li_UKkLWZg9DA- variant_id: variant_EFLhxLZ9ck+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 266179- slug: product-266179+ name: Product 265179+ slug: product-265179options_text: ''price: '10.0'display_price: "$10.00"@@ -5507,7 +5507,7 @@ paths:content:application/json:example:- id: or_CvFSrJgpzQ+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -5551,15 +5551,15 @@ paths:discounts: []fees: []items:- - id: li_LKEpHOn63V- variant_id: variant_6bRgxZbenF+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 206496- slug: product-206496+ name: Product 205496+ slug: product-205496options_text: ''price: '10.0'display_price: "$10.00"@@ -5583,14 +5583,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_xiBoCpeNMW+ - id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_gbMHJdmfrX+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -5610,11 +5610,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_LKEpHOn63V- variant_id: variant_6bRgxZbenF+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_NuazXvxTk8+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -5623,7 +5623,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_DuVPsx31Wa+ id: sloc_UkLWZg9DAJname: Thomasine Armstrongaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -5635,8 +5635,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_gbMHJdmfrX- delivery_method_id: dm_NuazXvxTk8+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -5653,7 +5653,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_NuazXvxTk8+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -5663,7 +5663,7 @@ paths:pickup_point: falsepayments: []billing_address:- id: addr_EFLhxLZ9ck+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -5685,7 +5685,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_V31XmZF31w+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -5791,7 +5791,7 @@ paths:application/json:example:data:- - id: addr_VMWXmZF31w+ - id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -5812,7 +5812,7 @@ paths:state_abbr: NYcountry_iso: USstate_name: New York- - id: addr_uh92YK1rnl+ - id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -5833,7 +5833,7 @@ paths:state_abbr: NYcountry_iso: USstate_name: New York- - id: addr_OymJLhNcSb+ - id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -5934,7 +5934,7 @@ paths:content:application/json:example:- id: addr_2BQY5XM6fr+ id: addr_VqXmZF31wYlabel:first_name: Johnlast_name: Doe@@ -6091,7 +6091,7 @@ paths:content:application/json:example:- id: addr_L50pHOn63V+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -6173,7 +6173,7 @@ paths:content:application/json:example:- id: addr_kAaKT9MVfb+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -6334,7 +6334,7 @@ paths:application/json:example:data:- - id: card_5CQZnCRf8J+ - id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -6423,7 +6423,7 @@ paths:content:application/json:example:- id: card_prklVeMgbn+ id: card_UkLWZg9DAJbrand: visalast4: '1111'month: 12@@ -6617,7 +6617,7 @@ paths:application/json:example:data:- - id: or_2h5Y5XM6fr+ - id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -6661,15 +6661,15 @@ paths:discounts: []fees: []items:- - id: li_se78jaGony- variant_id: variant_CxUSrJgpzQ+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1725270- slug: product-1725270+ name: Product 1715270+ slug: product-1715270options_text: ''price: '10.0'display_price: "$10.00"@@ -6693,14 +6693,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_zNcwP3ZbDr+ - id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_Sm1IszOMIv+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -6720,11 +6720,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_se78jaGony- variant_id: variant_CxUSrJgpzQ+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_PcANMcnNFW+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -6733,7 +6733,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_U5KLWZg9DA+ id: sloc_UkLWZg9DAJname: Macy Goyetteaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -6745,8 +6745,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_Sm1IszOMIv- delivery_method_id: dm_PcANMcnNFW+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -6763,7 +6763,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_PcANMcnNFW+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -6773,7 +6773,7 @@ paths:pickup_point: falsepayments: []billing_address:- id: addr_pAIklVeMgb+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -6795,7 +6795,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_sgD8jaGony+ id: addr_VqXmZF31wYlabel:first_name: Johnlast_name: Doe@@ -6925,7 +6925,7 @@ paths:content:application/json:example:- id: or_eH46l8wVqS+ id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ@@ -6969,15 +6969,15 @@ paths:discounts: []fees: []items:- - id: li_RgJeNhrwyV- variant_id: variant_5RtQZnCRf8+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1745633- slug: product-1745633+ name: Product 1735633+ slug: product-1735633options_text: ''price: '10.0'display_price: "$10.00"@@ -7001,14 +7001,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_UkpLWZg9DA+ - id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_hwPBvQ85Ws+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -7028,11 +7028,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_RgJeNhrwyV- variant_id: variant_5RtQZnCRf8+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_YBVETxCGlb+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -7041,7 +7041,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_b33Zn4Y5Fq+ id: sloc_UkLWZg9DAJname: Sunny Bernieraddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -7053,8 +7053,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_hwPBvQ85Ws- delivery_method_id: dm_YBVETxCGlb+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -7071,7 +7071,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_YBVETxCGlb+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -7081,7 +7081,7 @@ paths:pickup_point: falsepayments: []billing_address:- id: addr_QezA48cIW7+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -7103,7 +7103,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_8HYR0I7fEb+ id: addr_VqXmZF31wYlabel:first_name: Johnlast_name: Doe@@ -7189,10 +7189,10 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNTEsInVzZXJfdHlwZSI6ImN1c3RvbWVyIiwianRpIjoiNjQ5YzY1OTMtMGFlZC00MDk3LWFhMjctOGEyNWZhNTg4Yjc5IiwiaXNzIjoic3ByZWUiLCJhdWQiOiJzdG9yZV9hcGkiLCJleHAiOjE3Njg0ODIwMDB9.vSFP8tjYpb6SZGDGH0eHCuvZMYezuMmCr-DMVMad4LU+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjY0OWM2NTkzLTBhZWQtNDA5Ny1hYTI3LThhMjVmYTU4OGI3OSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzY4NDgyMDAwfQ.llCt1j8kVryteixNYywlzA1x8CGqCNBaKiT3-ihDrsErefresh_token: mLm6vdSzLUgPhw8SCzDiagfLuser:- id: cust_DcHPsx31Wa+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Johnlast_name: Doe@@ -7211,7 +7211,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'verified: trueverified_at: '2026-01-15T12:00:00Z'- customer_id: cust_DcHPsx31Wa+ customer_id: cust_UkLWZg9DAJcustomer_groups: []schema:"$ref": "#/components/schemas/AuthResponse"@@ -7312,7 +7312,7 @@ paths:content:application/json:example:- id: cust_58IQZnCRf8+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Felixlast_name: Rowe@@ -7322,7 +7322,7 @@ paths:available_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses:- - id: addr_tIMyJwvFCu+ - id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -7343,7 +7343,7 @@ paths:state_abbr: NYcountry_iso: USstate_name: New York- - id: addr_NYyzXvxTk8+ - id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -7365,7 +7365,7 @@ paths:country_iso: USstate_name: New Yorkdefault_billing_address:- id: addr_NYyzXvxTk8+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -7387,7 +7387,7 @@ paths:country_iso: USstate_name: New Yorkdefault_shipping_address:- id: addr_tIMyJwvFCu+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -7468,7 +7468,7 @@ paths:content:application/json:example:- id: cust_MWEnyloHRU+ id: cust_UkLWZg9DAJemail: [email protected]first_name: Updatedlast_name: Name@@ -7478,7 +7478,7 @@ paths:available_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses:- - id: addr_XqKbb5HTmV+ - id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -7499,7 +7499,7 @@ paths:state_abbr: NYcountry_iso: USstate_name: New York- - id: addr_kshKT9MVfb+ - id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -7521,7 +7521,7 @@ paths:country_iso: USstate_name: New Yorkdefault_billing_address:- id: addr_kshKT9MVfb+ id: addr_gbHJdmfrXBlabel:first_name: Johnlast_name: Doe@@ -7543,7 +7543,7 @@ paths:country_iso: USstate_name: New Yorkdefault_shipping_address:- id: addr_XqKbb5HTmV+ id: addr_UkLWZg9DAJlabel:first_name: Johnlast_name: Doe@@ -7674,7 +7674,7 @@ paths:application/json:example:data:- - id: gc_JgaEBgznCp+ - id: gc_UkLWZg9DAJcode: 1A288BF2DA45E295status: activecurrency: USD@@ -7770,7 +7770,7 @@ paths:content:application/json:example:- id: gc_NJzXvxTk8u+ id: gc_UkLWZg9DAJcode: B7180B830F0E5992status: activecurrency: USD@@ -7849,12 +7849,12 @@ paths:external_id: bogus_seti_b0f840e3d99ea3a536ef5be0external_client_secret: bogus_seti_secret_8fa01173ccc21cebexternal_data: {}- payment_method_id: pm_eH46l8wVqS+ payment_method_id: pm_UkLWZg9DAJpayment_source_id:payment_source_type:- customer_id: cust_2jAY5XM6fr+ customer_id: cust_UkLWZg9DAJpayment_method:- id: pm_eH46l8wVqS+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -7944,18 +7944,18 @@ paths:content:application/json:example:- id: pss_uw2YK1rnl0+ id: pss_UkLWZg9DAJstatus: pendingexternal_id: seti_test_469ea499603a54b5a5f4b192external_client_secret: seti_secret_ee50fe0dfcb78f21eabebb03external_data:client_secret: secret_123- payment_method_id: pm_RgJeNhrwyV+ payment_method_id: pm_UkLWZg9DAJpayment_source_id:payment_source_type:- customer_id: cust_sg48jaGony+ customer_id: cust_UkLWZg9DAJpayment_method:- id: pm_RgJeNhrwyV+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -8025,18 +8025,18 @@ paths:content:application/json:example:- id: pss_AXs1igzRC6+ id: pss_UkLWZg9DAJstatus: completedexternal_id: seti_test_d9e0e43453e8ba9aff74d4b9external_client_secret: seti_secret_73ff06ddd3b1edb4c9b6db1cexternal_data:client_secret: secret_123- payment_method_id: pm_PcANMcnNFW- payment_source_id: card_aAtNvLSUAr+ payment_method_id: pm_UkLWZg9DAJ+ payment_source_id: card_UkLWZg9DAJpayment_source_type: Spree::CreditCard- customer_id: cust_RVteNhrwyV+ customer_id: cust_UkLWZg9DAJpayment_method:- id: pm_PcANMcnNFW+ id: pm_UkLWZg9DAJname: Credit Carddescription:type: bogus@@ -8125,7 +8125,7 @@ paths:application/json:example:data:- - id: credit_xhoCpeNMWu+ - id: credit_UkLWZg9DAJamount: '100.0'amount_used: '0.0'amount_remaining: '100.0'@@ -8213,7 +8213,7 @@ paths:content:application/json:example:- id: credit_2KY5XM6frI+ id: credit_UkLWZg9DAJamount: '100.0'amount_used: '0.0'amount_remaining: '100.0'@@ -8576,7 +8576,7 @@ paths:name: United Statesstates_required: truezipcode_required: true- - id: mkt_tXyJwvFCuK+ - id: mkt_gbHJdmfrXBname: Europecurrency: EURdefault_locale: de@@ -8663,7 +8663,7 @@ paths:content:application/json:example:- id: mkt_XLbb5HTmVa+ id: mkt_gbHJdmfrXBname: Europecurrency: EURdefault_locale: de@@ -8746,7 +8746,7 @@ paths:content:application/json:example:- id: mkt_Z5MUPd7wVj+ id: mkt_gbHJdmfrXBname: Europecurrency: EURdefault_locale: de@@ -9055,7 +9055,7 @@ paths:content:application/json:example:- id: wl_VqXmZF31wY+ id: wl_gbHJdmfrXBname: Birthday Ideastoken: 9QwEwKPqhv9b6g6vN3mSu4Pmis_default: false@@ -9156,7 +9156,7 @@ paths:content:application/json:example:- id: wl_OIJLhNcSbf+ id: wl_UkLWZg9DAJname: My Wishlisttoken: MScw7Kpbgn8BpAxVkttfKab8is_default: false@@ -9222,7 +9222,7 @@ paths:content:application/json:example:- id: wl_p6klVeMgbn+ id: wl_UkLWZg9DAJname: Updated Nametoken: AMc2ph626mbJo7u5VjvVs9CAis_default: false@@ -9336,15 +9336,15 @@ paths:content:application/json:example:- id: wi_98FqgRua4h- variant_id: variant_2f8Y5XM6fr- product_id: prod_psvklVeMgb- wishlist_id: wl_98FqgRua4h+ id: wi_gbHJdmfrXB+ variant_id: variant_gbHJdmfrXB+ product_id: prod_gbHJdmfrXB+ wishlist_id: wl_UkLWZg9DAJquantity: 1variant:- id: variant_2f8Y5XM6fr- product_id: prod_psvklVeMgb- sku: SKU-320+ id: variant_gbHJdmfrXB+ product_id: prod_gbHJdmfrXB+ sku: SKU-319options_text: ''track_inventory: truemedia_count: 0@@ -9359,7 +9359,7 @@ paths:width:depth:price:- id: price_tmqyJwvFCu+ id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999compare_at_amount:@@ -9510,13 +9510,13 @@ paths:content:application/json:example:- id: sub_uw2YK1rnl0+ id: sub_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'verified: trueverified_at: '2026-01-15T12:00:00Z'- customer_id: cust_zEucwP3ZbD+ customer_id: cust_UkLWZg9DAJschema:"$ref": "#/components/schemas/NewsletterSubscriber"'422':@@ -9592,7 +9592,7 @@ paths:content:application/json:example:- id: sub_OIJLhNcSbf+ id: sub_UkLWZg9DAJemail: [email protected]created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -9766,13 +9766,13 @@ paths:body: ''body_html: ''updated_at: '2026-01-15T12:00:00.000Z'- - id: pol_4aROlu6p4z+ - id: pol_OIJLhNcSbfname: Privacy Policyslug: privacy-policy-f4e5666d-52c2-4d89-aec5-cc55d69c7174body: We respect your privacy.body_html: We respect your privacy.updated_at: '2026-01-15T12:00:00.000Z'- - id: pol_oD3lrKdXja+ - id: pol_uw2YK1rnl0name: Return Policyslug: return-policybody: You can return items within 30 days.@@ -9870,7 +9870,7 @@ paths:content:application/json:example:- id: pol_tCbyJwvFCu+ id: pol_uw2YK1rnl0name: Return Policyslug: return-policybody: You can return items within 30 days.@@ -9935,7 +9935,7 @@ paths:content:application/json:example:- id: ch_C9SrJgpzQ4+ id: ch_gbHJdmfrXBname: Wholesalecode: wholesaleactive: true@@ -9997,12 +9997,12 @@ paths:application/json:example:data:- - id: cmem_EfhxLZ9ck8- company_id: comp_L3pHOn63Vw- customer_id: cust_UKkLWZg9DA+ - id: cmem_UkLWZg9DAJ+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_UkLWZg9DAJemail: [email protected]company:- id: comp_L3pHOn63Vw+ id: comp_UkLWZg9DAJname: Acme Industrialkind: companyparent_id:@@ -10063,7 +10063,7 @@ paths:content:application/json:example:- id: comp_PQNMcnNFWw+ id: comp_UkLWZg9DAJname: Acme Industrialkind: companyparent_id:@@ -10102,7 +10102,7 @@ paths:content:application/json:example:- id: comp_YHETxCGlb0+ id: comp_UkLWZg9DAJname: Acme Industrial Groupkind: companyparent_id:@@ -10151,9 +10151,9 @@ paths:application/json:example:data:- - id: cmem_OIJLhNcSbf- company_id: comp_5OQZnCRf8J- customer_id: cust_EwFhxLZ9ck+ - id: cmem_UkLWZg9DAJ+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_UkLWZg9DAJemail: [email protected]meta:page: 1@@ -10211,9 +10211,9 @@ paths:content:application/json:example:- id: cmem_p6klVeMgbn- company_id: comp_F0GX8NaP3Y- customer_id: cust_uh92YK1rnl+ id: cmem_gbHJdmfrXB+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_gbHJdmfrXBemail: [email protected]requestBody:content:@@ -10261,7 +10261,7 @@ paths:application/json:example:data:- - id: addr_Vn0XmZF31w+ - id: addr_EfhxLZ9ck8label: Headquartersfirst_name:last_name:@@ -10332,7 +10332,7 @@ paths:content:application/json:example:- id: addr_A6Ms1igzRC+ id: addr_EfhxLZ9ck8label: Northern Warehousefirst_name:last_name:@@ -10460,11 +10460,11 @@ paths:application/json:example:data:- - id: or_vohmzDoNU0+ - id: or_UkLWZg9DAJmarket_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- company_id: comp_5CQZnCRf8J+ company_id: comp_UkLWZg9DAJcompany_name: Acme Industrialnumber: R1001email: [email protected]@@ -10504,15 +10504,15 @@ paths:discounts: []fees: []items:- - id: li_eH46l8wVqS- variant_id: variant_P28NMcnNFW+ - id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJseller_id:preorder: falsepreorder_ships_at:quantity: 1currency: USD- name: Product 1715649- slug: product-1715649+ name: Product 1705649+ slug: product-1705649options_text: ''price: '10.0'display_price: "$10.00"@@ -10536,14 +10536,14 @@ paths:option_values: []digital_links: []fulfillments:- - id: ful_yar3EWPH85+ - id: ful_UkLWZg9DAJnumber: R1001-F1tracking: U10000tracking_url:tracking_carrier:tracking_carrier_name:pickup_point_data:- selected_delivery_rate_id: dr_kQYKT9MVfb+ selected_delivery_rate_id: dr_gbHJdmfrXBcost: '100.0'display_cost: "$100.00"total: '100.0'@@ -10563,11 +10563,11 @@ paths:estimated_delivery_at:delivered_at:items:- - item_id: li_eH46l8wVqS- variant_id: variant_P28NMcnNFW+ - item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJquantity: 1delivery_method:- id: dm_xiBoCpeNMW+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -10576,7 +10576,7 @@ paths:pickup: falsepickup_point: falsestock_location:- id: sloc_chYuasQi8r+ id: sloc_UkLWZg9DAJname: Kali Pacochaaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -10588,8 +10588,8 @@ paths:pickup_ready_in_minutes:pickup_instructions:delivery_rates:- - id: dr_kQYKT9MVfb- delivery_method_id: dm_xiBoCpeNMW+ - id: dr_gbHJdmfrXB+ delivery_method_id: dm_UkLWZg9DAJname: UPS Groundselected: truecost: '10.0'@@ -10606,7 +10606,7 @@ paths:display_included_tax_total: "$0.00"display_tax_total: "$0.00"delivery_method:- id: dm_xiBoCpeNMW+ id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDestimated_transit_business_days_min:@@ -10616,7 +10616,7 @@ paths:pickup_point: falsepayments: []billing_address:- id: addr_eXJ6l8wVqS+ id: addr_EfhxLZ9ck8label:first_name: Johnlast_name: Doe@@ -10638,7 +10638,7 @@ paths:country_iso: USstate_name: New Yorkshipping_address:- id: addr_sg48jaGony+ id: addr_VqXmZF31wYlabel:first_name: Johnlast_name: Doe@@ -10711,10 +10711,10 @@ paths:content:application/json:example:- id: cinv_gbHJdmfrXB+ id: cinv_UkLWZg9DAJemail: [email protected]expires_at: '2026-02-14T12:00:00.000Z'- company_id: comp_M2nyloHRUQ+ company_id: comp_UkLWZg9DAJstatus: pendingcompany_name: Acme Industrialstore_name: Spree Test Store@@ -10774,9 +10774,9 @@ paths:content:application/json:example:- id: cmem_HOVtlDrOmL- company_id: comp_prklVeMgbn- customer_id: cust_vlBmzDoNU0+ id: cmem_UkLWZg9DAJ+ company_id: comp_UkLWZg9DAJ+ customer_id: cust_UkLWZg9DAJemail: [email protected]requestBody:content:@@ -10838,7 +10838,7 @@ paths:application/json:example:data:- - id: dm_kQJKT9MVfb+ - id: dm_gbHJdmfrXBname: Store pickupcode: PICKUPestimated_transit_business_days_min:@@ -10905,7 +10905,7 @@ paths:application/json:example:data:- - id: sloc_gZnHJdmfrX+ - id: sloc_UkLWZg9DAJname: Downtownaddress1: 1600 Pennsylvania Ave NWcity: Washington@@ -11019,7 +11019,7 @@ paths:application/json:example:data:- - id: sel_Q8DA48cIW7+ - id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''@@ -11099,7 +11099,7 @@ paths:content:application/json:example:- id: sel_4aROlu6p4z+ id: sel_UkLWZg9DAJname: Sparks Audioslug: sparks-audioabout: ''diff --git a/docs/plans/6.0-admin-api.md b/docs/plans/6.0-admin-api.mdindex f0d203d41f..25fde0796b 100644--- a/docs/plans/6.0-admin-api.md+++ b/docs/plans/6.0-admin-api.md@@ -26,6 +26,7 @@ A new REST API namespace (`/api/v3/admin/*`) that exposes every admin resource a- **Max 2 levels of nesting** — e.g., `/orders/:id/line_items/:id` is fine, `/orders/:id/shipments/:id/rates/:id` is not. Flatten with filter params when necessary.- **Attachments via multipart/form-data** — ActiveStorage underneath. Product images use `Spree::Asset` (ActiveStorage + alt text + ordering + variant scoping).- **Typelizer generates TypeScript types after every serializer change** — part of the PR checklist; never merge a serializer change without regenerating.+- **One nested products surface for every product-curating parent** (2026-08-28). Categories, collections, catalogs and price lists all expose the same protocol through the `:product_membership` routing concern + `Spree::Api::V3::Admin::ProductMembership` controller concern: `GET /{parents}/:id/products` (paginated members), `POST …/products` with `{ product_ids: [] }` → `{ added_count }`, `DELETE …/products` with `{ product_ids: [] }` → `{ removed_count }` — both writes bulk by design, counts reporting what actually changed. Per-member `PATCH …/products/:id/reposition` only where membership carries a manual order (categories, collections). A new parent that curates products joins this concern rather than inventing its own shape; membership never rides the parent's own PATCH payload (the price list `product_ids` array did and was retired). The SDK mirrors it via one `productMembership` builder (`client.<parents>.products`). The dashboard binds it through ONE card (`DeferredProductMembershipCard`, over the headless `ProductMembershipList` in `@spree/dashboard-ui`): membership is never written on click on any of the four — the picker and the row `x` stage into the parent's form via `ProductMembershipStagingProvider` (a real RHF field, so Save/Discard, `isDirty` and the unsaved-changes guards govern it), and the page's Save flushes it. Removals therefore carry no confirm — Save is the confirmation — and a staged removal restores in one click. Drag-to-reorder is the one exception and still persists on drop, disabled while anything is staged. The product-side bulk actions (`POST /products/bulk_add_to_categories`, …) are a different axis (N products × M parents, the products-table bulk bar) and deliberately remain.## Design Detailsdiff --git a/docs/plans/6.0-b2b-companies-and-catalogs.md b/docs/plans/6.0-b2b-companies-and-catalogs.mdindex 42ec74bf8c..7a730b41ff 100644--- a/docs/plans/6.0-b2b-companies-and-catalogs.md+++ b/docs/plans/6.0-b2b-companies-and-catalogs.md@@ -322,14 +322,24 @@ becomes:### Catalogs (pulled forward from the 6.1 plan)`Spree::Catalog`, `Spree::CatalogProduct`, and `Spree::CatalogAssignment`-ship exactly as the 6.1 plan specified (store-scoped catalog, positioned-product join, polymorphic assignment, `spree_channels.default_catalog_id`)-with these amendments:+ship as the 6.1 plan specified (store-scoped catalog, product join,+polymorphic assignment, `spree_channels.default_catalog_id`) with these+amendments:- **Assignable types: CustomerGroup, Company** (narrowed fromChannel/CustomerGroup/Market/Company on 2026-08-28 — the dropped two werewrite-only; see the amendment in Key Decisions). `CompanyLocation` isgone; a company-node assignment applies to the node's subtree.++- **The product join carries no position.** A catalog decides *what* a buyer+ sees, never the order they see it in — the storefront resolver uses+ `CatalogProduct` purely as a membership filter, and the listing keeps+ whatever sort the shopper chose. The column, `acts_as_list`, the+ `reposition` endpoint and the dashboard's drag handle are all removed; the+ admin lists an assortment by name. (`Catalog#position` is unaffected — it+ still breaks ties when several catalogs apply to one buyer.) Category and+ collection membership stays positioned, because those *do* drive storefront+ display order.- **Effective catalogs for a purchase node** = union of assignments on`self_and_ancestors`. The parent assigns the group-wide catalog once; abranch adds its own extra catalog without re-assigning the shared one.diff --git a/packages/admin-sdk/examples/price-lists/create.ts b/packages/admin-sdk/examples/price-lists/create.tsindex 160d0400ea..6f0b3f5b63 100644--- a/packages/admin-sdk/examples/price-lists/create.ts+++ b/packages/admin-sdk/examples/price-lists/create.ts@@ -9,8 +9,8 @@ const client = createAdminClient({// Server-to-server one-shot create. Ship the rules that gate the list// and the exact per-variant prices in a single request — variants in// `prices` implicitly become part of the list (upserted on the unique-// key `(variant_id, currency, price_list_id)`), so there's no need to-// pre-declare `product_ids` separately.+// key `(variant_id, currency, price_list_id)`). Curating whole products+// goes through `client.priceLists.products` instead.const priceList = await client.priceLists.create({name: 'EU wholesale',description: 'Tiered pricing for verified B2B customers',diff --git a/packages/admin-sdk/src/admin-client.ts b/packages/admin-sdk/src/admin-client.tsindex 172d133d1b..20031e0766 100644--- a/packages/admin-sdk/src/admin-client.ts+++ b/packages/admin-sdk/src/admin-client.ts@@ -103,7 +103,6 @@ import type {CatalogAssignParams,CatalogParams,CategoryCreateParams,- CategoryProductRepositionParams,CategoryRepositionParams,CategoryUpdateParams,ChannelCreateParams,@@ -112,7 +111,6 @@ import type {ClaimResolveParams,ClaimUpdateParams,CollectionCreateParams,- CollectionProductRepositionParams,CollectionUpdateParams,CommissionRateCreateParams,CommissionRateUpdateParams,@@ -195,6 +193,7 @@ import type {PriceListUpdateParams,PriceUpdateParams,ProductCreateParams,+ ProductMembershipRepositionParams,ProductTypeApplyToProductsResponse,ProductTypeCreateParams,ProductTypeUpdateParams,@@ -460,6 +459,72 @@ export class AdminClient {}}+ /**+ * The uniform nested products surface every product-curating parent+ * exposes — categories, collections, catalogs and price lists all speak+ * the same protocol. Both writes are bulk: one request adds or removes+ * any number of products, and the counts report what actually changed+ * (already-present ids don't fail an add, non-members don't fail a+ * remove).+ */+ private productMembership(basePath: string) {+ return {+ list: (+ parentId: string,+ params?: ListParams & Record<string, unknown>,+ options?: RequestOptions,+ ): Promise<PaginatedResponse<Product>> =>+ this.request<PaginatedResponse<Product>>('GET', `${basePath}/${parentId}/products`, {+ ...options,+ params: params ? transformListParams(params) : undefined,+ }),++ /** Bulk-adds products; already-present rows are skipped. */+ create: (+ parentId: string,+ productIds: string[],+ options?: RequestOptions,+ ): Promise<{ added_count: number }> =>+ this.request<{ added_count: number }>('POST', `${basePath}/${parentId}/products`, {+ ...options,+ body: { product_ids: productIds },+ }),++ /** Bulk-removes products; ids that aren't members are ignored. */+ delete: (+ parentId: string,+ productIds: string[],+ options?: RequestOptions,+ ): Promise<{ removed_count: number }> =>+ this.request<{ removed_count: number }>('DELETE', `${basePath}/${parentId}/products`, {+ ...options,+ body: { product_ids: productIds },+ }),+ }+ }++ /**+ * `productMembership` plus per-member reposition, for the parents whose+ * membership carries a manual order (categories, collections).+ */+ private positionedProductMembership(basePath: string) {+ return {+ ...this.productMembership(basePath),++ /** Persists a drag-to-reorder; `new_position` is a 0-based index. */+ reposition: (+ parentId: string,+ productId: string,+ params: ProductMembershipRepositionParams,+ options?: RequestOptions,+ ): Promise<void> =>+ this.request<void>('PATCH', `${basePath}/${parentId}/products/${productId}/reposition`, {+ ...options,+ body: params,+ }),+ }+ }+/*** Generic accessor for any custom-field-bearing resource. Use the* first-class accessors (`client.products.customFields`, etc.) when@@ -2211,6 +2276,11 @@ export class AdminClient {this.request<void>('DELETE', `/price_lists/${id}`, options),/** draft|inactive → active (or → scheduled if `starts_at` is in the future). */+ /** Which products the list prices — the same nested surface categories,+ * collections and catalogs expose. Adding materializes placeholder+ * prices per variant × currency; removing hard-deletes the rows. */+ products: this.productMembership('/price_lists'),+activate: (id: string, options?: RequestOptions): Promise<PriceList> =>this.request<PriceList>('PATCH', `/price_lists/${id}/activate`, options),@@ -3324,43 +3394,7 @@ export class AdminClient {this.request<void>('DELETE', `/catalogs/${id}`, options),/** The catalog's assortment, in the merchant's manual order. */- products: {- list: (- catalogId: string,- params?: ListParams & Record<string, unknown>,- options?: RequestOptions,- ): Promise<PaginatedResponse<Product>> =>- this.request<PaginatedResponse<Product>>('GET', `/catalogs/${catalogId}/products`, {- ...options,- params: params ? transformListParams(params) : undefined,- }),-- /** Bulk-adds products; already-present rows are skipped. */- create: (- catalogId: string,- productIds: string[],- options?: RequestOptions,- ): Promise<{ added_count: number }> =>- this.request<{ added_count: number }>('POST', `/catalogs/${catalogId}/products`, {- ...options,- body: { product_ids: productIds },- }),-- delete: (catalogId: string, productId: string, options?: RequestOptions): Promise<void> =>- this.request<void>('DELETE', `/catalogs/${catalogId}/products/${productId}`, options),-- /** Persists a drag-to-reorder; `new_position` is a 0-based index. */- reposition: (- catalogId: string,- productId: string,- newPosition: number,- options?: RequestOptions,- ): Promise<void> =>- this.request<void>('PATCH', `/catalogs/${catalogId}/products/${productId}/reposition`, {- ...options,- body: { new_position: newPosition },- }),- },+ products: this.productMembership('/catalogs'),/*** Copies the attached price list's products into the assortment.@@ -3838,37 +3872,7 @@ export class AdminClient {this.request<Category>('PATCH', `/categories/${id}/reposition`, { ...options, body: params }),/** Manual product membership + ordering within a category. */- products: {- list: (- categoryId: string,- params?: ListParams & Record<string, unknown>,- options?: RequestOptions,- ): Promise<PaginatedResponse<Product>> =>- this.request<PaginatedResponse<Product>>('GET', `/categories/${categoryId}/products`, {- ...options,- params: params ? transformListParams(params) : undefined,- }),-- add: (categoryId: string, productId: string, options?: RequestOptions): Promise<Product> =>- this.request<Product>('POST', `/categories/${categoryId}/products`, {- ...options,- body: { product_id: productId },- }),-- remove: (categoryId: string, productId: string, options?: RequestOptions): Promise<void> =>- this.request<void>('DELETE', `/categories/${categoryId}/products/${productId}`, options),-- reposition: (- categoryId: string,- productId: string,- params: CategoryProductRepositionParams,- options?: RequestOptions,- ): Promise<void> =>- this.request<void>('PATCH', `/categories/${categoryId}/products/${productId}/reposition`, {- ...options,- body: params,- }),- },+ products: this.positionedProductMembership('/categories'),customFields: this.parentScopedCustomFields(CUSTOM_FIELD_OWNER_PATHS['Spree::Category']),@@ -3922,38 +3926,7 @@ export class AdminClient {* and `reposition` are rejected on an automatic collection, whose members* are materialized from its rules; `list` works on both.*/- products: {- list: (- collectionId: string,- params?: ListParams & Record<string, unknown>,- options?: RequestOptions,- ): Promise<PaginatedResponse<Product>> =>- this.request<PaginatedResponse<Product>>('GET', `/collections/${collectionId}/products`, {- ...options,- params: params ? transformListParams(params) : undefined,- }),-- add: (collectionId: string, productId: string, options?: RequestOptions): Promise<Product> =>- this.request<Product>('POST', `/collections/${collectionId}/products`, {- ...options,- body: { product_id: productId },- }),-- remove: (collectionId: string, productId: string, options?: RequestOptions): Promise<void> =>- this.request<void>('DELETE', `/collections/${collectionId}/products/${productId}`, options),-- reposition: (- collectionId: string,- productId: string,- params: CollectionProductRepositionParams,- options?: RequestOptions,- ): Promise<void> =>- this.request<void>(- 'PATCH',- `/collections/${collectionId}/products/${productId}/reposition`,- { ...options, body: params },- ),- },+ products: this.positionedProductMembership('/collections'),customFields: this.parentScopedCustomFields(CUSTOM_FIELD_OWNER_PATHS['Spree::Collection']),diff --git a/packages/admin-sdk/src/params.ts b/packages/admin-sdk/src/params.tsindex 169a77329c..d4839a0242 100644--- a/packages/admin-sdk/src/params.ts+++ b/packages/admin-sdk/src/params.ts@@ -885,8 +885,8 @@ export interface CategoryRepositionParams {new_position: number}-export interface CategoryProductRepositionParams {- /** 0-based index among the category's products. */+export interface ProductMembershipRepositionParams {+ /** 0-based index among the parent's products. */new_position: number}@@ -981,11 +981,6 @@ export interface CollectionUpdateParams {rules?: CollectionRuleParam[]}-export interface CollectionProductRepositionParams {- /** 0-based index among the collection's products. */- new_position: number-}-export interface VariantOptionPair {name: stringvalue: string@@ -1934,21 +1929,13 @@ export interface PriceListCreateParams {/** `all` — every rule must match. `any` — first match wins. */match_policy?: 'all' | 'any'position?: number- /**- * Admin UI shape. Prefixed product ids to seed the list with —- * placeholder prices (`amount: null`) are inserted for each variant- * × supported currency. The spreadsheet editor then fills them in.- *- * Prefer `prices` for server-to-server use: it lets you create the- * list and ship the exact per-variant amounts in one request.- */- product_ids?: string[]/** Optional nested rules — reconciled on save. */rules?: PriceListRuleDraft[]/**- * Server-to-server alternative to `product_ids`. Each row upserts on+ * Server-to-server shape. Each row upserts on* `(variant_id, currency, price_list_id)`, so variants in this array* implicitly become part of the list with the supplied amount.+ * Curating whole products goes through `client.priceLists.products`.*/prices?: PriceListPriceOverrideParams[]}@@ -1960,19 +1947,12 @@ export interface PriceListUpdateParams {ends_at?: string | nullmatch_policy?: 'all' | 'any'position?: number- /**- * Reconciles list membership: every id in the array is kept (placeholder- * prices created if missing); every id currently in the list but not in- * the array is dropped. Send the desired full set on every update —- * the server diffs it against the current state.- */- product_ids?: string[]rules?: PriceListRuleDraft[]/*** Inline spreadsheet payload. Only ship the rows whose `amount` /* `compare_at_amount` actually changed — the server skips unchanged- * cells, but a smaller body is still nicer. Runs in `after_save` so- * it picks up rows created by `product_ids=` in the same request.+ * cells, but a smaller body is still nicer. Product membership is+ * managed through `client.priceLists.products` instead.*/prices?: PriceListPriceOverrideParams[]}diff --git a/packages/admin-sdk/src/types/generated/PriceList.ts b/packages/admin-sdk/src/types/generated/PriceList.tsindex 027196df24..86c5c11b11 100644--- a/packages/admin-sdk/src/types/generated/PriceList.ts+++ b/packages/admin-sdk/src/types/generated/PriceList.ts@@ -1,4 +1,4 @@-// Typelizer digest 5012bf582847766ab070b84ed78fe3cf+// Typelizer digest 77f42bb7225d6f9a8560ce61bec813df//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {PriceRule} from '@/types'@@ -18,7 +18,6 @@ interface PriceList {currently_active: boolean;products_count: number;prices_count: number;- product_ids: Array<string>;price_rules?: Array<PriceRule>;}diff --git a/packages/admin-sdk/tests/catalogs.test.ts b/packages/admin-sdk/tests/catalogs.test.tsindex 4b2858c1a4..d768caa7d1 100644--- a/packages/admin-sdk/tests/catalogs.test.ts+++ b/packages/admin-sdk/tests/catalogs.test.ts@@ -33,35 +33,27 @@ describe('catalogs', () => {it('manages the assortment through the nested products resource', async () => {let added: Record<string, unknown> | null = null- let repositioned: Record<string, unknown> | null = null- let removed = false+ let removed: Record<string, unknown> | null = nullserver.use(http.post(`${API_PREFIX}/catalogs/cat_abc123/products`, async ({ request }) => {added = (await request.json()) as Record<string, unknown>return HttpResponse.json({ added_count: 2 }, { status: 201 })}),- http.delete(`${API_PREFIX}/catalogs/cat_abc123/products/prod_1`, () => {- removed = true- return new HttpResponse(null, { status: 204 })+ // Removal is bulk too — one DELETE carries every id in the body.+ http.delete(`${API_PREFIX}/catalogs/cat_abc123/products`, async ({ request }) => {+ removed = (await request.json()) as Record<string, unknown>+ return HttpResponse.json({ removed_count: 2 })}),- http.patch(- `${API_PREFIX}/catalogs/cat_abc123/products/prod_1/reposition`,- async ({ request }) => {- repositioned = (await request.json()) as Record<string, unknown>- return new HttpResponse(null, { status: 204 })- },- ),)const client = createTestClient()const result = await client.catalogs.products.create('cat_abc123', ['prod_1', 'prod_2'])- await client.catalogs.products.delete('cat_abc123', 'prod_1')- await client.catalogs.products.reposition('cat_abc123', 'prod_1', 0)+ const removal = await client.catalogs.products.delete('cat_abc123', ['prod_1', 'prod_2'])expect(result.added_count).toBe(2)expect(added).toEqual({ product_ids: ['prod_1', 'prod_2'] })- expect(removed).toBe(true)- expect(repositioned).toEqual({ new_position: 0 })+ expect(removal.removed_count).toBe(2)+ expect(removed).toEqual({ product_ids: ['prod_1', 'prod_2'] })})it('imports the price list products into the assortment', async () => {diff --git a/packages/cli/src/generated/admin-spec.json b/packages/cli/src/generated/admin-spec.jsonindex 9c8238e993..ab295d82f2 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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/auth/setup":{"get":{"summary":"Check first-run setup availability","tags":["Authentication"],"description":"Reports whether first-run setup is still available \u2014 true only while\nthe installation has no admin user. Unauthenticated; the dashboard\nlogin page uses it to offer the setup screen.\n","responses":{"200":{"description":"setup status","content":{"application/json":{}}}}},"post":{"summary":"Complete first-run setup","tags":["Authentication"],"description":"Creates the first admin account and adopts the seeded store, authorized\nby the one-time setup token printed at install time (rotate it with\n`bin/rails spree:setup:token`). Issues a JWT access token and a\nrefresh-token cookie exactly like login. Returns 404 once any admin\nuser exists \u2014 the flow is closed permanently after setup.\n","parameters":[],"responses":{"200":{"description":"setup completed","content":{"application/json":{}}},"404":{"description":"setup not available","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["setup_token","email","password","country_code"],"properties":{"setup_token":{"type":"string","description":"One-time token from the install output."},"email":{"type":"string","format":"email"},"password":{"type":"string"},"password_confirmation":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"store_name":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},"locale":{"type":"string","description":"Storefront locale. Defaults to the country's own language."},"currency":{"type":"string","description":"ISO 4217 currency. Defaults to the country's own currency \u2014 pass one only when the store prices in something else."}}}}}}}},"/api/v3/admin/auth/setup/countries":{"get":{"summary":"List countries for first-run setup","tags":["Authentication"],"description":"Countries the store can be set up in, each with the currency and\nofficial languages derived from it. Unauthenticated, because the setup\nscreen runs before any credential exists. Returns 404 once any admin\nuser exists.\n","responses":{"200":{"description":"countries","content":{"application/json":{}}}}}},"/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 \u2014 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 \u2014 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 \u2014 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 \u2014 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` \u2192 `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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 fetch a single group with `?expand=customers` if you\nneed them inline, or query `/admin/customers?customer_group_id_in=\u2026`\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_\u2026`) \u2014 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 \u2014 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 \u2014 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 \u2014 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_code":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_code":{"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., 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"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"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 / 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"},"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 \u2014 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 \u2014 `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 \u2014 `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 \u2014 `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 \u2014 `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 \u2014 a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource \u2014 `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 \u2014 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 \u2014 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) \u2014 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 \u2014 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' \u2014 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}/purchase_label":{"patch":{"summary":"Buy the shipping label","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Buys the shipping label for a parcel that has not shipped yet \u2014 print it, pack the box, then mark the fulfillment fulfilled. Only delivery methods whose provider produces labels accept this.\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":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/mark_delivered":{"patch":{"summary":"Mark a fulfillment delivered","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the customer received the goods. Only a fulfilled shipment can be marked delivered.\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 delivered","content":{"application/json":{}}},"422":{"description":"fulfillment has not shipped","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When the goods arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification. Defaults to true."}}}}}}}},"/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\u2014 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[status_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[status_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 \u2014 `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 \u2014 `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 \u2014 `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 \u2014 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 \u2014 `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 \u2014 `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 \u2014 `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 \u2014 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 \u2014 `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 \u2014 `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 \u2014 `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 \u2014 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 \u2014 `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 \u2014\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_codes` 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_codes":{"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_codes"]}}}}}},"/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_codes` 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_codes":{"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 \u2014 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 \u2014 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","duty"],"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 \u2014 Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal \u2014 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_code":{"type":"string"},"state_code":{"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_code":{"type":"string"},"state_code":{"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."},"shipping_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"billing_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"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\nSet `notify_customer: true` to send the order cancellation 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 canceled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order cancellation email after canceling."}}}}}}}},"/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 \u2014 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 \u2014 `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 \u2014 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 \u2014 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]=\u2026`,\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)` \u2014\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` \u2014 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_\u2026` 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_\u2026` 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 \u2014 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_levels:` (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_levels":{"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_levels:` (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_levels":{"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"},"422":{"description":"deletion refused by a store rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/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 \u2014\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/policies":{"get":{"summary":"List policies","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's policy documents \u2014 terms of service, privacy\npolicy, returns policy, shipping policy, and any others the merchant\nhas written. Every store is created with the four standard policies,\nnamed but empty.\n\nA marketplace seller's own policies are managed by the seller and are\nnot listed here.\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":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"policies listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Policy"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a policy. `body` accepts HTML and is sanitized before it is\nstored; the stored markup is returned as `body_html`, and `body` reads\nback as plain text.\n\nThe slug is derived from the name when one is not given, and is what\nthe storefront addresses the policy by.\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":"policy created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/policies/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Policy prefixed ID or slug","schema":{"type":"string"}}],"get":{"summary":"Get a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single policy, addressed by prefixed ID or by slug.\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":"policy found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"404":{"description":"policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a policy. `body` accepts HTML and is sanitized before it is stored.\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":"policy updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string"}}}}}}},"delete":{"summary":"Delete a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a policy. The four policies a store is created with can be\ndeleted like any other \u2014 they are conventions, not fixtures.\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":"policy deleted"}}}},"/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* \u2014 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":{"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/tax_rates":{"get":{"summary":"List tax rates","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's tax rates. Rates are the entire configuration of\nthe built-in tax provider: each pairs a tax category with a jurisdiction\n(a country, optionally narrowed to one state) and a percentage, and\ndecides whether the tax is already included in the product price\n(VAT-style) or added on top (US-style).\n\nMarkets using an external tax provider ignore these rows \u2014 that\nprovider carries its own jurisdiction data.\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":"q[included_in_price_true]","in":"query","required":false,"description":"Only rates included in the product price","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a tax rate for the current store. Give either `amount` as a\ndecimal (`0.19`) or `amount_percentage` as a percentage (`19`).\n\nName the jurisdiction with `country_code` (and `state_code` for a\nstate-level rate). Omitting the country makes the rate apply everywhere.\n\nSet `included_in_price` for VAT-style pricing, where the rate is backed\nout of the displayed price rather than added to it.\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":"tax rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Customer-facing rate name, e.g. \"VAT\""},"amount":{"type":"string","description":"Rate as a decimal, e.g. \"0.19\""},"amount_percentage":{"type":"number","description":"Rate as a percentage, e.g. 19"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string","description":"ISO code, e.g. \"DE\". Omit for every country."},"state_code":{"type":"string","description":"State abbreviation within that country, e.g. \"CA\"."}},"required":["name","tax_category_id"]}}},"required":true}}},"/api/v3/admin/tax_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Tax rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a tax rate","tags":["Settings"],"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,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}}},"patch":{"summary":"Update a tax rate","tags":["Settings"],"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,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"string"},"amount_percentage":{"type":"number"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"}}}}},"required":true}},"delete":{"summary":"Delete a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the rate. Tax lines it already produced keep their own rate snapshot.\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":"tax rate deleted"}}}},"/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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014\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_code":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_code":{"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_code":{"type":"string","nullable":true},"state_code":{"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_levels, 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) \u2014 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_levels":{"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_levels, 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_levels":{"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 \u2014 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 \u2014 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 \u2014 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 \u2014 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/catalogs":{"get":{"summary":"List catalogs","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store catalogs \u2014 product assortments with an optional price list, shown to audiences through assignments.\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"}}],"responses":{"200":{"description":"catalogs found","content":{"application/json":{}}}}},"post":{"summary":"Create a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a catalog. Add products and assign audiences (customer group, or company subtree) afterwards.\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":"catalog created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"},"price_list_id":{"type":"string","nullable":true,"description":"Price list pricing this catalog; omit for assortment-only (base prices). A catalog with an empty assortment prices without restricting visibility; import or curate products to make it restrictive."}},"required":["name"]}}}}}},"/api/v3/admin/catalogs/{id}/assign":{"post":{"summary":"Assign a catalog to an audience","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Shows the catalog to an audience. A company assignment covers the node and its whole subtree.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"catalog assigned","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assignable_type":{"type":"string","enum":["customer_group","company"]},"assignable_id":{"type":"string"}},"required":["assignable_type","assignable_id"]}}}}}},"/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 \u2014 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/commission_lines":{"get":{"summary":"List commission lines","tags":["Commission Lines"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What each sale actually earned the marketplace, frozen when the order\nwas placed. A later change to a commission rate never reaches these.\n\n`amount` is the fee charged to the seller and `tax_amount` is the VAT on\nthat fee \u2014 the marketplace's own service to the seller, a supply\nseparate from the sale itself, which is why the two are not folded\ntogether. `total` is their sum.\n\nOne line per commissioned item, plus one per delivery when the rate that\napplied charges shipping too \u2014 read `line_item_id` and `fulfillment_id`\nto tell them apart.\n\nRead-only: correcting a charge is a reversal, not an edit.\n\n\n**Required scope:** `read_commissions` (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[seller_id_eq]","in":"query","required":false,"description":"Filter to one seller","schema":{"type":"string"}},{"name":"q[order_id_eq]","in":"query","required":false,"description":"Filter to one order","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"commission lines found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CommissionLine"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/commission_lines/{id}":{"parameters":[{"name":"id","in":"path","description":"Commission line ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a commission line","tags":["Commission Lines"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_commissions` (for API-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":"commission line found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionLine"}}}},"404":{"description":"commission line not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/commission_rates":{"get":{"summary":"List commission rates","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What the marketplace charges its sellers.\n\nRates are returned in resolution order: the list is walked top-down and\nthe first rate whose targeting matches the sale wins, so the order you\nsee is the precedence. Move a rate with `position` on update.\n\nA rate carrying no rules matches every sale \u2014 `global` says so \u2014 which\nis how a marketplace expresses a single default. Because resolution\nstops at the first match, a global rate makes everything below it\nunreachable, so it belongs at the bottom.\n\n\n**Required scope:** `read_commissions` (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[enabled_eq]","in":"query","required":false,"description":"Filter by whether the rate is in use","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-position`).","schema":{"type":"string"}}],"responses":{"200":{"description":"commission rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets what the marketplace charges, and which sales it applies to.\n\n`rules` is the rate's whole targeting, sent inline. Every rule has to\nhold, and a rule naming several records means any of them \u2014 so\n\"(Cameras OR Audio) AND that seller\" is a category rule holding two ids\nbeside a seller rule holding one. Send no rules to charge every sale.\n\nRule kinds come from `GET /commission_rates/rule_types`, which also\ndescribes the configuration each one takes. A marketplace that adds its\nown kind sees it there without this endpoint changing.\n\n`commission_tax_rate` is VAT on the commission itself \u2014 the\nmarketplace's own service to the seller, a separate supply from the\nsale. Leave it null to let the store's tax engine answer for wherever\nthe seller's business sits.\n\n\n**Required scope:** `write_commissions` (for API-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":"commission rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","kind","value"],"properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true,"description":"Your own identifier for this rate; unique per store."},"enabled":{"type":"boolean"},"position":{"type":"integer","description":"Place in the list. Rates resolve top-down, so 1 is tried first. New rates are created at the top; send this to move one."},"kind":{"type":"string","enum":["percentage","fixed"]},"value":{"type":"string","description":"A percentage (10 = 10%) or a flat amount, per `kind`."},"amounts":{"type":"object","additionalProperties":{"type":"string"},"description":"What a flat fee charges, keyed by currency. A currency with no amount is one this rate does not charge \u2014 those sales fall to the next rate. Ignored for a percentage."},"tax_inclusive":{"type":"boolean","description":"Charge on the price including the customer's VAT. Left off, commission is charged on the seller's net revenue, which is the usual basis where the fee is taxed as its own supply."},"include_shipping":{"type":"boolean","description":"Also charge commission on the seller's delivery revenue."},"bounds":{"type":"object","additionalProperties":{"type":"object","properties":{"min_amount":{"type":"string","nullable":true},"max_amount":{"type":"string","nullable":true}}},"description":"The floor and cap a percentage charges within, keyed by currency. Each holds only in its own currency; a sale in a currency with no bounds is charged unbounded."},"commission_tax_rate":{"type":"string","nullable":true,"description":"A fraction, not a percentage. Null asks the tax engine."},"rules":{"type":"array","description":"The full targeting; what you send replaces what the rate holds.","items":{"type":"object","properties":{"id":{"type":"string","description":"Present for an existing rule; omit to create one."},"type":{"type":"string","description":"A kind from /commission_rates/rule_types."},"preferences":{"type":"object","description":"Configuration for the kind, per its preference_schema."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For kinds that name products, which are kept outside preferences."}}}}}}}}}}},"/api/v3/admin/commission_rates/rule_types":{"get":{"summary":"List the commission rule kinds","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every rule kind a rate can be narrowed by, with the schema describing\nthe configuration it takes \u2014 so a client builds its editor from what\nthis marketplace has rather than a list hardcoded to match core's.\n\n`association_fields` names any catalog-scale reference a kind keeps\noutside its preferences, so an editor knows to render a picker for it.\n\n\n**Required scope:** `read_commissions` (for API-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":"subject types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preference_schema":{"type":"array","items":{"type":"object"}},"association_fields":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"/api/v3/admin/commission_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Commission rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_commissions` (for API-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":"commission rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}},"404":{"description":"commission rate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Editing a rate changes what the next sale is charged, never what a past\none was: commission lines keep their own snapshot of the rate that\napplied.\n\n\n**Required scope:** `write_commissions` (for API-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":"commission rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"integer"},"value":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"preferences":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Delete a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_commissions` (for API-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":"commission rate deleted"}}}},"/api/v3/admin/companies/{company_id}/memberships":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company members","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the people with standing over this node. Standing covers the node and everything below it in the tree.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"members found","content":{"application/json":{}}}}},"post":{"summary":"Add a member by email","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a person to the node by email. An email matching an existing customer becomes a\nmembership immediately (a `cmem_\u2026` id); an unknown email becomes an invitation\n(a `cinv_\u2026` id) and the invite email goes out.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"member added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_email":{"type":"string"}},"required":["customer_email"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List tax exemption certificates","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a business's exemption evidence. `active` is the field that decides whether a certificate\nexempts a sale: a verified certificate stops counting once its expiry date passes, so the status\nalone does not answer it.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"certificates found","content":{"application/json":{}}}}},"post":{"summary":"Create a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records exemption evidence against a business. Certificates start `pending` and exempt nothing\nuntil verified.\n\n`country_code` and `state_code` say where the certificate holds \u2014 omit both for one valid\neverywhere, give only the country for one valid throughout it. `document` takes an ActiveStorage\nsigned blob id obtained from `POST /api/v3/admin/direct_uploads`.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"certificate created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"certificate_number":{"type":"string"},"reason_code":{"type":"string","description":"Becomes the tax provider's entity use code."},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"issuing_authority":{"type":"string","nullable":true},"document":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."}},"required":["certificate_number","reason_code"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/verify":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Verify a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts the certificate as evidence, which is what makes it exempt sales. Only a pending\ncertificate can be accepted \u2014 re-accepting a revoked one would restore evidence that was\ndeliberately withdrawn. An installation that checks numbers against a registry, or requires a\nsecond approval, can refuse here, and the refusal is returned as a validation error.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate verified","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/revoke":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Revoke a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws accepted evidence. A verified certificate cannot be deleted \u2014 how a sale was taxed has to remain explainable \u2014 so revoking is the way out.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate revoked","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/download":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download a certificate document","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the uploaded document. Deliberately not a storage link: the bytes come through the API so\nthe same credentials apply to every read of a confidential document. Requires only read access.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"document streamed","content":{"application/json":{}}},"422":{"description":"no document attached","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company tax registrations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's tax registrations, one per kind. A business registration takes precedence\nover the buyer's own when a sale is for that business, because the invoice is addressed to the\nentity rather than the person who placed the order.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"registrations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registers a tax number against the business. Verification against the relevant registry runs in\nthe background where a validator is installed for the kind; a stock installation registers none,\nleaving the status unattempted.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"registration created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","description":"The regime the number belongs to."},"value":{"type":"string"}},"required":["kind","value"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers/{id}/validate":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Re-check a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the registry again. Manual because a registry answers only \"valid now\" \u2014 a number verified\nlast year may have been deregistered since \u2014 and because a check that came back unavailable\ncannot otherwise be retried without editing the number.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"422":{"description":"no validator installed for this kind","content":{"application/json":{}}}}}},"/api/v3/admin/companies":{"get":{"summary":"List companies","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business customers of the current store.\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"}}],"responses":{"200":{"description":"companies found","content":{"application/json":{}}}}},"post":{"summary":"Create a company","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a company node. A root node is a legal entity; pass parent_id and kind to build the organization tree. Exemption certificates and tax registrations hang off legal-entity nodes.\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":"company created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["company","division"],"description":"company = legal entity (may hold tax registrations), division = organizational unit. Roots must be company."},"parent_id":{"type":"string","nullable":true,"description":"The parent node. Omit for a root."},"external_references":{"type":"array","description":"Identities this business has in your own systems. A system you do not name keeps the reference it already has, and creating with a reference that already exists updates that business instead.","items":{"type":"object","properties":{"system":{"type":"string"},"external_id":{"type":"string"}},"required":["system","external_id"]}}},"required":["name"]}}}}}},"/api/v3/admin/custom_field_definitions/resource_types":{"get":{"summary":"List what custom fields can be attached to","tags":["Custom Field Definitions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The resources a definition can describe, from the server's own\nregistry (`Spree.custom_fields.enabled_resources`).\n\nRead this rather than carrying a list: a resource an extension\nregisters appears here without a client release, and a `resource_type`\nthat is not listed is refused on create.\n\n`resource_type` is the value to send; `name` is what a merchant calls\nit. The two differ where a class has been renamed \u2014 categories are\nstored under `Spree::Taxon` and shown as \"Categories\" \u2014 so send the\nvalue back verbatim rather than deriving it from the name.\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"}}],"responses":{"200":{"description":"resource types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"resource_type":{"type":"string"},"name":{"type":"string"}}}}}}}}}}}},"/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 \u2014 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_code":{"type":"string","nullable":true},"state_code":{"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 \u2014 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 seller 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/media":{"get":{"summary":"List media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every file in the store's media library, whether or not it has\nbeen placed on a product. Filter with `q[unattached]=true` for files not\nyet in use, `q[media_type_eq]` for images or video, and\n`q[filename_cont]` to search by file name.\n\n\n**Required scope:** `read_media` (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":"media found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Upload a file to the library","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a file to the library without placing it on anything. Upload the\nfile first through the direct-upload endpoint, then send the signed id\nhere. Put the file on a product by posting to that product's media with\nthis record's id as `source_media_id`.\n\n\n**Required scope:** `write_media` (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":"file added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signed_id":{"type":"string","description":"Direct-upload signed id for the file."},"alt":{"type":"string"},"media_type":{"type":"string","enum":["image","video","external_video"]},"external_video_url":{"type":"string","description":"YouTube or Vimeo link, for an external video."}}}}}}}},"/api/v3/admin/media/{id}/usage":{"parameters":[{"name":"id","in":"path","description":"Media ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Where a file is used","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lists everywhere this file appears: products it is placed on, image\nfields that picked it, and descriptions embedding it. Reusing a file\nshares it rather than copying it, so deleting one placement can leave\nothers pointing at the same file \u2014 check this first.\n\nDescription matches are best-effort: an embedded image is a plain URL\nwith nothing recording it, so treat an empty result as \"nothing found\",\nnot proof the file is unused.\n\n\n**Required scope:** `read_media` (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":"usage found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["media","attachment","rich_text"]},"name":{"type":"string","nullable":true},"owner_type":{"type":"string"},"owner_id":{"type":"string","nullable":true},"field":{"type":"string","nullable":true}}}}}}}}}}}},"/api/v3/admin/products/{product_id}/media":{"parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Place a library file on a product","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Puts a file that is already in the library onto this product. The new\nrecord shares the source's file rather than copying it, so nothing is\nuploaded and no image is reprocessed; it carries its own alt text,\nposition and variant links from here on.\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":"file placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_media_id":{"type":"string","description":"A media record already in the library."},"alt":{"type":"string"},"position":{"type":"integer"}},"required":["source_media_id"]}}}}}},"/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 \u2014 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 \u2014 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 \u2014 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"}}}}}}}}},"/api/v3/admin/seller_requirements":{"get":{"summary":"List seller requirements","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What this marketplace asks of a seller before it will let them trade,\nin the order sellers work through it.\n\nEach row is one configured requirement. `required` says whether it\nstands between the seller and approval \u2014 the others are shown as\nrecommended and counted in their progress, but never block. `active`\nswitches one off without losing how it was worded.\n\n\n**Required scope:** `read_sellers` (for API-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":"seller requirements found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerRequirement"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}}}},"post":{"summary":"Add a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds something the marketplace asks of its sellers.\n\n`type` comes from `GET /seller_requirements/types`, which also\ndescribes the configuration each kind takes. Most kinds answer one\nquestion and can be added once; the open-ended ones \u2014 a seller\nconfirmation, a manual check, a document \u2014 carry the question in your\nown `name` and `description`, so a store may add as many as it needs.\n\nA kind that reads the seller's own data (their addresses, their\nproducts, whether they accepted the terms) needs nothing from the\nseller beyond doing it. The others wait for the seller to submit\nsomething, and the ones you review wait for you.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirement"}}}},"422":{"description":"kind is not registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The kind, from `GET /seller_requirements/types`."},"name":{"type":"string","description":"What the seller sees. Required for kinds that can be added more than once, since the wording is the only thing telling them apart. Left blank on the others, the kind names itself."},"description":{"type":"string","description":"Instructions shown to the seller."},"required":{"type":"boolean","description":"Whether this blocks approval. Off means recommended."},"active":{"type":"boolean"},"position":{"type":"integer","description":"Place in the checklist."},"preferences":{"type":"object","description":"Configuration for this kind, per its `preference_schema`."}}}}}}}},"/api/v3/admin/seller_requirements/types":{"get":{"summary":"List seller requirement kinds","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The kinds you can add, and the shape of each one's configuration form.\n\n`configured` says the store already has this kind \u2014 meaningful only\nwhere `allow_multiple` is false. `accepts_submissions` says the seller\nrecords having done it rather than it being read from their data, and\n`reviewed_by_operator` says what they send waits for you.\n\nA marketplace that registers its own kind server-side sees it here\nwithout this endpoint changing.\n\n\n**Required scope:** `read_sellers` (for API-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":"kinds found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"allow_multiple":{"type":"boolean"},"accepts_submissions":{"type":"boolean"},"reviewed_by_operator":{"type":"boolean"},"configured":{"type":"boolean"},"addable":{"type":"boolean","description":"Whether the operator may add one now. The uniqueness rule is the server's, so clients filter on this rather than deriving it."},"preference_schema":{"type":"array","items":{"type":"object"}}}}}}}}}}}}},"/api/v3/admin/seller_requirements/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes how a requirement is worded, what it asks for, where it sits in\nthe checklist, and whether it blocks approval.\n\n`type` is not accepted: a saved row's kind never changes, because\nanything a seller already submitted answered the old one.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirement"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object"}}}}}}},"delete":{"summary":"Delete a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stops asking for this. Anything sellers already submitted against it\ngoes too \u2014 to keep the record while pausing the ask, set `active` to\nfalse instead.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement deleted"}}}},"/api/v3/admin/sellers":{"get":{"summary":"List sellers","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the sellers on this marketplace. `status` says where each one\nis in its life on the marketplace, and `sellable` answers the question\nthe status alone cannot: an approved seller who is away cannot be\nbought from either.\n\n\n**Required scope:** `read_sellers` (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[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"sellers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Seller"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens a seller record. The seller starts as `pending` and has no team\nyet \u2014 invite someone to run it with the `invite` action below.\n\n`status` is deliberately not writable here or on update: every move\nthrough the lifecycle is its own action, because each one does more\nthan set a column.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"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"},"slug":{"type":"string","description":"Derived from the name when omitted."},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"about":{"type":"string","nullable":true},"tax_remittance":{"type":"string","enum":["seller","platform"]},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/sellers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single seller, including its settlement and tax configuration.\n\n**Required scope:** `read_sellers` (for API-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":"seller found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"404":{"description":"seller not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the seller's profile and the settlement configuration the\noperator owns. A `status` sent here is ignored \u2014 use the lifecycle\nactions.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller address written inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"billing_email":{"type":"string","nullable":true},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"holiday_mode_until":{"type":"string","format":"date-time","nullable":true},"logo":{"type":"string","nullable":true,"description":"ActiveStorage signed id of a direct-uploaded file. Send `null` to remove the attachment, or omit the key to leave it alone. Same for `square_logo` and `cover_photo`."},"square_logo":{"type":"string","nullable":true},"cover_photo":{"type":"string","nullable":true},"billing_address":{"type":"object","description":"The seller's own address, written inline. There is no `billing_address_id` \u2014 an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}},"returns_address":{"type":"object","description":"The seller's own address, written inline. There is no `billing_address_id` \u2014 an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}}}}}}}},"delete":{"summary":"Delete a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the seller. Their products are kept and left without a\nseller rather than deleted \u2014 what happens to a departed seller's\ncatalog is the operator's decision.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller deleted"}}}},"/api/v3/admin/sellers/{id}/invite":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"post":{"summary":"Invite someone to run a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sends an invitation to the seller's own team and moves the seller to\n`invited`. The person becomes a member when they accept, and can then\nsign in to the seller panel.\n\n`role_id` must name a role this seller owns; omit it for the seller's\nown admin role. Re-inviting is allowed \u2014 an invitation expires, or the\nfirst one goes to the wrong address.\n\n\n**Required scope:** `write_sellers` (for API-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 sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"role_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/sellers/{id}/approve":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Approve a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lets the seller sell. This is also the way back for one that was\nsuspended or turned down, and it clears any holiday along with the\nsuspension.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"422":{"description":"seller cannot be approved from its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{id}/suspend":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Suspend a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stops a trading seller from selling. Their catalog and history stay,\nand approving reinstates them. Use this rather than `reject` for a\nseller already on the marketplace \u2014 it says something different, and\nit can be undone.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/sellers/{id}/reject":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Reject a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down an applicant who never traded. A seller already selling is\nsuspended instead; rejecting one is refused.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/stock_levels/bulk_upsert":{"post":{"summary":"Bulk-upsert stock levels","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets stock levels for many (variant, location) pairs at once \u2014 what a\nwarehouse or ERP feed posts on a schedule.\n\nEach row names its variant and stock location by Spree id\n(`variant_id`, `stock_location_id`).\n\nA row carries either `count_on_hand` \u2014 the absolute level the external\nsystem reports \u2014 or `adjustment`, a relative change for feeds that\nreport movements instead. Every change is written as a stock movement,\nso a merchant can still see why a figure moved.\n\nThe response carries `stock_level_count`: how many rows moved a shelf.\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,"schema":{"type":"string"}}],"responses":{"200":{"description":"stock levels updated","content":{"application/json":{}}},"422":{"description":"row is missing a level","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_levels"],"properties":{"stock_levels":{"type":"array","items":{"type":"object","required":["variant_id","stock_location_id"],"properties":{"variant_id":{"type":"string"},"stock_location_id":{"type":"string"},"count_on_hand":{"type":"integer","nullable":true},"adjustment":{"type":"integer","nullable":true},"backorderable":{"type":"boolean","nullable":true}}}}}}}}}}},"/api/v3/admin/stock_movements":{"get":{"summary":"List stock movements","tags":["Stock Movements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the stock ledger, newest first. Every row says what happened to\nstock (`kind`) and carries a direct reference to what caused it, so a\nmerchant can answer \"why is this number what it is?\" from the data.\n\nKinds are `received` (goods arrived), `allocated` (stock promised to a\nplaced order), `shipped` (promised stock left), `released` (a promise\nwithdrawn) and `adjusted` (a manual correction, which always carries a\n`reason`).\n\nMovements are immutable \u2014 reversing one means writing its counterpart\nthrough the resource that caused it, which is why there is no create,\nupdate or delete here.\n\nFilter with Ransack predicates such as `q[kind_eq]`,\n`q[stock_level_id_eq]`, `q[order_id_eq]`, `q[fulfillment_id_eq]` or\n`q[created_at_gteq]`.\n\n`kind` is null on rows written before Spree 6.0 until\n`spree:migrate_stock_movements_to_typed_rows` has run.\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[kind_eq]","in":"query","required":false,"description":"Filter by kind ('received', 'allocated', 'shipped', 'released', 'adjusted')","schema":{"type":"string"}},{"name":"q[stock_level_id_eq]","in":"query","required":false,"description":"Filter by stock level, e.g. sl_1234567890","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 movements found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockMovement"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/stock_movements/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock movement ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock movement","tags":["Stock Movements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock movement 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 movement found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMovement"}}}},"404":{"description":"stock movement not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"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"]},"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)"},"item_index":{"type":"integer","nullable":true,"description":"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},"required":["code","message"]},"FulfillmentManifestItem":{"type":"object","description":"An item within a fulfillment \u2014 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 \u2014 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 \u2014 the variant added to the order and how many","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"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"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"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_code":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_abbr":{"type":"string","nullable":true},"country_iso":{"type":"string"},"state_name":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"customer_id":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"owner_type":{"type":"string","nullable":true}},"required":["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"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},"company_id":{"type":"string","nullable":true},"company_name":{"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},"fee_total":{"type":"string","nullable":true},"display_fee_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","company_id","company_name","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","fee_total","display_fee_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},"CatalogAssignment":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"catalog_id":{"type":"string"},"assignable_type":{"type":"string"},"assignable_id":{"type":"string"},"assignable_name":{"type":"string","nullable":true}},"required":["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":true},"Catalog":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"number","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"products_count":{"type":"number"},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/CatalogAssignment"}}},"required":["id","name","active","position","metadata","created_at","updated_at","price_list_id","products_count"],"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"}},"external_references":{"type":"object"},"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","external_references","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"}},"default_catalog_id":{"type":"string","nullable":true}},"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","default_catalog_id"],"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},"CommissionLine":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"currency":{"type":"string"},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rate":{"type":"string"},"tax_rate":{"type":"string"},"amount":{"type":"string"},"tax_amount":{"type":"string"},"total":{"type":"string"},"display_amount":{"type":"string"},"display_tax_amount":{"type":"string"},"display_total":{"type":"string"},"order_id":{"type":"string"},"seller_id":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"commission_rate_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true}},"required":["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":true},"CommissionRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"position":{"type":"number"},"kind":{"type":"string"},"tax_inclusive":{"type":"boolean"},"include_shipping":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"},"commission_tax_rate":{"type":"string","nullable":true},"amounts":{"type":"object"},"bounds":{"type":"object"},"global":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRule"}}},"required":["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":true},"CommissionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"commission_rate_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema","label","description"],"x-typelizer":true},"CompanyInvitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"expires_at":{"type":"string","nullable":true},"company_id":{"type":"string"},"status":{"type":"string"},"accepted_at":{"type":"string","nullable":true},"revoked_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":true},"CompanyMembership":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"customer_id":{"type":"string"},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":true},"Company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"parent_id":{"type":"string","nullable":true},"ancestors":{"type":"object"},"external_references":{"type":"object"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"children_count":{"type":"number"},"members_count":{"type":"number"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/CompanyMembership"}}},"required":["id","name","kind","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"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}},"required":["iso","iso3","name","states_required","zipcode_required"],"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"},"country_code":{"type":"string","nullable":true},"state_code":{"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},"country_name":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","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},"DigitalAsset":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"authorized_clicks":{"type":"number","nullable":true},"authorized_days":{"type":"number","nullable":true},"byte_size":{"type":"number","nullable":true},"provider_type":{"type":"string","nullable":true},"provider_settings":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"provider_name":{"type":"string"},"download_url":{"type":"string","nullable":true},"effective_authorized_clicks":{"type":"number"},"effective_authorized_days":{"type":"number"}},"required":["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_type","provider_settings","created_at","updated_at","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"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"},"expires_at":{"type":"string","nullable":true},"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","expires_at","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"},"store_id":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"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","store_id","seller_id","seller_name","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},"tracking_carrier":{"type":"string","nullable":true},"tracking_carrier_name":{"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},"tracking_status":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_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"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"tracking_details":{"type":"object","nullable":true},"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},"documents":{"type":"object"},"provider_generates_labels":{"type":"boolean"},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","tracking_carrier","tracking_carrier_name","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","tracking_status","estimated_delivery_at","delivered_at","items","metadata","tracking_details","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","provider_generates_labels"],"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"},"store_id":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"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"},"seller_name":{"type":"string","nullable":true},"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","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","seller_name","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"},"seller_id":{"type":"string","nullable":true},"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},"seller":{"$ref":"#/components/schemas/Seller"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"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","seller_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_codes":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"tax_provider":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","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},"video_provider":{"type":"string","nullable":true},"video_embed_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"poster_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},"external_references":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"attached":{"type":"boolean"},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"embed_url":{"type":"string","nullable":true},"signed_id":{"type":"string","nullable":true},"viewable_id":{"type":"string","nullable":true},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string","nullable":true}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","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},"OrderGroup":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"email":{"type":"string","nullable":true},"currency":{"type":"string"},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"seller_count":{"type":"number"},"includes_first_party":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}},"required":["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","created_at","updated_at","payments"],"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},"company_id":{"type":"string","nullable":true},"company_name":{"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"},"fee_total":{"type":"string"},"display_fee_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},"external_references":{"type":"object"},"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"order_group_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","company_id","company_name","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","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","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","seller_id","order_group_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},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"nullable":true},"resolved_capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"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","capture_method","resolved_capture_method","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"},"status":{"type":"string"},"amount":{"type":"string"},"display_amount":{"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","status","amount","display_amount","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},"Policy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string","nullable":true},"body_html":{"type":"string","nullable":true},"updated_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","name","slug","body","body_html","updated_at","created_at"],"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"},"buy_box_variant_id":{"type":"string","nullable":true},"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"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},"external_references":{"type":"object"},"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},"submission":{"allOf":[{"$ref":"#/components/schemas/ProductSubmission"}],"nullable":true},"seller_name":{"type":"string","nullable":true},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"digital_assets":{"type":"array","items":{"$ref":"#/components/schemas/DigitalAsset"}},"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","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":true},"ProductSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"review_note":{"type":"string","nullable":true},"reviewed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"product_id":{"type":"string"},"metadata":{"type":"object","nullable":true},"updated_at":{"type":"string"},"submitted_by_id":{"type":"string","nullable":true},"reviewed_by_id":{"type":"string","nullable":true},"reviewed_by_name":{"type":"string","nullable":true},"auto_approved":{"type":"boolean"}},"required":["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"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},"SellerRequirement":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"required":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preferences":{"type":"object"},"custom_field_definition_ids":{"type":"array","items":{"type":"string"}},"allow_multiple":{"type":"boolean"},"accepts_submissions":{"type":"boolean"},"reviewed_by_operator":{"type":"boolean"}},"required":["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":true},"SellerRequirementStatus":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"position":{"type":"number"},"status":{"type":"string"},"action_url":{"type":"string","nullable":true},"blocking":{"type":"boolean"},"required_policy_name":{"type":"string","nullable":true},"submission":{"$ref":"#/components/schemas/SellerRequirementSubmission"},"published_policy":{"$ref":"#/components/schemas/Policy"}},"required":["id","kind","name","description","required","position","status","action_url","blocking","required_policy_name"],"x-typelizer":true},"SellerRequirementSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"note":{"type":"string","nullable":true},"review_note":{"type":"string","nullable":true},"reference":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"reviewed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"seller_id":{"type":"string"},"requirement_id":{"type":"string"},"requirement_name":{"type":"string"},"file_url":{"type":"string","nullable":true},"file_name":{"type":"string","nullable":true}},"required":["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":true},"Seller":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"about":{"type":"string"},"about_html":{"type":"string"},"logo_url":{"type":"string","nullable":true},"square_logo_url":{"type":"string","nullable":true},"cover_photo_url":{"type":"string","nullable":true},"status":{"type":"string"},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"tax_remittance":{"type":"string"},"payouts_schedule_interval":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"holiday_mode_until":{"type":"string","nullable":true},"terms_accepted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"on_holiday":{"type":"boolean"},"sellable":{"type":"boolean"},"products_count":{"type":"number"},"users_count":{"type":"number"},"onboarding_progress":{"type":"object"},"onboarding_complete":{"type":"boolean"},"legal_name":{"type":"string","nullable":true},"registration_number":{"type":"string","nullable":true},"billing_address":{"$ref":"#/components/schemas/Address"},"returns_address":{"$ref":"#/components/schemas/Address"}},"required":["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":true},"SellerTeamMember":{"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},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true}},"required":["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"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"}},"required":["abbr","name"],"x-typelizer":true},"StockLevel":{"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},"external_references":{"type":"object"},"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","external_references","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"external_references":{"type":"object"},"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"},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"}},"required":["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","created_at","updated_at","seller_id","seller_name"],"x-typelizer":true},"StockMovement":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"kind":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_level_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"return_id":{"type":"string","nullable":true},"exchange_id":{"type":"string","nullable":true},"stock_transfer_id":{"type":"string","nullable":true}},"required":["id","quantity","kind","reason","created_at","updated_at","stock_level_id","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_level_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_level_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},"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}},"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"],"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_company_field_enabled":{"type":"boolean"},"preferred_address_requires_company":{"type":"boolean"},"preferred_address_requires_phone":{"type":"boolean"},"preferred_capture_method":{"type":"string"},"preferred_track_inventory_levels":{"type":"boolean"},"preferred_stock_reservations_enabled":{"type":"boolean"},"preferred_tax_using_ship_address":{"type":"boolean"},"preferred_track_price_history":{"type":"boolean"},"preferred_show_products_without_price":{"type":"boolean"},"preferred_disable_sku_validation":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"preferred_pricing_provider":{"type":"string"},"preferred_inventory_provider":{"type":"string"},"preferred_pricing_provider_failure_policy":{"type":"string"},"preferred_inventory_provider_failure_policy":{"type":"string"},"preferred_document_number_format":{"type":"string"},"preferred_order_number_prefix":{"type":"string"},"preferred_order_number_suffix":{"type":"string"},"preferred_order_number_sequence_start":{"type":"number"},"preferred_limit_digital_download_count":{"type":"boolean"},"preferred_digital_asset_authorized_clicks":{"type":"number"},"preferred_limit_digital_download_days":{"type":"boolean"},"preferred_digital_asset_authorized_days":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_number_sequence_started":{"type":"boolean"},"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_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","order_number_sequence_started","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},"TaxExemptionCertificate":{"type":"object","properties":{"id":{"type":"string"},"certificate_number":{"type":"string"},"reason_code":{"type":"string"},"status":{"type":"string"},"issuing_authority":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"active":{"type":"boolean"},"lapsed":{"type":"boolean"},"can_be_deleted":{"type":"boolean"},"document_filename":{"type":"string","nullable":true},"document_byte_size":{"type":"number","nullable":true},"document_url":{"type":"string","nullable":true}},"required":["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":true},"TaxIdentifier":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true},"validated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"validatable":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true}},"required":["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"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},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"data":{"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","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":true},"TaxRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"amount":{"type":"string"},"amount_percentage":{"type":"number","nullable":true},"tax_category_id":{"type":"string","nullable":true},"store_id":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true}},"required":["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"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},"external_references":{"type":"object"},"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},"hs_code":{"type":"string","nullable":true},"country_of_origin":{"type":"string","nullable":true},"customs_description":{"type":"string","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"},"delivery_profile_id":{"type":"string","nullable":true},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevel"}}},"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","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","hs_code","country_of_origin","customs_description","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"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/auth/setup":{"get":{"summary":"Check first-run setup availability","tags":["Authentication"],"description":"Reports whether first-run setup is still available — true only while\nthe installation has no admin user. Unauthenticated; the dashboard\nlogin page uses it to offer the setup screen.\n","responses":{"200":{"description":"setup status","content":{"application/json":{}}}}},"post":{"summary":"Complete first-run setup","tags":["Authentication"],"description":"Creates the first admin account and adopts the seeded store, authorized\nby the one-time setup token printed at install time (rotate it with\n`bin/rails spree:setup:token`). Issues a JWT access token and a\nrefresh-token cookie exactly like login. Returns 404 once any admin\nuser exists — the flow is closed permanently after setup.\n","parameters":[],"responses":{"200":{"description":"setup completed","content":{"application/json":{}}},"404":{"description":"setup not available","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["setup_token","email","password","country_code"],"properties":{"setup_token":{"type":"string","description":"One-time token from the install output."},"email":{"type":"string","format":"email"},"password":{"type":"string"},"password_confirmation":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"store_name":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country the store sells from. Determines the default market, the warehouse, the delivery zones and the currency."},"locale":{"type":"string","description":"Storefront locale. Defaults to the country's own language."},"currency":{"type":"string","description":"ISO 4217 currency. Defaults to the country's own currency — pass one only when the store prices in something else."}}}}}}}},"/api/v3/admin/auth/setup/countries":{"get":{"summary":"List countries for first-run setup","tags":["Authentication"],"description":"Countries the store can be set up in, each with the currency and\nofficial languages derived from it. Unauthenticated, because the setup\nscreen runs before any credential exists. Returns 404 once any admin\nuser exists.\n","responses":{"200":{"description":"countries","content":{"application/json":{}}}}}},"/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 products to a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Classifies products under the category in bulk (appended to the end). Already-classified products are skipped; the count reports what was added.\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":"products added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}},"delete":{"summary":"Remove products from a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes products from the category's manual classification in bulk. Ids that are not classified are ignored; the count reports what was removed.\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":{"200":{"description":"products removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}}},"/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_code":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_code":{"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., 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"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"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 / 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"},"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}/purchase_label":{"patch":{"summary":"Buy the shipping label","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Buys the shipping label for a parcel that has not shipped yet — print it, pack the box, then mark the fulfillment fulfilled. Only delivery methods whose provider produces labels accept this.\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":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/mark_delivered":{"patch":{"summary":"Mark a fulfillment delivered","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the customer received the goods. Only a fulfilled shipment can be marked delivered.\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 delivered","content":{"application/json":{}}},"422":{"description":"fulfillment has not shipped","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When the goods arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification. Defaults to true."}}}}}}}},"/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[status_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[status_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_codes` 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_codes":{"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_codes"]}}}}}},"/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_codes` 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_codes":{"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","duty"],"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_code":{"type":"string"},"state_code":{"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_code":{"type":"string"},"state_code":{"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."},"shipping_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"phone":{"type":"string"}}},"billing_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_code":{"type":"string"},"state_code":{"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\nSet `notify_customer: true` to send the order cancellation 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 canceled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order cancellation email after canceling."}}}}}}}},"/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)","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"},"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 shape: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)` — `prices` alone tells the server which variants belong to the list and what the override amount is. Curating whole products goes through the nested `/price_lists/{id}/products` surface instead.","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"},"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_levels:` (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_levels":{"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_levels:` (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_levels":{"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"},"422":{"description":"deletion refused by a store rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/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/policies":{"get":{"summary":"List policies","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's policy documents — terms of service, privacy\npolicy, returns policy, shipping policy, and any others the merchant\nhas written. Every store is created with the four standard policies,\nnamed but empty.\n\nA marketplace seller's own policies are managed by the seller and are\nnot listed here.\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":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"policies listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Policy"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a policy. `body` accepts HTML and is sanitized before it is\nstored; the stored markup is returned as `body_html`, and `body` reads\nback as plain text.\n\nThe slug is derived from the name when one is not given, and is what\nthe storefront addresses the policy by.\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":"policy created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/policies/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Policy prefixed ID or slug","schema":{"type":"string"}}],"get":{"summary":"Get a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single policy, addressed by prefixed ID or by slug.\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":"policy found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"404":{"description":"policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a policy. `body` accepts HTML and is sanitized before it is stored.\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":"policy updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string"}}}}}}},"delete":{"summary":"Delete a policy","tags":["Policies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a policy. The four policies a store is created with can be\ndeleted like any other — they are conventions, not fixtures.\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":"policy deleted"}}}},"/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":{"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/tax_rates":{"get":{"summary":"List tax rates","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's tax rates. Rates are the entire configuration of\nthe built-in tax provider: each pairs a tax category with a jurisdiction\n(a country, optionally narrowed to one state) and a percentage, and\ndecides whether the tax is already included in the product price\n(VAT-style) or added on top (US-style).\n\nMarkets using an external tax provider ignore these rows — that\nprovider carries its own jurisdiction data.\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":"q[included_in_price_true]","in":"query","required":false,"description":"Only rates included in the product price","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a tax rate for the current store. Give either `amount` as a\ndecimal (`0.19`) or `amount_percentage` as a percentage (`19`).\n\nName the jurisdiction with `country_code` (and `state_code` for a\nstate-level rate). Omitting the country makes the rate apply everywhere.\n\nSet `included_in_price` for VAT-style pricing, where the rate is backed\nout of the displayed price rather than added to it.\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":"tax rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Customer-facing rate name, e.g. \"VAT\""},"amount":{"type":"string","description":"Rate as a decimal, e.g. \"0.19\""},"amount_percentage":{"type":"number","description":"Rate as a percentage, e.g. 19"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string","description":"ISO code, e.g. \"DE\". Omit for every country."},"state_code":{"type":"string","description":"State abbreviation within that country, e.g. \"CA\"."}},"required":["name","tax_category_id"]}}},"required":true}}},"/api/v3/admin/tax_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Tax rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a tax rate","tags":["Settings"],"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,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}}},"patch":{"summary":"Update a tax rate","tags":["Settings"],"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,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"tax rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"string"},"amount_percentage":{"type":"number"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"}}}}},"required":true}},"delete":{"summary":"Delete a tax rate","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the rate. Tax lines it already produced keep their own rate snapshot.\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":"tax rate deleted"}}}},"/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_code":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_code":{"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_code":{"type":"string","nullable":true},"state_code":{"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_levels, 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_levels":{"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_levels, 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_levels":{"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/catalogs":{"get":{"summary":"List catalogs","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store catalogs — product assortments with an optional price list, shown to audiences through assignments.\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"}}],"responses":{"200":{"description":"catalogs found","content":{"application/json":{}}}}},"post":{"summary":"Create a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a catalog. Add products and assign audiences (customer group, or company subtree) afterwards.\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":"catalog created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"},"price_list_id":{"type":"string","nullable":true,"description":"Price list pricing this catalog; omit for assortment-only (base prices). A catalog with an empty assortment prices without restricting visibility; import or curate products to make it restrictive."}},"required":["name"]}}}}}},"/api/v3/admin/catalogs/{id}/assign":{"post":{"summary":"Assign a catalog to an audience","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Shows the catalog to an audience. A company assignment covers the node and its whole subtree.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"catalog assigned","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assignable_type":{"type":"string","enum":["customer_group","company"]},"assignable_id":{"type":"string"}},"required":["assignable_type","assignable_id"]}}}}}},"/api/v3/admin/catalogs/{catalog_id}/products":{"get":{"summary":"List catalog products","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The catalog's curated assortment, listed by product name — membership carries no order.\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":"catalog_id","in":"path","required":true,"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 products to a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates products into the assortment in bulk. Already-present products are skipped; the count reports what was added.\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":"catalog_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"products added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}},"delete":{"summary":"Remove products from a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes products from the assortment in bulk. Ids that are not members are ignored; the count reports what was removed.\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":"catalog_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}}},"/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 products to a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates products into the collection in bulk (appended to the end). Already-curated products are skipped; the count reports what was added.\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":"products added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}},"delete":{"summary":"Remove products from a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes products from the collection's manual curation in bulk. Ids that are not curated are ignored; the count reports what was removed.\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":{"200":{"description":"products removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}}},"/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/commission_lines":{"get":{"summary":"List commission lines","tags":["Commission Lines"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What each sale actually earned the marketplace, frozen when the order\nwas placed. A later change to a commission rate never reaches these.\n\n`amount` is the fee charged to the seller and `tax_amount` is the VAT on\nthat fee — the marketplace's own service to the seller, a supply\nseparate from the sale itself, which is why the two are not folded\ntogether. `total` is their sum.\n\nOne line per commissioned item, plus one per delivery when the rate that\napplied charges shipping too — read `line_item_id` and `fulfillment_id`\nto tell them apart.\n\nRead-only: correcting a charge is a reversal, not an edit.\n\n\n**Required scope:** `read_commissions` (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[seller_id_eq]","in":"query","required":false,"description":"Filter to one seller","schema":{"type":"string"}},{"name":"q[order_id_eq]","in":"query","required":false,"description":"Filter to one order","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"commission lines found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CommissionLine"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/commission_lines/{id}":{"parameters":[{"name":"id","in":"path","description":"Commission line ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a commission line","tags":["Commission Lines"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_commissions` (for API-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":"commission line found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionLine"}}}},"404":{"description":"commission line not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/commission_rates":{"get":{"summary":"List commission rates","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What the marketplace charges its sellers.\n\nRates are returned in resolution order: the list is walked top-down and\nthe first rate whose targeting matches the sale wins, so the order you\nsee is the precedence. Move a rate with `position` on update.\n\nA rate carrying no rules matches every sale — `global` says so — which\nis how a marketplace expresses a single default. Because resolution\nstops at the first match, a global rate makes everything below it\nunreachable, so it belongs at the bottom.\n\n\n**Required scope:** `read_commissions` (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[enabled_eq]","in":"query","required":false,"description":"Filter by whether the rate is in use","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-position`).","schema":{"type":"string"}}],"responses":{"200":{"description":"commission rates found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRate"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets what the marketplace charges, and which sales it applies to.\n\n`rules` is the rate's whole targeting, sent inline. Every rule has to\nhold, and a rule naming several records means any of them — so\n\"(Cameras OR Audio) AND that seller\" is a category rule holding two ids\nbeside a seller rule holding one. Send no rules to charge every sale.\n\nRule kinds come from `GET /commission_rates/rule_types`, which also\ndescribes the configuration each one takes. A marketplace that adds its\nown kind sees it there without this endpoint changing.\n\n`commission_tax_rate` is VAT on the commission itself — the\nmarketplace's own service to the seller, a separate supply from the\nsale. Leave it null to let the store's tax engine answer for wherever\nthe seller's business sits.\n\n\n**Required scope:** `write_commissions` (for API-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":"commission rate created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","kind","value"],"properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true,"description":"Your own identifier for this rate; unique per store."},"enabled":{"type":"boolean"},"position":{"type":"integer","description":"Place in the list. Rates resolve top-down, so 1 is tried first. New rates are created at the top; send this to move one."},"kind":{"type":"string","enum":["percentage","fixed"]},"value":{"type":"string","description":"A percentage (10 = 10%) or a flat amount, per `kind`."},"amounts":{"type":"object","additionalProperties":{"type":"string"},"description":"What a flat fee charges, keyed by currency. A currency with no amount is one this rate does not charge — those sales fall to the next rate. Ignored for a percentage."},"tax_inclusive":{"type":"boolean","description":"Charge on the price including the customer's VAT. Left off, commission is charged on the seller's net revenue, which is the usual basis where the fee is taxed as its own supply."},"include_shipping":{"type":"boolean","description":"Also charge commission on the seller's delivery revenue."},"bounds":{"type":"object","additionalProperties":{"type":"object","properties":{"min_amount":{"type":"string","nullable":true},"max_amount":{"type":"string","nullable":true}}},"description":"The floor and cap a percentage charges within, keyed by currency. Each holds only in its own currency; a sale in a currency with no bounds is charged unbounded."},"commission_tax_rate":{"type":"string","nullable":true,"description":"A fraction, not a percentage. Null asks the tax engine."},"rules":{"type":"array","description":"The full targeting; what you send replaces what the rate holds.","items":{"type":"object","properties":{"id":{"type":"string","description":"Present for an existing rule; omit to create one."},"type":{"type":"string","description":"A kind from /commission_rates/rule_types."},"preferences":{"type":"object","description":"Configuration for the kind, per its preference_schema."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For kinds that name products, which are kept outside preferences."}}}}}}}}}}},"/api/v3/admin/commission_rates/rule_types":{"get":{"summary":"List the commission rule kinds","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every rule kind a rate can be narrowed by, with the schema describing\nthe configuration it takes — so a client builds its editor from what\nthis marketplace has rather than a list hardcoded to match core's.\n\n`association_fields` names any catalog-scale reference a kind keeps\noutside its preferences, so an editor knows to render a picker for it.\n\n\n**Required scope:** `read_commissions` (for API-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":"subject types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preference_schema":{"type":"array","items":{"type":"object"}},"association_fields":{"type":"array","items":{"type":"string"}}}}}}}}}}}}},"/api/v3/admin/commission_rates/{id}":{"parameters":[{"name":"id","in":"path","description":"Commission rate ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_commissions` (for API-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":"commission rate found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}},"404":{"description":"commission rate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Editing a rate changes what the next sale is charged, never what a past\none was: commission lines keep their own snapshot of the rate that\napplied.\n\n\n**Required scope:** `write_commissions` (for API-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":"commission rate updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionRate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"integer"},"value":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"preferences":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Delete a commission rate","tags":["Commission Rates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_commissions` (for API-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":"commission rate deleted"}}}},"/api/v3/admin/companies/{company_id}/memberships":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company members","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the people with standing over this node. Standing covers the node and everything below it in the tree.\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"members found","content":{"application/json":{}}}}},"post":{"summary":"Add a member by email","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a person to the node by email. An email matching an existing customer becomes a\nmembership immediately (a `cmem_…` id); an unknown email becomes an invitation\n(a `cinv_…` id) and the invite email goes out.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"member added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_email":{"type":"string"}},"required":["customer_email"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List tax exemption certificates","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a business's exemption evidence. `active` is the field that decides whether a certificate\nexempts a sale: a verified certificate stops counting once its expiry date passes, so the status\nalone does not answer it.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"certificates found","content":{"application/json":{}}}}},"post":{"summary":"Create a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records exemption evidence against a business. Certificates start `pending` and exempt nothing\nuntil verified.\n\n`country_code` and `state_code` say where the certificate holds — omit both for one valid\neverywhere, give only the country for one valid throughout it. `document` takes an ActiveStorage\nsigned blob id obtained from `POST /api/v3/admin/direct_uploads`.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"certificate created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"certificate_number":{"type":"string"},"reason_code":{"type":"string","description":"Becomes the tax provider's entity use code."},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"issuing_authority":{"type":"string","nullable":true},"document":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."}},"required":["certificate_number","reason_code"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/verify":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Verify a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts the certificate as evidence, which is what makes it exempt sales. Only a pending\ncertificate can be accepted — re-accepting a revoked one would restore evidence that was\ndeliberately withdrawn. An installation that checks numbers against a registry, or requires a\nsecond approval, can refuse here, and the refusal is returned as a validation error.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate verified","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/revoke":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Revoke a tax exemption certificate","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws accepted evidence. A verified certificate cannot be deleted — how a sale was taxed has to remain explainable — so revoking is the way out.\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"200":{"description":"certificate revoked","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/download":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download a certificate document","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the uploaded document. Deliberately not a storage link: the bytes come through the API so\nthe same credentials apply to every read of a confidential document. Requires only read access.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"document streamed","content":{"application/json":{}}},"422":{"description":"no document attached","content":{"application/json":{}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List company tax registrations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's tax registrations, one per kind. A business registration takes precedence\nover the buyer's own when a sale is for that business, because the invoice is addressed to the\nentity rather than the person who placed the order.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","responses":{"200":{"description":"registrations found","content":{"application/json":{}}}}},"post":{"summary":"Create a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registers a tax number against the business. Verification against the relevant registry runs in\nthe background where a validator is installed for the kind; a stock installation registers none,\nleaving the status unattempted.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[],"responses":{"201":{"description":"registration created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","description":"The regime the number belongs to."},"value":{"type":"string"}},"required":["kind","value"]}}}}}},"/api/v3/admin/companies/{company_id}/tax_identifiers/{id}/validate":{"parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Re-check a company tax registration","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the registry again. Manual because a registry answers only \"valid now\" — a number verified\nlast year may have been deregistered since — and because a check that came back unavailable\ncannot otherwise be retried without editing the number.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","responses":{"422":{"description":"no validator installed for this kind","content":{"application/json":{}}}}}},"/api/v3/admin/companies":{"get":{"summary":"List companies","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business customers of the current store.\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"}}],"responses":{"200":{"description":"companies found","content":{"application/json":{}}}}},"post":{"summary":"Create a company","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a company node. A root node is a legal entity; pass parent_id and kind to build the organization tree. Exemption certificates and tax registrations hang off legal-entity nodes.\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":"company created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["company","division"],"description":"company = legal entity (may hold tax registrations), division = organizational unit. Roots must be company."},"parent_id":{"type":"string","nullable":true,"description":"The parent node. Omit for a root."},"external_references":{"type":"array","description":"Identities this business has in your own systems. A system you do not name keeps the reference it already has, and creating with a reference that already exists updates that business instead.","items":{"type":"object","properties":{"system":{"type":"string"},"external_id":{"type":"string"}},"required":["system","external_id"]}}},"required":["name"]}}}}}},"/api/v3/admin/custom_field_definitions/resource_types":{"get":{"summary":"List what custom fields can be attached to","tags":["Custom Field Definitions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The resources a definition can describe, from the server's own\nregistry (`Spree.custom_fields.enabled_resources`).\n\nRead this rather than carrying a list: a resource an extension\nregisters appears here without a client release, and a `resource_type`\nthat is not listed is refused on create.\n\n`resource_type` is the value to send; `name` is what a merchant calls\nit. The two differ where a class has been renamed — categories are\nstored under `Spree::Taxon` and shown as \"Categories\" — so send the\nvalue back verbatim rather than deriving it from the name.\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"}}],"responses":{"200":{"description":"resource types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"resource_type":{"type":"string"},"name":{"type":"string"}}}}}}}}}}}},"/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_code":{"type":"string","nullable":true},"state_code":{"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 seller 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/media":{"get":{"summary":"List media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every file in the store's media library, whether or not it has\nbeen placed on a product. Filter with `q[unattached]=true` for files not\nyet in use, `q[media_type_eq]` for images or video, and\n`q[filename_cont]` to search by file name.\n\n\n**Required scope:** `read_media` (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":"media found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Upload a file to the library","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a file to the library without placing it on anything. Upload the\nfile first through the direct-upload endpoint, then send the signed id\nhere. Put the file on a product by posting to that product's media with\nthis record's id as `source_media_id`.\n\n\n**Required scope:** `write_media` (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":"file added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signed_id":{"type":"string","description":"Direct-upload signed id for the file."},"alt":{"type":"string"},"media_type":{"type":"string","enum":["image","video","external_video"]},"external_video_url":{"type":"string","description":"YouTube or Vimeo link, for an external video."}}}}}}}},"/api/v3/admin/media/{id}/usage":{"parameters":[{"name":"id","in":"path","description":"Media ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Where a file is used","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lists everywhere this file appears: products it is placed on, image\nfields that picked it, and descriptions embedding it. Reusing a file\nshares it rather than copying it, so deleting one placement can leave\nothers pointing at the same file — check this first.\n\nDescription matches are best-effort: an embedded image is a plain URL\nwith nothing recording it, so treat an empty result as \"nothing found\",\nnot proof the file is unused.\n\n\n**Required scope:** `read_media` (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":"usage found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["media","attachment","rich_text"]},"name":{"type":"string","nullable":true},"owner_type":{"type":"string"},"owner_id":{"type":"string","nullable":true},"field":{"type":"string","nullable":true}}}}}}}}}}}},"/api/v3/admin/products/{product_id}/media":{"parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Place a library file on a product","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Puts a file that is already in the library onto this product. The new\nrecord shares the source's file rather than copying it, so nothing is\nuploaded and no image is reprocessed; it carries its own alt text,\nposition and variant links from here on.\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":"file placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_media_id":{"type":"string","description":"A media record already in the library."},"alt":{"type":"string"},"position":{"type":"integer"}},"required":["source_media_id"]}}}}}},"/api/v3/admin/price_lists/{price_list_id}/products":{"get":{"summary":"List price list products","tags":["Price Lists"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The products the list prices, listed by name — membership is derived from the price rows.\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":"price_list_id","in":"path","required":true,"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 products to a price list","tags":["Price Lists"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds products to the list in bulk, materializing a placeholder price per variant and store currency. Already-present products are skipped.\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":"price_list_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"products added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}},"delete":{"summary":"Remove products from a price list","tags":["Price Lists"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes products from the list in bulk, hard-deleting their price rows. Ids that are not members are ignored.\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":"price_list_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]}}}}}},"/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"}}}}}}}}},"/api/v3/admin/seller_requirements":{"get":{"summary":"List seller requirements","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What this marketplace asks of a seller before it will let them trade,\nin the order sellers work through it.\n\nEach row is one configured requirement. `required` says whether it\nstands between the seller and approval — the others are shown as\nrecommended and counted in their progress, but never block. `active`\nswitches one off without losing how it was worded.\n\n\n**Required scope:** `read_sellers` (for API-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":"seller requirements found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerRequirement"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}}}},"post":{"summary":"Add a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds something the marketplace asks of its sellers.\n\n`type` comes from `GET /seller_requirements/types`, which also\ndescribes the configuration each kind takes. Most kinds answer one\nquestion and can be added once; the open-ended ones — a seller\nconfirmation, a manual check, a document — carry the question in your\nown `name` and `description`, so a store may add as many as it needs.\n\nA kind that reads the seller's own data (their addresses, their\nproducts, whether they accepted the terms) needs nothing from the\nseller beyond doing it. The others wait for the seller to submit\nsomething, and the ones you review wait for you.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirement"}}}},"422":{"description":"kind is not registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The kind, from `GET /seller_requirements/types`."},"name":{"type":"string","description":"What the seller sees. Required for kinds that can be added more than once, since the wording is the only thing telling them apart. Left blank on the others, the kind names itself."},"description":{"type":"string","description":"Instructions shown to the seller."},"required":{"type":"boolean","description":"Whether this blocks approval. Off means recommended."},"active":{"type":"boolean"},"position":{"type":"integer","description":"Place in the checklist."},"preferences":{"type":"object","description":"Configuration for this kind, per its `preference_schema`."}}}}}}}},"/api/v3/admin/seller_requirements/types":{"get":{"summary":"List seller requirement kinds","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The kinds you can add, and the shape of each one's configuration form.\n\n`configured` says the store already has this kind — meaningful only\nwhere `allow_multiple` is false. `accepts_submissions` says the seller\nrecords having done it rather than it being read from their data, and\n`reviewed_by_operator` says what they send waits for you.\n\nA marketplace that registers its own kind server-side sees it here\nwithout this endpoint changing.\n\n\n**Required scope:** `read_sellers` (for API-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":"kinds found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"allow_multiple":{"type":"boolean"},"accepts_submissions":{"type":"boolean"},"reviewed_by_operator":{"type":"boolean"},"configured":{"type":"boolean"},"addable":{"type":"boolean","description":"Whether the operator may add one now. The uniqueness rule is the server's, so clients filter on this rather than deriving it."},"preference_schema":{"type":"array","items":{"type":"object"}}}}}}}}}}}}},"/api/v3/admin/seller_requirements/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes how a requirement is worded, what it asks for, where it sits in\nthe checklist, and whether it blocks approval.\n\n`type` is not accepted: a saved row's kind never changes, because\nanything a seller already submitted answered the old one.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirement"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object"}}}}}}},"delete":{"summary":"Delete a seller requirement","tags":["Seller Requirements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stops asking for this. Anything sellers already submitted against it\ngoes too — to keep the record while pausing the ask, set `active` to\nfalse instead.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller requirement deleted"}}}},"/api/v3/admin/sellers":{"get":{"summary":"List sellers","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the sellers on this marketplace. `status` says where each one\nis in its life on the marketplace, and `sellable` answers the question\nthe status alone cannot: an approved seller who is away cannot be\nbought from either.\n\n\n**Required scope:** `read_sellers` (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[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"responses":{"200":{"description":"sellers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Seller"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens a seller record. The seller starts as `pending` and has no team\nyet — invite someone to run it with the `invite` action below.\n\n`status` is deliberately not writable here or on update: every move\nthrough the lifecycle is its own action, because each one does more\nthan set a column.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"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"},"slug":{"type":"string","description":"Derived from the name when omitted."},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"about":{"type":"string","nullable":true},"tax_remittance":{"type":"string","enum":["seller","platform"]},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/sellers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single seller, including its settlement and tax configuration.\n\n**Required scope:** `read_sellers` (for API-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":"seller found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"404":{"description":"seller not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the seller's profile and the settlement configuration the\noperator owns. A `status` sent here is ignored — use the lifecycle\nactions.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller address written inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"billing_email":{"type":"string","nullable":true},"payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"],"nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"holiday_mode_until":{"type":"string","format":"date-time","nullable":true},"logo":{"type":"string","nullable":true,"description":"ActiveStorage signed id of a direct-uploaded file. Send `null` to remove the attachment, or omit the key to leave it alone. Same for `square_logo` and `cover_photo`."},"square_logo":{"type":"string","nullable":true},"cover_photo":{"type":"string","nullable":true},"billing_address":{"type":"object","description":"The seller's own address, written inline. There is no `billing_address_id` — an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}},"returns_address":{"type":"object","description":"The seller's own address, written inline. There is no `billing_address_id` — an address belongs to whoever it was created for, so it is never referenced by id here.","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}}}}}}}},"delete":{"summary":"Delete a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the seller. Their products are kept and left without a\nseller rather than deleted — what happens to a departed seller's\ncatalog is the operator's decision.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller deleted"}}}},"/api/v3/admin/sellers/{id}/invite":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"post":{"summary":"Invite someone to run a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sends an invitation to the seller's own team and moves the seller to\n`invited`. The person becomes a member when they accept, and can then\nsign in to the seller panel.\n\n`role_id` must name a role this seller owns; omit it for the seller's\nown admin role. Re-inviting is allowed — an invitation expires, or the\nfirst one goes to the wrong address.\n\n\n**Required scope:** `write_sellers` (for API-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 sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"role_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/sellers/{id}/approve":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Approve a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lets the seller sell. This is also the way back for one that was\nsuspended or turned down, and it clears any holiday along with the\nsuspension.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"422":{"description":"seller cannot be approved from its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{id}/suspend":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Suspend a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stops a trading seller from selling. Their catalog and history stay,\nand approving reinstates them. Use this rather than `reject` for a\nseller already on the marketplace — it says something different, and\nit can be undone.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller suspended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/sellers/{id}/reject":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Reject a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down an applicant who never traded. A seller already selling is\nsuspended instead; rejecting one is refused.\n\n\n**Required scope:** `write_sellers` (for API-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":"seller rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/stock_levels/bulk_upsert":{"post":{"summary":"Bulk-upsert stock levels","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets stock levels for many (variant, location) pairs at once — what a\nwarehouse or ERP feed posts on a schedule.\n\nEach row names its variant and stock location by Spree id\n(`variant_id`, `stock_location_id`).\n\nA row carries either `count_on_hand` — the absolute level the external\nsystem reports — or `adjustment`, a relative change for feeds that\nreport movements instead. Every change is written as a stock movement,\nso a merchant can still see why a figure moved.\n\nThe response carries `stock_level_count`: how many rows moved a shelf.\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,"schema":{"type":"string"}}],"responses":{"200":{"description":"stock levels updated","content":{"application/json":{}}},"422":{"description":"row is missing a level","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_levels"],"properties":{"stock_levels":{"type":"array","items":{"type":"object","required":["variant_id","stock_location_id"],"properties":{"variant_id":{"type":"string"},"stock_location_id":{"type":"string"},"count_on_hand":{"type":"integer","nullable":true},"adjustment":{"type":"integer","nullable":true},"backorderable":{"type":"boolean","nullable":true}}}}}}}}}}},"/api/v3/admin/stock_movements":{"get":{"summary":"List stock movements","tags":["Stock Movements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the stock ledger, newest first. Every row says what happened to\nstock (`kind`) and carries a direct reference to what caused it, so a\nmerchant can answer \"why is this number what it is?\" from the data.\n\nKinds are `received` (goods arrived), `allocated` (stock promised to a\nplaced order), `shipped` (promised stock left), `released` (a promise\nwithdrawn) and `adjusted` (a manual correction, which always carries a\n`reason`).\n\nMovements are immutable — reversing one means writing its counterpart\nthrough the resource that caused it, which is why there is no create,\nupdate or delete here.\n\nFilter with Ransack predicates such as `q[kind_eq]`,\n`q[stock_level_id_eq]`, `q[order_id_eq]`, `q[fulfillment_id_eq]` or\n`q[created_at_gteq]`.\n\n`kind` is null on rows written before Spree 6.0 until\n`spree:migrate_stock_movements_to_typed_rows` has run.\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[kind_eq]","in":"query","required":false,"description":"Filter by kind ('received', 'allocated', 'shipped', 'released', 'adjusted')","schema":{"type":"string"}},{"name":"q[stock_level_id_eq]","in":"query","required":false,"description":"Filter by stock level, e.g. sl_1234567890","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 movements found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockMovement"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/stock_movements/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock movement ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock movement","tags":["Stock Movements"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock movement 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 movement found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMovement"}}}},"404":{"description":"stock movement not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"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"]},"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)"},"item_index":{"type":"integer","nullable":true,"description":"Position in the submitted items array, for warnings raised while applying a batch of item changes"}},"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"]},"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"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"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_code":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_abbr":{"type":"string","nullable":true},"country_iso":{"type":"string"},"state_name":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"customer_id":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"owner_type":{"type":"string","nullable":true}},"required":["id","label","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_code","state_text","state_code","quick_checkout","is_default_billing","is_default_shipping","state_abbr","country_iso","state_name","metadata","created_at","updated_at","latitude","longitude","customer_id","owner_id","owner_type"],"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},"company_id":{"type":"string","nullable":true},"company_name":{"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},"fee_total":{"type":"string","nullable":true},"display_fee_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","company_id","company_name","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","fee_total","display_fee_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},"CatalogAssignment":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"catalog_id":{"type":"string"},"assignable_type":{"type":"string"},"assignable_id":{"type":"string"},"assignable_name":{"type":"string","nullable":true}},"required":["id","created_at","catalog_id","assignable_type","assignable_id","assignable_name"],"x-typelizer":true},"Catalog":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"number","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"products_count":{"type":"number"},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/CatalogAssignment"}}},"required":["id","name","active","position","metadata","created_at","updated_at","price_list_id","products_count"],"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"}},"external_references":{"type":"object"},"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","external_references","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"}},"default_catalog_id":{"type":"string","nullable":true}},"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","default_catalog_id"],"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},"CommissionLine":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"currency":{"type":"string"},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rate":{"type":"string"},"tax_rate":{"type":"string"},"amount":{"type":"string"},"tax_amount":{"type":"string"},"total":{"type":"string"},"display_amount":{"type":"string"},"display_tax_amount":{"type":"string"},"display_total":{"type":"string"},"order_id":{"type":"string"},"seller_id":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"commission_rate_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true}},"required":["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","total","display_amount","display_tax_amount","display_total","order_id","seller_id","line_item_id","fulfillment_id","commission_rate_id","seller_name"],"x-typelizer":true},"CommissionRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"position":{"type":"number"},"kind":{"type":"string"},"tax_inclusive":{"type":"boolean"},"include_shipping":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"},"commission_tax_rate":{"type":"string","nullable":true},"amounts":{"type":"object"},"bounds":{"type":"object"},"global":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRule"}}},"required":["id","name","code","enabled","position","kind","tax_inclusive","include_shipping","metadata","deleted_at","created_at","updated_at","value","commission_tax_rate","amounts","bounds","global","rules"],"x-typelizer":true},"CommissionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"commission_rate_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","created_at","updated_at","type","commission_rate_id","preferences","preference_schema","label","description"],"x-typelizer":true},"CompanyInvitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"expires_at":{"type":"string","nullable":true},"company_id":{"type":"string"},"status":{"type":"string"},"accepted_at":{"type":"string","nullable":true},"revoked_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","expires_at","company_id","status","accepted_at","revoked_at","created_at","updated_at"],"x-typelizer":true},"CompanyMembership":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"customer_id":{"type":"string"},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","company_id","customer_id","email","created_at","updated_at"],"x-typelizer":true},"Company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"parent_id":{"type":"string","nullable":true},"ancestors":{"type":"object"},"external_references":{"type":"object"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"children_count":{"type":"number"},"members_count":{"type":"number"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/CompanyMembership"}}},"required":["id","name","kind","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"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}},"required":["iso","iso3","name","states_required","zipcode_required"],"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"},"country_code":{"type":"string","nullable":true},"state_code":{"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},"country_name":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","country_code","state_code","postal_code_prefix","postal_code_from","postal_code_to","country_name","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},"DigitalAsset":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"authorized_clicks":{"type":"number","nullable":true},"authorized_days":{"type":"number","nullable":true},"byte_size":{"type":"number","nullable":true},"provider_type":{"type":"string","nullable":true},"provider_settings":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"provider_name":{"type":"string"},"download_url":{"type":"string","nullable":true},"effective_authorized_clicks":{"type":"number"},"effective_authorized_days":{"type":"number"}},"required":["id","variant_id","filename","content_type","authorized_clicks","authorized_days","byte_size","provider_type","provider_settings","created_at","updated_at","provider_name","download_url","effective_authorized_clicks","effective_authorized_days"],"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"},"expires_at":{"type":"string","nullable":true},"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","expires_at","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"},"store_id":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"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","store_id","seller_id","seller_name","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},"tracking_carrier":{"type":"string","nullable":true},"tracking_carrier_name":{"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},"tracking_status":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_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"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"metadata":{"type":"object"},"tracking_details":{"type":"object","nullable":true},"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},"documents":{"type":"object"},"provider_generates_labels":{"type":"boolean"},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","tracking_carrier","tracking_carrier_name","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","tracking_status","estimated_delivery_at","delivered_at","items","metadata","tracking_details","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id","documents","provider_generates_labels"],"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"},"store_id":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"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"},"seller_name":{"type":"string","nullable":true},"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","store_id","seller_id","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","seller_name","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"},"seller_id":{"type":"string","nullable":true},"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},"seller":{"$ref":"#/components/schemas/Seller"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"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","seller_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_codes":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"tax_provider":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","supported_locales","tax_provider","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},"video_provider":{"type":"string","nullable":true},"video_embed_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"poster_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},"external_references":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"attached":{"type":"boolean"},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"embed_url":{"type":"string","nullable":true},"signed_id":{"type":"string","nullable":true},"viewable_id":{"type":"string","nullable":true},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string","nullable":true}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","video_provider","video_embed_url","video_url","poster_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","external_references","created_at","updated_at","attached","filename","content_type","byte_size","embed_url","signed_id","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},"OrderGroup":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"email":{"type":"string","nullable":true},"currency":{"type":"string"},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"seller_count":{"type":"number"},"includes_first_party":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}},"required":["id","number","email","currency","total","display_total","item_total","display_item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","created_at","updated_at","payments"],"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},"company_id":{"type":"string","nullable":true},"company_name":{"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"},"fee_total":{"type":"string"},"display_fee_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},"external_references":{"type":"object"},"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"order_group_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","company_id","company_name","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","fee_total","display_fee_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","external_references","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","seller_id","order_group_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},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"nullable":true},"resolved_capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"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","capture_method","resolved_capture_method","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"},"status":{"type":"string"},"amount":{"type":"string"},"display_amount":{"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","status","amount","display_amount","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},"Policy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string","nullable":true},"body_html":{"type":"string","nullable":true},"updated_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","name","slug","body","body_html","updated_at","created_at"],"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"},"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"],"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"},"buy_box_variant_id":{"type":"string","nullable":true},"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"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},"external_references":{"type":"object"},"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},"submission":{"allOf":[{"$ref":"#/components/schemas/ProductSubmission"}],"nullable":true},"seller_name":{"type":"string","nullable":true},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"digital_assets":{"type":"array","items":{"$ref":"#/components/schemas/DigitalAsset"}},"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","buy_box_variant_id","thumbnail_url","tags","price","original_price","seller_id","external_references","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","seller_name","product_type_id","tax_category_id"],"x-typelizer":true},"ProductSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"review_note":{"type":"string","nullable":true},"reviewed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"product_id":{"type":"string"},"metadata":{"type":"object","nullable":true},"updated_at":{"type":"string"},"submitted_by_id":{"type":"string","nullable":true},"reviewed_by_id":{"type":"string","nullable":true},"reviewed_by_name":{"type":"string","nullable":true},"auto_approved":{"type":"boolean"}},"required":["id","status","review_note","reviewed_at","created_at","product_id","metadata","updated_at","submitted_by_id","reviewed_by_id","reviewed_by_name","auto_approved"],"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},"SellerRequirement":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"required":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preferences":{"type":"object"},"custom_field_definition_ids":{"type":"array","items":{"type":"string"}},"allow_multiple":{"type":"boolean"},"accepts_submissions":{"type":"boolean"},"reviewed_by_operator":{"type":"boolean"}},"required":["id","position","active","required","metadata","created_at","updated_at","kind","name","description","preferences","custom_field_definition_ids","allow_multiple","accepts_submissions","reviewed_by_operator"],"x-typelizer":true},"SellerRequirementStatus":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"position":{"type":"number"},"status":{"type":"string"},"action_url":{"type":"string","nullable":true},"blocking":{"type":"boolean"},"required_policy_name":{"type":"string","nullable":true},"submission":{"$ref":"#/components/schemas/SellerRequirementSubmission"},"published_policy":{"$ref":"#/components/schemas/Policy"}},"required":["id","kind","name","description","required","position","status","action_url","blocking","required_policy_name"],"x-typelizer":true},"SellerRequirementSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"note":{"type":"string","nullable":true},"review_note":{"type":"string","nullable":true},"reference":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"reviewed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"seller_id":{"type":"string"},"requirement_id":{"type":"string"},"requirement_name":{"type":"string"},"file_url":{"type":"string","nullable":true},"file_name":{"type":"string","nullable":true}},"required":["id","status","note","review_note","reference","metadata","reviewed_at","created_at","updated_at","seller_id","requirement_id","requirement_name","file_url","file_name"],"x-typelizer":true},"Seller":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"about":{"type":"string"},"about_html":{"type":"string"},"logo_url":{"type":"string","nullable":true},"square_logo_url":{"type":"string","nullable":true},"cover_photo_url":{"type":"string","nullable":true},"status":{"type":"string"},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"tax_remittance":{"type":"string"},"payouts_schedule_interval":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"holiday_mode_until":{"type":"string","nullable":true},"terms_accepted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"minimum_payout_amount":{"type":"string","nullable":true},"on_holiday":{"type":"boolean"},"sellable":{"type":"boolean"},"products_count":{"type":"number"},"users_count":{"type":"number"},"onboarding_progress":{"type":"object"},"onboarding_complete":{"type":"boolean"},"legal_name":{"type":"string","nullable":true},"registration_number":{"type":"string","nullable":true},"billing_address":{"$ref":"#/components/schemas/Address"},"returns_address":{"$ref":"#/components/schemas/Address"}},"required":["id","name","slug","about","about_html","logo_url","square_logo_url","cover_photo_url","status","contact_email","billing_email","tax_remittance","payouts_schedule_interval","metadata","holiday_mode_until","terms_accepted_at","created_at","updated_at","deleted_at","minimum_payout_amount","on_holiday","sellable","products_count","users_count","onboarding_progress","onboarding_complete","legal_name","registration_number"],"x-typelizer":true},"SellerTeamMember":{"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},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true}},"required":["id","email","first_name","last_name","full_name","created_at","updated_at","avatar_url"],"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"}},"required":["abbr","name"],"x-typelizer":true},"StockLevel":{"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},"external_references":{"type":"object"},"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","external_references","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"external_references":{"type":"object"},"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"},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"}},"required":["id","name","address1","city","zipcode","country_code","country_name","state_code","state_text","pickup_ready_in_minutes","pickup_instructions","external_references","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","created_at","updated_at","seller_id","seller_name"],"x-typelizer":true},"StockMovement":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"kind":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_level_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"return_id":{"type":"string","nullable":true},"exchange_id":{"type":"string","nullable":true},"stock_transfer_id":{"type":"string","nullable":true}},"required":["id","quantity","kind","reason","created_at","updated_at","stock_level_id","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_level_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_level_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},"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}},"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"],"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_company_field_enabled":{"type":"boolean"},"preferred_address_requires_company":{"type":"boolean"},"preferred_address_requires_phone":{"type":"boolean"},"preferred_capture_method":{"type":"string"},"preferred_track_inventory_levels":{"type":"boolean"},"preferred_stock_reservations_enabled":{"type":"boolean"},"preferred_tax_using_ship_address":{"type":"boolean"},"preferred_track_price_history":{"type":"boolean"},"preferred_show_products_without_price":{"type":"boolean"},"preferred_disable_sku_validation":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"preferred_pricing_provider":{"type":"string"},"preferred_inventory_provider":{"type":"string"},"preferred_pricing_provider_failure_policy":{"type":"string"},"preferred_inventory_provider_failure_policy":{"type":"string"},"preferred_document_number_format":{"type":"string"},"preferred_order_number_prefix":{"type":"string"},"preferred_order_number_suffix":{"type":"string"},"preferred_order_number_sequence_start":{"type":"number"},"preferred_limit_digital_download_count":{"type":"boolean"},"preferred_digital_asset_authorized_clicks":{"type":"number"},"preferred_limit_digital_download_days":{"type":"boolean"},"preferred_digital_asset_authorized_days":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_number_sequence_started":{"type":"boolean"},"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_company_field_enabled","preferred_address_requires_company","preferred_address_requires_phone","preferred_capture_method","preferred_track_inventory_levels","preferred_stock_reservations_enabled","preferred_tax_using_ship_address","preferred_track_price_history","preferred_show_products_without_price","preferred_disable_sku_validation","preferred_order_routing_strategy","preferred_pricing_provider","preferred_inventory_provider","preferred_pricing_provider_failure_policy","preferred_inventory_provider_failure_policy","preferred_document_number_format","preferred_order_number_prefix","preferred_order_number_suffix","preferred_order_number_sequence_start","preferred_limit_digital_download_count","preferred_digital_asset_authorized_clicks","preferred_limit_digital_download_days","preferred_digital_asset_authorized_days","created_at","updated_at","order_number_sequence_started","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},"TaxExemptionCertificate":{"type":"object","properties":{"id":{"type":"string"},"certificate_number":{"type":"string"},"reason_code":{"type":"string"},"status":{"type":"string"},"issuing_authority":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"issued_at":{"type":"string"},"expires_at":{"type":"string"},"verified_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"company_id":{"type":"string"},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"active":{"type":"boolean"},"lapsed":{"type":"boolean"},"can_be_deleted":{"type":"boolean"},"document_filename":{"type":"string","nullable":true},"document_byte_size":{"type":"number","nullable":true},"document_url":{"type":"string","nullable":true}},"required":["id","certificate_number","reason_code","status","issuing_authority","metadata","issued_at","expires_at","verified_at","created_at","updated_at","company_id","country_code","state_code","active","lapsed","can_be_deleted","document_filename","document_byte_size","document_url"],"x-typelizer":true},"TaxIdentifier":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true},"validated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"validatable":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true}},"required":["id","kind","value","validation_status","validation_evidence","source","validated_at","created_at","updated_at","validatable","customer_id","cart_id","order_id"],"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},"taxability_reason":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"data":{"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","taxability_reason","country_code","state_code","data","created_at","updated_at"],"x-typelizer":true},"TaxRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"amount":{"type":"string"},"amount_percentage":{"type":"number","nullable":true},"tax_category_id":{"type":"string","nullable":true},"store_id":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true}},"required":["id","name","included_in_price","show_rate_in_label","metadata","created_at","updated_at","deleted_at","amount","amount_percentage","tax_category_id","store_id","country_code","state_code"],"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},"seller_id":{"type":"string","nullable":true},"seller":{"$ref":"#/components/schemas/Seller"},"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},"external_references":{"type":"object"},"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},"hs_code":{"type":"string","nullable":true},"country_of_origin":{"type":"string","nullable":true},"customs_description":{"type":"string","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"},"delivery_profile_id":{"type":"string","nullable":true},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevel"}}},"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","seller_id","option_values","external_references","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","hs_code","country_of_origin","customs_description","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name","delivery_profile_id"],"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/dashboard-core/src/hooks/use-resource-mutation.ts b/packages/dashboard-core/src/hooks/use-resource-mutation.tsindex b7c1498c89..0e56014b29 100644--- a/packages/dashboard-core/src/hooks/use-resource-mutation.ts+++ b/packages/dashboard-core/src/hooks/use-resource-mutation.ts@@ -23,6 +23,18 @@ interface UseResourceMutationOptions<TData, TError, TVariables>* Started checklist and the nav progress badge stay live.*/invalidate?: QueryKey[]+ /**+ * Key segments that must NOT be refreshed, even when `invalidate` matches+ * them by prefix. `invalidate: [['categories', id]]` also sweeps nested+ * lists like `['categories', id, 'products']`; passing `['products']` here+ * holds those back.+ *+ * Use it where a parent's own save runs alongside writes to one of its+ * nested collections: refreshing the collection from the parent's mutation+ * lands mid-save, painting the pre-save rows for a frame before the real+ * state arrives.+ */+ doNotInvalidate?: string[]/** Toast on success. Pass `false` to disable. Default `'Saved'`. */successMessage?: string | false/**@@ -62,6 +74,7 @@ export function useResourceMutation<TData = unknown, TError = Error, TVariablesconst tenantId = useTenantId()const {invalidate,+ doNotInvalidate,successMessage = i18n.t('admin.messages.saved'),errorMessage = i18n.t('admin.errors.generic'),onSuccess,@@ -74,7 +87,13 @@ export function useResourceMutation<TData = unknown, TError = Error, TVariablesonSuccess: (data, variables, onMutateResult, ctx) => {if (invalidate) {for (const key of invalidate) {- queryClient.invalidateQueries({ queryKey: withStoreScope(key, tenantId) })+ const scoped = withStoreScope(key, tenantId)+ queryClient.invalidateQueries({+ queryKey: scoped,+ predicate: doNotInvalidate?.length+ ? (query) => !query.queryKey.some((part) => doNotInvalidate.includes(part as string))+ : undefined,+ })}}if (successMessage !== false) {diff --git a/packages/dashboard-ui/src/index.ts b/packages/dashboard-ui/src/index.tsindex e4bb04aa4d..17d6bdc5e8 100644--- a/packages/dashboard-ui/src/index.ts+++ b/packages/dashboard-ui/src/index.ts@@ -49,6 +49,7 @@ export * from './spree/form-actions'export * from './spree/language-menu-items'export * from './spree/metadata/metadata-card'+export * from './spree/product-membership-list'export * from './spree/products/status-card'export * from './spree/relative-time'export * from './spree/resource-combobox'diff --git a/packages/dashboard-ui/src/spree/product-membership-list.tsx b/packages/dashboard-ui/src/spree/product-membership-list.tsxnew file mode 100644index 0000000000..3e2a3f08a9--- /dev/null+++ b/packages/dashboard-ui/src/spree/product-membership-list.tsx@@ -0,0 +1,349 @@+import {+ closestCenter,+ DndContext,+ type DragEndEvent,+ KeyboardSensor,+ PointerSensor,+ useSensor,+ useSensors,+} from '@dnd-kit/core'+import {+ arrayMove,+ SortableContext,+ sortableKeyboardCoordinates,+ useSortable,+ verticalListSortingStrategy,+} from '@dnd-kit/sortable'+import { CSS } from '@dnd-kit/utilities'+import { Undo2Icon, XIcon } from 'lucide-react'+import { type ReactNode, useEffect, useMemo, useState } from 'react'+import { cn } from '../lib/utils'+import { Badge } from '../ui/badge'+import { Button } from '../ui/button'+import { Checkbox } from '../ui/checkbox'+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/data-table'+import { Pagination, type PaginationMeta } from '../ui/pagination'+import { Thumbnail } from '../ui/thumbnail'+import { DragHandle } from './drag-handle'+import { SearchInput } from './search-input'++/** One product row in a membership list. */+export interface ProductMembershipRow {+ id: string+ name?: string | null+ thumbnailUrl?: string | null+ /**+ * Deferred-editing state: `added` rows are staged locally and not yet+ * persisted (badged, not draggable); `removed` rows are struck through and+ * their remove button becomes a restore.+ */+ pending?: 'added' | 'removed'+}++/** All user-visible copy, so the component stays free of locale namespaces. */+export interface ProductMembershipListLabels {+ filterPlaceholder: string+ clearFilter: string+ noMatches: string+ empty: string+ loading: string+ columnProduct: string+ selectAll: string+ selectRow: string+ remove: string+ /** Required when any row can be `pending: 'removed'`. */+ restore?: string+ /** Badge on `pending: 'added'` rows. */+ pendingAddedBadge?: string+}++export interface ProductMembershipListProps {+ rows: ProductMembershipRow[]+ labels: ProductMembershipListLabels+ loading?: boolean+ meta?: PaginationMeta | null+ onPageChange?: (page: number) => void+ /** Hides checkboxes, drag handles and remove buttons. */+ readOnly?: boolean+ /** Controlled selection — the host renders the bulk actions that consume it. */+ selected?: string[]+ onSelectedChange?: (ids: string[]) => void+ onRemove?: (id: string) => void+ onRestore?: (id: string) => void+ /** Enables drag-to-reorder. Filtered views never reorder. */+ reorderable?: boolean+ /**+ * Persist a drag. `position` is the 0-based index across the whole set+ * (page offset already applied). A rejected promise rolls the row back.+ */+ onReorder?: (id: string, position: number) => Promise<unknown> | undefined+ /** Row title cell — pass a link to the product page; defaults to plain text. */+ renderTitle?: (row: ProductMembershipRow) => ReactNode+}++/**+ * The shared membership table for "products in a grouping" panels —+ * categories, collections, catalogs, price lists. Headless: rows, selection+ * and every mutation come through props; the host owns data fetching, the+ * picker, confirms and save semantics (immediate writes or form state).+ *+ * Renders the client-side quick filter, the selectable rows with thumbnails,+ * optional drag-to-reorder with optimistic rollback, and pagination.+ */+export function ProductMembershipList({+ rows,+ labels,+ loading = false,+ meta,+ onPageChange,+ readOnly = false,+ selected = [],+ onSelectedChange,+ onRemove,+ onRestore,+ reorderable = false,+ onReorder,+ renderTitle,+}: ProductMembershipListProps) {+ const [query, setQuery] = useState('')++ // Local order mirrors the incoming rows so a drag re-renders instantly;+ // a resolved onReorder re-syncs through the next rows prop.+ const [order, setOrder] = useState<ProductMembershipRow[]>(rows)+ useEffect(() => {+ setOrder(rows)+ }, [rows])++ const sensors = useSensors(+ useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),+ useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),+ )++ const ids = useMemo(() => order.map((row) => row.id), [order])++ // Client-side quick filter over the current page. While a filter is active,+ // drag-reorder is disabled — reordering a filtered subset would compute+ // positions against the wrong neighbours.+ const trimmedQuery = query.trim().toLowerCase()+ const filtering = trimmedQuery.length > 0+ const visible = useMemo(+ () =>+ filtering+ ? order.filter((row) => (row.name ?? '').toLowerCase().includes(trimmedQuery))+ : order,+ [order, filtering, trimmedQuery],+ )++ // Rows a checkbox makes sense for — pending removals restore instead.+ const selectableIds = useMemo(+ () => visible.filter((row) => row.pending !== 'removed').map((row) => row.id),+ [visible],+ )+ const selectedSet = useMemo(() => new Set(selected), [selected])+ const allSelected = selectableIds.length > 0 && selectableIds.every((id) => selectedSet.has(id))++ function toggleSelected(id: string) {+ if (!onSelectedChange) return+ onSelectedChange(+ selectedSet.has(id) ? selected.filter((existing) => existing !== id) : [...selected, id],+ )+ }++ // Operate only on the currently-visible (filtered) rows so "select all"+ // never pulls in hidden products a later bulk action would touch unseen.+ function toggleAll() {+ if (!onSelectedChange) return+ if (allSelected) {+ const visibleSet = new Set(selectableIds)+ onSelectedChange(selected.filter((id) => !visibleSet.has(id)))+ } else {+ onSelectedChange([...new Set([...selected, ...selectableIds])])+ }+ }++ function handleDragEnd(event: DragEndEvent) {+ const { active, over } = event+ if (!over || active.id === over.id || !onReorder) return+ const from = order.findIndex((row) => row.id === active.id)+ const to = order.findIndex((row) => row.id === over.id)+ if (from === -1 || to === -1) return+ const previousOrder = order+ setOrder(arrayMove(order, from, to)) // optimistic+ // `to` is an index within the current page; the caller wants a 0-based+ // index across the whole grouping. `meta.from` is 1-based.+ const result = onReorder(String(active.id), (meta?.from ?? 1) - 1 + to)+ Promise.resolve(result).catch(() => setOrder(previousOrder))+ }++ const curatable = !readOnly++ if (loading) {+ return <p className="p-6 text-muted-foreground text-sm">{labels.loading}</p>+ }++ if (order.length === 0) {+ return <p className="p-6 text-muted-foreground text-sm">{labels.empty}</p>+ }++ return (+ <>+ <div className="border-border-subtle border-b p-3">+ <SearchInput+ value={query}+ onValueChange={setQuery}+ onKeyDown={(e) => e.key === 'Enter' && e.preventDefault()}+ placeholder={labels.filterPlaceholder}+ clearLabel={labels.clearFilter}+ />+ </div>+ {visible.length === 0 ? (+ <p className="p-6 text-muted-foreground text-sm">{labels.noMatches}</p>+ ) : (+ <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>+ <Table>+ <TableHeader>+ <TableRow>+ {curatable && (+ <TableHead className="w-10">+ <Checkbox+ checked={allSelected}+ onCheckedChange={toggleAll}+ aria-label={labels.selectAll}+ />+ </TableHead>+ )}+ {reorderable && <TableHead className="w-8" />}+ <TableHead>{labels.columnProduct}</TableHead>+ <TableHead className="w-10" />+ </TableRow>+ </TableHeader>+ <SortableContext items={ids} strategy={verticalListSortingStrategy}>+ {/* No border-t: TableHead draws the rule as an inset shadow,+ and a border alongside it stacks into a 2px line. */}+ <TableBody>+ {visible.map((row) => (+ <MembershipRow+ key={row.id}+ row={row}+ curatable={curatable}+ // Reorder only makes sense over the full page of settled+ // rows; staged rows have no position yet.+ reorderable={reorderable && curatable && !filtering && !row.pending}+ showDragColumn={reorderable}+ selected={selectedSet.has(row.id)}+ onToggleSelected={() => toggleSelected(row.id)}+ onRemove={onRemove ? () => onRemove(row.id) : undefined}+ onRestore={onRestore ? () => onRestore(row.id) : undefined}+ labels={labels}+ renderTitle={renderTitle}+ />+ ))}+ </TableBody>+ </SortableContext>+ </Table>+ </DndContext>+ )}+ {/* Pagination brings its own top border + padding. */}+ {meta && onPageChange && <Pagination meta={meta} onPageChange={onPageChange} />}+ </>+ )+}++function MembershipRow({+ row,+ curatable,+ reorderable,+ showDragColumn,+ selected,+ onToggleSelected,+ onRemove,+ onRestore,+ labels,+ renderTitle,+}: {+ row: ProductMembershipRow+ curatable: boolean+ reorderable: boolean+ showDragColumn: boolean+ selected: boolean+ onToggleSelected: () => void+ onRemove?: () => void+ onRestore?: () => void+ labels: ProductMembershipListLabels+ renderTitle?: (row: ProductMembershipRow) => ReactNode+}) {+ const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({+ id: row.id,+ disabled: !reorderable,+ })++ const removed = row.pending === 'removed'+ const added = row.pending === 'added'++ return (+ <tr+ ref={setNodeRef}+ style={{ transform: CSS.Transform.toString(transform), transition }}+ // Mirror <TableRow> styling — a plain <tr> is required so dnd-kit's+ // setNodeRef attaches (TableRow doesn't forward refs).+ className={cn(+ 'group/row last:*:border-b-0 hover:bg-accent/60',+ selected && 'bg-accent/60 hover:bg-accent',+ isDragging && 'relative z-10 opacity-70',+ removed && 'opacity-60',+ )}+ >+ {curatable && (+ <TableCell>+ {!removed && (+ <Checkbox+ checked={selected}+ onCheckedChange={onToggleSelected}+ aria-label={labels.selectRow}+ />+ )}+ </TableCell>+ )}+ {showDragColumn && (+ <TableCell className="pr-0">+ {reorderable && <DragHandle attributes={attributes} listeners={listeners} />}+ </TableCell>+ )}+ <TableCell>+ <span className={cn('flex items-center gap-3', removed && 'line-through')}>+ <Thumbnail src={row.thumbnailUrl} size="sm" />+ {renderTitle ? renderTitle(row) : <span className="truncate text-sm">{row.name}</span>}+ {added && labels.pendingAddedBadge && (+ <Badge variant="secondary">{labels.pendingAddedBadge}</Badge>+ )}+ </span>+ </TableCell>+ <TableCell className="text-right">+ {curatable &&+ (removed+ ? onRestore && (+ <Button+ type="button"+ variant="ghost"+ size="icon"+ onClick={onRestore}+ aria-label={labels.restore ?? labels.remove}+ >+ <Undo2Icon className="size-4" />+ </Button>+ )+ : onRemove && (+ <Button+ type="button"+ variant="ghost"+ size="icon"+ onClick={onRemove}+ aria-label={labels.remove}+ >+ <XIcon className="size-4" />+ </Button>+ ))}+ </TableCell>+ </tr>+ )+}diff --git a/packages/dashboard/e2e/catalogs.spec.ts b/packages/dashboard/e2e/catalogs.spec.tsnew file mode 100644index 0000000000..ba0704f226--- /dev/null+++ b/packages/dashboard/e2e/catalogs.spec.ts@@ -0,0 +1,130 @@+import { expect, type Page, test } from '@playwright/test'+import { FIXTURE_PROMO_PRODUCT, gotoIndex, login } from './helpers'++const CATALOGS_PATH = (storeId: string) => `/${storeId}/products/catalogs`+const CTA = /add catalog/i++async function createCatalog(page: Page, name: string) {+ await page.getByRole('button', { name: CTA }).click()+ const sheet = page.getByRole('dialog')+ await expect(sheet.getByRole('heading', { name: /new catalog/i })).toBeVisible()+ await sheet.locator('#catalog-name').fill(name)+ await sheet.getByRole('button', { name: /create catalog/i }).click()+ // On success the sheet navigates to the new catalog's detail page.+ await expect(page.getByRole('heading', { name })).toBeVisible({ timeout: 15_000 })+}++async function saveCatalog(page: Page) {+ await page+ .getByRole('main')+ .getByRole('button', { name: /^save$/i })+ .first()+ .click()+}++// The catalog detail page saves in one shot: settings and staged product+// changes flush together from the header Save, same as the price list editor.+test.describe('catalogs', () => {+ test('creates a catalog', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, CATALOGS_PATH(creds.store_id), CTA)++ const name = `E2E Catalog ${Date.now()}`+ await createCatalog(page, name)++ await page.goto(CATALOGS_PATH(creds.store_id))+ await expect(page.getByText(name)).toBeVisible({ timeout: 15_000 })+ })++ test('stages product membership and persists it on Save', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, CATALOGS_PATH(creds.store_id), CTA)++ const name = `E2E Catalog Products ${Date.now()}`+ await createCatalog(page, name)++ // Fresh catalog: the products card shows its empty state.+ await expect(page.getByText(/no products in this catalog yet/i)).toBeVisible({+ timeout: 15_000,+ })++ // Stage a product through the picker sheet — it renders immediately with+ // the "New" badge but is not persisted yet.+ await page.getByRole('button', { name: /add products/i }).click()+ const picker = page.getByRole('dialog')+ await expect(picker.getByRole('heading', { name: /add products to catalog/i })).toBeVisible()+ await picker.getByRole('searchbox').fill(FIXTURE_PROMO_PRODUCT)+ const option = picker+ .getByRole('button', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })+ .first()+ await expect(option).toBeVisible({ timeout: 15_000 })+ await option.click()+ await picker.getByRole('button', { name: /^add 1$/i }).click()+ await expect(picker).toBeHidden({ timeout: 15_000 })++ const productRow = page.getByRole('row', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })+ await expect(productRow).toBeVisible({ timeout: 15_000 })+ await expect(productRow.getByText(/^new$/i)).toBeVisible()++ // Save flushes the staged addition; the badge disappears once the row+ // comes back from the server.+ await saveCatalog(page)+ await expect(productRow.getByText(/^new$/i)).toHaveCount(0, { timeout: 15_000 })++ // Reload and prove the membership actually persisted.+ await page.reload()+ await expect(productRow).toBeVisible({ timeout: 15_000 })++ // Removing marks the row (restore stays available) and only Save makes+ // it real.+ await productRow.getByRole('button', { name: /remove from catalog/i }).click()+ await expect(productRow.getByRole('button', { name: /restore/i })).toBeVisible()++ // A product staged for removal is re-pickable — the picker must not lock+ // it as "already added", or the row's restore arrow is the only way back.+ await page.getByRole('button', { name: /add products/i }).click()+ const rePicker = page.getByRole('dialog')+ await rePicker.getByRole('searchbox').fill(FIXTURE_PROMO_PRODUCT)+ const reOption = rePicker+ .getByRole('button', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })+ .first()+ await expect(reOption).toBeEnabled({ timeout: 15_000 })+ await reOption.click()+ await rePicker.getByRole('button', { name: /^add 1$/i }).click()+ await expect(rePicker).toBeHidden({ timeout: 15_000 })+ // Re-picking cancels the removal rather than staging a duplicate.+ await expect(productRow.getByRole('button', { name: /restore/i })).toHaveCount(0)+ await expect(productRow).toHaveCount(1)++ // Remove it again, for real this time.+ await productRow.getByRole('button', { name: /remove from catalog/i }).click()+ await expect(productRow.getByRole('button', { name: /restore/i })).toBeVisible()++ await saveCatalog(page)+ await expect(page.getByText(/no products in this catalog yet/i)).toBeVisible({+ timeout: 15_000,+ })++ // Reload and prove the removal persisted too.+ await page.reload()+ await expect(page.getByText(/no products in this catalog yet/i)).toBeVisible({+ timeout: 15_000,+ })+ })++ test('renames a catalog from the header Save', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, CATALOGS_PATH(creds.store_id), CTA)++ const name = `E2E Catalog Rename ${Date.now()}`+ await createCatalog(page, name)++ const renamed = `${name} v2`+ await page.locator('#catalog-name').fill(renamed)+ await saveCatalog(page)+ await expect(page.getByRole('heading', { name: renamed })).toBeVisible({ timeout: 15_000 })++ await page.reload()+ await expect(page.locator('#catalog-name')).toHaveValue(renamed, { timeout: 15_000 })+ })+})diff --git a/packages/dashboard/e2e/categories.spec.ts b/packages/dashboard/e2e/categories.spec.tsindex f7631142d4..12870de6c1 100644--- a/packages/dashboard/e2e/categories.spec.ts+++ b/packages/dashboard/e2e/categories.spec.ts@@ -97,18 +97,43 @@ test.describe('categories management', () => {await expect(confirm).toBeEnabled({ timeout: 15_000 })await confirm.click()- // The product row now renders in the products table.+ // The product row renders immediately, staged — the badge marks it as+ // not yet persisted, and the page's Save is what writes it.const productRow = page.getByRole('row', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })await expect(productRow).toBeVisible({ timeout: 15_000 })+ await expect(productRow.getByText(/^new$/i)).toBeVisible()- // Remove it via the per-row remove button.+ await page.getByRole('button', { name: /^save$/i }).click()++ // One Save, one toast — the membership flush rides inside the category+ // update and must not announce itself separately. Asserted before the+ // staged badge clears, because toasts auto-dismiss after a few seconds.+ // `[data-type]` is the toast root; dnd-kit also renders an empty+ // `role="status"` region, so counting that role would overcount.+ // Exactly one toast for the whole Save: the membership flush rides inside+ // the category update and must not announce itself separately.+ // `toHaveText` on the collection asserts the full stack in one shot, so a+ // second toast fails the array comparison rather than slipping past a+ // count that was momentarily 1.+ const toasts = page.locator('[role="status"][data-type]')+ await expect(toasts).toHaveText([/category updated/i])++ await expect(productRow.getByText(/^new$/i)).toHaveCount(0, { timeout: 15_000 })++ // Reload and prove the membership actually persisted.+ await page.reload()+ await expect(productRow).toBeVisible({ timeout: 15_000 })++ // Removing stages too — no confirm, because Save is the confirmation.await productRow.getByRole('button', { name: /remove from category/i }).click()- // Removing writes through immediately, so it confirms first. Scope to the- // dialog — the row button matches /remove/ too.- await page- .getByRole('dialog')- .getByRole('button', { name: /^remove$/i })- .click()+ await expect(productRow.getByRole('button', { name: /restore/i })).toBeVisible()++ await page.getByRole('button', { name: /^save$/i }).click()+ await expect(page.getByText(/no products in this category yet/i)).toBeVisible({+ timeout: 15_000,+ })++ await page.reload()await expect(page.getByText(/no products in this category yet/i)).toBeVisible({timeout: 15_000,})diff --git a/packages/dashboard/e2e/collections.spec.ts b/packages/dashboard/e2e/collections.spec.tsindex c3cf90e1e7..9e025c8ff0 100644--- a/packages/dashboard/e2e/collections.spec.ts+++ b/packages/dashboard/e2e/collections.spec.ts@@ -101,20 +101,25 @@ test.describe('collections management', () => {const productRow = page.getByRole('row', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })await expect(productRow).toBeVisible({ timeout: 15_000 })- // Remove it via the per-row remove button.+ // Staged, not yet written — the badge says so, and Save is what persists.+ await expect(productRow.getByText(/^new$/i)).toBeVisible()+ await page.getByRole('button', { name: /^save$/i }).click()+ await expect(productRow.getByText(/^new$/i)).toHaveCount(0, { timeout: 15_000 })++ await page.reload()+ await expect(productRow).toBeVisible({ timeout: 15_000 })++ // Removing stages too — no confirm, because Save is the confirmation.await productRow.getByRole('button', { name: /remove from collection/i }).click()- // Removing writes through immediately, so it confirms first. Scope to the- // dialog — the row button matches /remove/ too.- await page- .getByRole('dialog')- .getByRole('button', { name: /^remove$/i })- .click()+ await expect(productRow.getByRole('button', { name: /restore/i })).toBeVisible()++ await page.getByRole('button', { name: /^save$/i }).click()await expect(page.getByText(/no products in this collection yet/i)).toBeVisible({timeout: 15_000,})})- test('bulk-removes selected products behind a confirm', async ({ page }) => {+ test('bulk-removes selected products on Save, discardable until then', async ({ page }) => {const creds = await login(page)await gotoIndex(page, COLLECTIONS_PATH(creds.store_id), CTA)@@ -134,27 +139,24 @@ test.describe('collections management', () => {const productRow = page.getByRole('row', { name: new RegExp(FIXTURE_PROMO_PRODUCT, 'i') })await expect(productRow).toBeVisible({ timeout: 15_000 })+ await page.getByRole('button', { name: /^save$/i }).click()+ await expect(productRow.getByText(/^new$/i)).toHaveCount(0, { timeout: 15_000 })// Selecting a row swaps the "Add products" CTA for the bulk remove button.- // Scope it to the card — once the dialog opens, its confirm button carries- // the same accessible name.const card = page.locator('#root')await productRow.getByRole('checkbox').check()await card.getByRole('button', { name: /^remove$/i }).click()- // Cancelling leaves the product in place — the bulk write is confirmed, and- // it persists immediately rather than waiting for the page's Save.- const dialog = page.getByRole('dialog')- await expect(dialog.getByText(/takes effect immediately/i)).toBeVisible()- await dialog.getByRole('button', { name: /^cancel$/i }).click()+ // Staged, not written: Discard rolls it back with the rest of the form.+ await expect(productRow.getByRole('button', { name: /restore/i })).toBeVisible()+ await page.getByRole('button', { name: /^discard$/i }).click()+ await expect(productRow.getByRole('button', { name: /restore/i })).toHaveCount(0)await expect(productRow).toBeVisible()- // Confirming removes it.+ // Staging it again and saving is what actually removes it.+ await productRow.getByRole('checkbox').check()await card.getByRole('button', { name: /^remove$/i }).click()- await page- .getByRole('dialog')- .getByRole('button', { name: /^remove$/i })- .click()+ await page.getByRole('button', { name: /^save$/i }).click()await expect(page.getByText(/no products in this collection yet/i)).toBeVisible({timeout: 15_000,})diff --git a/packages/dashboard/e2e/price-lists.spec.ts b/packages/dashboard/e2e/price-lists.spec.tsindex 7447c24460..be0a1bf0a2 100644--- a/packages/dashboard/e2e/price-lists.spec.ts+++ b/packages/dashboard/e2e/price-lists.spec.ts@@ -71,23 +71,38 @@ async function saveForm(page: Page) {.click()}-// Pick a product from the Products card's `<ResourceMultiAutocomplete>`.-// Unlike the promotions spec's helper, the picker lives on the page (not-// inside a dialog), so we scope to `main` to skip any open Sheet/Dialog.+// Add a product through the Products card's picker sheet (the same shared+// membership panel categories/collections/catalogs use). Membership lives in+// form state, so the row appears immediately but persists only on Save.async function pickProductOnPage(page: Page, optionLabel: string) {- const input = page.locator('main').getByPlaceholder(/search products by name/i)- await input.fill(optionLabel)await page- .getByRole('option', { name: new RegExp(optionLabel, 'i') })- .first()+ .locator('main')+ .getByRole('button', { name: /^add products$/i }).click()- // Close the listbox so the next focus (the bulk-prices button) lands cleanly.- await input.press('Escape')+ const picker = page.getByRole('dialog')+ await expect(picker.getByRole('heading', { name: /add products to price list/i })).toBeVisible()++ // Search is debounced + async; wait for the matching option to render+ // before selecting it.+ await picker.getByRole('searchbox').fill(optionLabel)+ const option = picker.getByRole('button', { name: new RegExp(optionLabel, 'i') }).first()+ await expect(option).toBeVisible({ timeout: 15_000 })+ await option.click()++ const confirm = picker.getByRole('button', { name: /^add 1$/i })+ await expect(confirm).toBeEnabled({ timeout: 15_000 })+ await confirm.click()+ await expect(picker).toBeHidden({ timeout: 15_000 })++ // The staged product renders as a row in the membership table.+ await expect(page.getByRole('row', { name: new RegExp(optionLabel, 'i') }).first()).toBeVisible({+ timeout: 15_000,+ })}async function openBulkPriceEditor(page: Page) {- // Single "Edit prices" button on both surfaces (price-list PricesCard- // and product PageHeader).+ // Single "Edit prices" button on both surfaces — the price list's page+ // header and the product PageHeader.await page.getByRole('button', { name: /^edit prices$/i }).click()await expect(page.getByRole('dialog')).toBeVisible({ timeout: 15_000 })await expect(page.getByRole('heading', { name: /^edit prices —/i })).toBeVisible()@@ -299,13 +314,14 @@ test.describe('price lists', () => {// Attach a seeded product so the bulk editor has a row to edit.// Saving creates a placeholder price the editor can fill in.await pickProductOnPage(page, FIXTURE_PROMO_PRODUCT)- await expect(page.getByText(/1 product selected/i)).toBeVisible({ timeout: 5_000 })await saveForm(page)- // Card-counter help text updates once placeholder prices exist. A- // multi-currency store creates one placeholder per currency, so the- // count is "N prices configured" (singular when the store has one- // currency) — match either form.- await expect(page.getByText(/\d+ price(s)? configured/i)).toBeVisible({ timeout: 15_000 })+ // The Products card's description picks up the price count once+ // placeholder prices exist. A multi-currency store creates one+ // placeholder per currency, so the copy is singular or plural depending+ // on the store — match either form.+ await expect(page.getByText(/\d+ price(s)? (is|are) configured/i)).toBeVisible({+ timeout: 15_000,+ })await openBulkPriceEditor(page)@@ -358,9 +374,10 @@ test.describe('price lists', () => {await submitCreate(page, name)await pickProductOnPage(page, FIXTURE_PROMO_PRODUCT)- await expect(page.getByText(/1 product selected/i)).toBeVisible({ timeout: 5_000 })await saveForm(page)- await expect(page.getByText(/\d+ price(s)? configured/i)).toBeVisible({ timeout: 15_000 })+ await expect(page.getByText(/\d+ price(s)? (is|are) configured/i)).toBeVisible({+ timeout: 15_000,+ })await openBulkPriceEditor(page)const dialog = page.getByRole('dialog')diff --git a/packages/dashboard/src/components/spree/categories/category-list.tsx b/packages/dashboard/src/components/spree/categories/category-list.tsxindex 1fb915213d..b939dcd1ef 100644--- a/packages/dashboard/src/components/spree/categories/category-list.tsx+++ b/packages/dashboard/src/components/spree/categories/category-list.tsx@@ -47,7 +47,7 @@ export function CategoryList({<TableHead className="w-12" /></TableRow></TableHeader>- <TableBody className="border-t border-border">+ <TableBody>{categories.length === 0 ? (<TableEmpty colSpan={3}>{t('admin.categories.no_results')}</TableEmpty>) : (diff --git a/packages/dashboard/src/components/spree/categories/category-products-card.tsx b/packages/dashboard/src/components/spree/categories/category-products-card.tsxindex af542545eb..ff2c105978 100644--- a/packages/dashboard/src/components/spree/categories/category-products-card.tsx+++ b/packages/dashboard/src/components/spree/categories/category-products-card.tsx@@ -1,36 +1,26 @@import { useParams } from '@tanstack/react-router'-import {- useAddCategoryProducts,- useCategoryProducts,- useRemoveCategoryProduct,- useRemoveCategoryProducts,- useRepositionCategoryProduct,-} from '../../../hooks/use-categories'-import { ProductMembershipCard } from '../product-membership-card'--const hooks = {- useProducts: useCategoryProducts,- useAdd: useAddCategoryProducts,- useRemoveOne: useRemoveCategoryProduct,- useRemoveMany: useRemoveCategoryProducts,- useReposition: useRepositionCategoryProduct,-}+import { useCategoryProducts, useRepositionCategoryProduct } from '../../../hooks/use-categories'+import { DeferredProductMembershipCard } from '../deferred-product-membership-card'/**- * Manual product membership + ordering for a category — the SPA equivalent of- * the old Rails admin taxon "Products" panel. Only rendered for a persisted- * category (needs an id to mutate).+ * Manual product membership + ordering for a category. Adds and removes stage+ * into the category form and persist on its Save; reordering writes through on+ * drop, since a category's position drives storefront display order.+ *+ * Only rendered for a persisted category (needs an id to list or mutate).*/export function CategoryProductsCard({ categoryId }: { categoryId: string }) {const { storeId } = useParams({from: '/_authenticated/$storeId/products/categories/$categoryId',})+ const reposition = useRepositionCategoryProduct(categoryId)return (- <ProductMembershipCard+ <DeferredProductMembershipCardparentId={categoryId}storeId={storeId}- hooks={hooks}+ useProducts={useCategoryProducts}+ onReorder={(productId, new_position) => reposition.mutateAsync({ productId, new_position })}translationNamespace="admin.categories"/>)diff --git a/packages/dashboard/src/components/spree/categories/category-tree.tsx b/packages/dashboard/src/components/spree/categories/category-tree.tsxindex fa9801b6e3..d419e8f45e 100644--- a/packages/dashboard/src/components/spree/categories/category-tree.tsx+++ b/packages/dashboard/src/components/spree/categories/category-tree.tsx@@ -143,7 +143,7 @@ export function CategoryTree({<TableHead className="w-12" /></TableRow></TableHeader>- <TableBody className="border-t border-border">+ <TableBody>{flattened.length === 0 ? (<TableEmpty colSpan={4}>{t('admin.categories.empty')}</TableEmpty>) : (diff --git a/packages/dashboard/src/components/spree/collections/collection-products-card.tsx b/packages/dashboard/src/components/spree/collections/collection-products-card.tsxindex 6db9285fef..3fac9a64bf 100644--- a/packages/dashboard/src/components/spree/collections/collection-products-card.tsx+++ b/packages/dashboard/src/components/spree/collections/collection-products-card.tsx@@ -1,27 +1,20 @@import { useParams } from '@tanstack/react-router'import { useTranslation } from 'react-i18next'import {- useAddCollectionProducts,useCollectionProducts,- useRemoveCollectionProduct,- useRemoveCollectionProducts,useRepositionCollectionProduct,} from '../../../hooks/use-collections'-import { ProductMembershipCard } from '../product-membership-card'--const hooks = {- useProducts: useCollectionProducts,- useAdd: useAddCollectionProducts,- useRemoveOne: useRemoveCollectionProduct,- useRemoveMany: useRemoveCollectionProducts,- useReposition: useRepositionCollectionProduct,-}+import { DeferredProductMembershipCard } from '../deferred-product-membership-card'/**- * Product membership for a collection. A manual collection is curated here; an- * automatic one materializes its members from its rules, so the list renders- * read-only — the API rejects curation there, and anything added by hand would- * be dropped on the next regeneration.+ * Product membership for a collection. A manual collection is curated here —+ * adds and removes stage into the collection form and persist on its Save,+ * while reordering writes through on drop, since a collection's position+ * drives storefront display order.+ *+ * An automatic collection materializes its members from its rules, so the list+ * renders read-only: the API rejects curation there, and anything added by+ * hand would be dropped on the next regeneration.*/export function CollectionProductsCard({collectionId,@@ -34,14 +27,16 @@ export function CollectionProductsCard({const { storeId } = useParams({from: '/_authenticated/$storeId/products/collections/$collectionId',})+ const reposition = useRepositionCollectionProduct(collectionId)return (- <ProductMembershipCard+ <DeferredProductMembershipCardparentId={collectionId}storeId={storeId}- hooks={hooks}- translationNamespace="admin.collections"readOnly={automatic}+ useProducts={useCollectionProducts}+ onReorder={(productId, new_position) => reposition.mutateAsync({ productId, new_position })}+ translationNamespace="admin.collections"description={automatic ? t('admin.collections.products.automatic_hint') : undefined}/>)diff --git a/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx b/packages/dashboard/src/components/spree/deferred-product-membership-card.tsxnew file mode 100644index 0000000000..7aec340ce0--- /dev/null+++ b/packages/dashboard/src/components/spree/deferred-product-membership-card.tsx@@ -0,0 +1,257 @@+import type { PaginationMeta, Product } from '@spree/admin-sdk'+import { adminClient, ResourcePickerSheet } from '@spree/dashboard-core'+import {+ Button,+ Card,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ ProductMembershipList,+ type ProductMembershipRow,+} from '@spree/dashboard-ui'+import { Link } from '@tanstack/react-router'+import { PlusIcon, Trash2Icon } from 'lucide-react'+import { useEffect, useMemo, useState } from 'react'+import { useTranslation } from 'react-i18next'+import { useProductMembershipStaging } from './product-membership-staging'++/** The paginated members query — `useCatalogProducts`-shaped. */+export type ProductMembershipQuery = (+ parentId: string | undefined,+ page?: number,+) => { data?: { data: Product[]; meta: PaginationMeta }; isLoading: boolean }++/** Persists a drag-to-reorder. Resolve to commit, reject to roll back. */+export type ProductMembershipReorder = (productId: string, position: number) => Promise<unknown>++/**+ * Product membership for a parent that saves as a form — the one card every+ * curating parent uses: categories, collections, catalogs and price lists.+ *+ * Nothing here writes on click. The picker stages additions and the row "x"+ * stages removals into the surrounding form+ * (`ProductMembershipStagingProvider`), which makes the page dirty; the+ * page's Save flushes them through the parent's nested products endpoints+ * and its Discard rolls them back. Staged rows are badged or struck through+ * so the pending state stays visible, and a staged removal restores in one+ * click — so removals need no confirm, because Save is the confirmation.+ *+ * Pass `onReorder` for a parent whose membership carries a manual order+ * (categories and collections, whose position drives storefront display).+ * Reordering persists on drop rather than on Save — replaying a drag+ * sequence against server-side positions is not reliable — so it is+ * disabled while any membership change is staged.+ *+ * Pass `readOnly` where membership is derived rather than curated (an+ * automatic collection materializes its members from rules): the list still+ * renders, but every control disappears.+ */+export function DeferredProductMembershipCard({+ parentId,+ storeId,+ canEdit = true,+ readOnly = false,+ useProducts,+ onReorder,+ translationNamespace,+ description,+}: {+ parentId: string+ storeId: string+ /** False for a viewer without update permission on the parent. */+ canEdit?: boolean+ /** True when membership is rule-derived and cannot be curated at all. */+ readOnly?: boolean+ useProducts: ProductMembershipQuery+ onReorder?: ProductMembershipReorder+ /** Locale namespace holding the `products.*` copy, e.g. `admin.catalogs`. */+ translationNamespace: string+ /** Rendered under the title while nothing is staged. */+ description?: string+}) {+ const { t } = useTranslation()+ const tr = (key: string, options?: Record<string, unknown>) =>+ t(`${translationNamespace}.products.${key}`, options ?? {})++ const staging = useProductMembershipStaging()+ const { adds: pendingAdds, removes: pendingRemoves } = staging++ const [page, setPage] = useState(1)+ const { data, isLoading } = useProducts(parentId, page)+ const meta = data?.meta+ const serverProducts = useMemo(() => data?.data ?? [], [data])++ const [pickerOpen, setPickerOpen] = useState(false)+ const [selected, setSelected] = useState<string[]>([])++ const pendingRemoveSet = useMemo(() => new Set(pendingRemoves), [pendingRemoves])+ const pendingAddIds = useMemo(() => new Set(pendingAdds.map((p) => p.id)), [pendingAdds])++ // Staged additions are pinned on top of every page so they stay visible.+ const rows = useMemo<ProductMembershipRow[]>(+ () => [+ ...pendingAdds.map((product) => ({+ id: product.id,+ name: product.name,+ thumbnailUrl: product.thumbnail_url,+ pending: 'added' as const,+ })),+ ...serverProducts.map((product) => ({+ id: product.id,+ name: product.name,+ thumbnailUrl: product.thumbnail_url,+ pending: pendingRemoveSet.has(product.id) ? ('removed' as const) : undefined,+ })),+ ],+ [pendingAdds, serverProducts, pendingRemoveSet],+ )++ // Drop stale selections when rows leave the list.+ useEffect(() => {+ const present = new Set(rows.filter((row) => row.pending !== 'removed').map((row) => row.id))+ setSelected((prev) => {+ const next = prev.filter((id) => present.has(id))+ return next.length === prev.length ? prev : next+ })+ }, [rows])++ function stageRemove(ids: string[]) {+ const removing = new Set(ids)+ const stagedAdds = ids.filter((id) => pendingAddIds.has(id))+ if (stagedAdds.length > 0) {+ // Removing a staged addition just unstages it.+ staging.setAdds(pendingAdds.filter((product) => !removing.has(product.id)))+ }+ const persisted = ids.filter((id) => !pendingAddIds.has(id) && !pendingRemoveSet.has(id))+ if (persisted.length > 0) {+ staging.setRemoves([...pendingRemoves, ...persisted])+ }+ setSelected((prev) => prev.filter((id) => !removing.has(id)))+ }++ function restore(id: string) {+ staging.setRemoves(pendingRemoves.filter((existing) => existing !== id))+ }++ const curatable = canEdit && !readOnly++ // Only the persisted total — staged rows are marked in the list itself, and+ // netting them into the count reads as wrong next to the visible rows.+ const count = meta?.count ?? 0++ return (+ <Card className="overflow-hidden">+ <CardHeader className="flex flex-row items-center justify-between">+ <div>+ <CardTitle>+ {tr('title')}+ {count > 0 && (+ <span className="ml-2 font-normal text-muted-foreground text-sm">{count}</span>+ )}+ </CardTitle>+ {/* A read-only list explains itself first: it cannot be curated, so+ its own description outranks any staging left over from before+ the parent was switched to rule-driven membership. */}+ {staging.dirty && curatable ? (+ <CardDescription>{tr('pending_changes_hint')}</CardDescription>+ ) : (+ description && <CardDescription>{description}</CardDescription>+ )}+ </div>+ {curatable &&+ (selected.length > 0 ? (+ <Button+ type="button"+ variant="outline"+ size="sm"+ className="text-destructive hover:text-destructive"+ onClick={() => stageRemove(selected)}+ >+ <Trash2Icon className="size-4" />+ {tr('remove_selected', { count: selected.length })}+ </Button>+ ) : (+ <Button type="button" variant="outline" size="sm" onClick={() => setPickerOpen(true)}>+ <PlusIcon className="size-4" />+ {tr('add_cta')}+ </Button>+ ))}+ </CardHeader>+ <CardContent className="p-0">+ <ProductMembershipList+ rows={rows}+ loading={isLoading}+ meta={meta}+ onPageChange={setPage}+ readOnly={!curatable}+ selected={selected}+ onSelectedChange={setSelected}+ onRemove={(id) => stageRemove([id])}+ onRestore={restore}+ // Reorder writes through on drop, so it would fight the staged+ // rows: positions are computed against a list that is about to+ // change. Disabled until the staged changes are saved.+ reorderable={Boolean(onReorder) && curatable && !staging.dirty}+ onReorder={onReorder}+ renderTitle={(row) => (+ <Link+ to="/$storeId/products/$productId"+ params={{ storeId, productId: row.id }}+ className="truncate text-sm hover:underline"+ >+ {row.name}+ </Link>+ )}+ labels={{+ filterPlaceholder: tr('filter_placeholder'),+ clearFilter: t('admin.common.clear'),+ noMatches: tr('no_matches'),+ // `empty_automatic` only exists for parents that can be readOnly.+ empty: tr(readOnly ? 'empty_automatic' : 'empty'),+ loading: t('admin.common.loading'),+ columnProduct: tr('column_product'),+ selectAll: tr('select_all'),+ selectRow: tr('select_row'),+ remove: tr('remove'),+ restore: tr('restore'),+ pendingAddedBadge: tr('pending_added_badge'),+ }}+ />+ </CardContent>++ {curatable && (+ <ResourcePickerSheet<Product>+ open={pickerOpen}+ onOpenChange={setPickerOpen}+ queryKey={`${translationNamespace}-${parentId}-products-picker`}+ // Pending removals are excluded: the picker locks its `selectedIds`+ // as "already in, not re-addable", so leaving them in would grey out+ // a product the merchant just removed and leave the row's restore+ // arrow as the only way back.+ selectedIds={rows.filter((row) => row.pending !== 'removed').map((row) => row.id)}+ onConfirm={(_, records) => {+ // Re-picking a product staged for removal cancels that removal —+ // it is still a member, so staging it as an addition too would+ // render the row twice and then add it back after the delete.+ const picked = new Set(records.map((record) => record.id))+ if (pendingRemoves.some((id) => picked.has(id))) {+ staging.setRemoves(pendingRemoves.filter((id) => !picked.has(id)))+ }+ const fresh = records.filter(+ (record) => !pendingAddIds.has(record.id) && !pendingRemoveSet.has(record.id),+ )+ if (fresh.length > 0) staging.setAdds([...pendingAdds, ...fresh])+ }}+ search={(q) => adminClient.products.list({ name_cont: q, limit: 25, sort: 'name' })}+ getOptionLabel={(p) => p.name ?? p.id}+ getOptionImageUrl={(p) => p.thumbnail_url}+ getOptionSubtitle={(p) => p.slug ?? null}+ title={tr('picker_title')}+ description={tr('picker_description')}+ searchPlaceholder={tr('search_placeholder')}+ />+ )}+ </Card>+ )+}diff --git a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsxindex 09e68ce5ad..854466b42f 100644--- a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx+++ b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx@@ -130,7 +130,7 @@ export function TaxLinesCard({ order }: { order: Order }) {</TableHead></TableRow></TableHeader>- <TableBody className="border-t border-border">+ <TableBody>{[...taxGroups.values()].map((group) => (<TableRow key={group.label}><TableCell>{group.label}</TableCell>@@ -207,7 +207,7 @@ export function OrderDiscountsCard({ order }: { order: Order }) {<TableHead className="w-10" /></TableRow></TableHeader>- <TableBody className="border-t border-border">+ <TableBody>{discountRows.map((row) => (<TableRow key={row.id}><TableCell>{row.label}</TableCell>@@ -290,7 +290,7 @@ export function FeesCard({ order }: { order: Order }) {<TableHead className="w-10" /></TableRow></TableHeader>- <TableBody className="border-t border-border">+ <TableBody>{feeRows.map((row) => (<TableRow key={row.id}><TableCell>{row.label}</TableCell>diff --git a/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx b/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsxindex 19ff162359..50816cd47c 100644--- a/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx+++ b/packages/dashboard/src/components/spree/price-list-editors/price-list-form.tsx@@ -6,10 +6,11 @@ import {formatStoreDateTime,PageHeader,PreferencesForm,- ResourceMultiAutocomplete,+ useResourceKey,useStore,} from '@spree/dashboard-core'import { DropdownMenuItem, useConfirm } from '@spree/dashboard-ui'+import { useQueryClient } from '@tanstack/react-query'import {CalendarOffIcon,PauseIcon,@@ -24,6 +25,11 @@ import { Controller, type UseFormReturn, useFieldArray, useForm } from 'react-hoimport { useTranslation } from 'react-i18next'import { spreeJsonLinkResolver } from '../../../lib/json-link-resolver'import { BulkPriceEditorDialog } from '../bulk-price-editor/bulk-price-editor-dialog'+import { DeferredProductMembershipCard } from '../deferred-product-membership-card'+import {+ flushProductMembership,+ ProductMembershipStagingProvider,+} from '../product-membership-staging'import { PriceListStatusBadge } from './status-badge'// Side-effect import — registers per-rule editors (customer, customer// group, …) into the slot registry. Must run before any RuleEditSheet@@ -62,8 +68,11 @@ import {} from '@spree/dashboard-ui'import {useActivatePriceList,+ useAddPriceListProducts,useDeactivatePriceList,+ usePriceListProducts,usePriceRuleTypes,+ useRemovePriceListProducts,} from '../../../hooks/use-price-lists'import {MATCH_POLICIES,@@ -112,6 +121,7 @@ export function PriceListForm({const { storeId } = useStore()const { permissions } = usePermissions()const canDelete = permissions.can('destroy', Subject.PriceList)+ const canEdit = permissions.can('update', Subject.PriceList)const form = useForm<PriceListFormValues>({// eslint-disable-next-line @typescript-eslint/no-explicit-any@@ -125,6 +135,14 @@ export function PriceListForm({keyName: '_key',})+ // Membership stages into the form and flushes through the nested products+ // endpoints on Save. Create mode has no products card — the list has to+ // exist before it can price anything.+ const queryClient = useQueryClient()+ const productsKey = useResourceKey('price-lists', priceList?.id ?? 'noop', 'products')+ const addProducts = useAddPriceListProducts(priceList?.id ?? '')+ const removeProducts = useRemovePriceListProducts(priceList?.id ?? '')+// biome-ignore lint/correctness/useExhaustiveDependencies: form is stableuseEffect(() => {if (mode !== 'edit') return@@ -136,13 +154,25 @@ export function PriceListForm({ends_at: priceList.ends_at,match_policy: (priceList.match_policy as 'all' | 'any') ?? 'all',rules: initialRules.map(ruleDraftFromRule),- product_ids: priceList.product_ids ?? [],+ staged_products: { adds: [], removes: [] },})}, [mode, priceList, initialRules])async function handleSubmit(values: PriceListFormValues) {try {await onSubmit(priceListValuesToParams(values))+ // Membership flushes after the list itself saves, so a validation+ // failure aborts before any membership write.+ if (priceList) {+ await flushProductMembership({+ staging: values.staged_products,+ add: (ids) => addProducts.mutateAsync(ids),+ remove: (ids) => removeProducts.mutateAsync(ids),+ queryClient,+ productsKey,+ })+ form.reset({ ...values, staged_products: { adds: [], removes: [] } })+ }} catch (err) {if (!mapSpreeErrorsToForm(err, form.setError)) throw err}@@ -159,81 +189,104 @@ export function PriceListForm({}return (- <form onSubmit={form.handleSubmit(handleSubmit)}>- <ResourceLayout- header={- <PageHeader- title={- mode === 'create'- ? t('admin.pages.products.price_lists.sheet_title_create')- : (priceList?.name ?? '')- }- backTo="products/price-lists"- badges={priceList && <PriceListStatusBadge priceList={priceList} />}- // `dropdownItems` rather than `onDelete`: the caller already runs- // its own confirm, naming the price list being deleted, and- // `onDelete` would stack the header's generic prompt in front of it.- dropdownItems={- mode === 'edit' && onDelete && canDelete ? (- <DropdownMenuItem variant="destructive" disabled={deletePending} onClick={onDelete}>- {t('admin.actions.delete')}- </DropdownMenuItem>- ) : undefined- }- jsonPreview={- mode === 'edit' && priceList- ? {- title: `Price list ${priceList.name}`,- fetch: () => adminClient.priceLists.get(priceList.id),- endpoint: `/api/v3/admin/price_lists/${priceList.id}`,- resolveLink: spreeJsonLinkResolver(storeId),- }- : undefined- }- actions={- <div className="flex gap-2">- {mode === 'edit' && priceList && <ActivationButtons priceList={priceList} />}- <Button- type="submit"- disabled={- form.formState.isSubmitting || (mode === 'edit' && !form.formState.isDirty)- }+ <ProductMembershipStagingProvider form={form} name="staged_products">+ <form onSubmit={form.handleSubmit(handleSubmit)}>+ <ResourceLayout+ header={+ <PageHeader+ title={+ mode === 'create'+ ? t('admin.pages.products.price_lists.sheet_title_create')+ : (priceList?.name ?? '')+ }+ backTo="products/price-lists"+ badges={priceList && <PriceListStatusBadge priceList={priceList} />}+ // `dropdownItems` rather than `onDelete`: the caller already runs+ // its own confirm, naming the price list being deleted, and+ // `onDelete` would stack the header's generic prompt in front of it.+ dropdownItems={+ mode === 'edit' && onDelete && canDelete ? (+ <DropdownMenuItem+ variant="destructive"+ disabled={deletePending}+ onClick={onDelete}+ >+ {t('admin.actions.delete')}+ </DropdownMenuItem>+ ) : undefined+ }+ jsonPreview={+ mode === 'edit' && priceList+ ? {+ title: `Price list ${priceList.name}`,+ fetch: () => adminClient.priceLists.get(priceList.id),+ endpoint: `/api/v3/admin/price_lists/${priceList.id}`,+ resolveLink: spreeJsonLinkResolver(storeId),+ }+ : undefined+ }+ actions={+ <div className="flex gap-2">+ {mode === 'edit' && priceList && canEdit && (+ <EditPricesButton priceList={priceList} />+ )}+ {mode === 'edit' && priceList && <ActivationButtons priceList={priceList} />}+ <Button+ type="submit"+ disabled={+ form.formState.isSubmitting || (mode === 'edit' && !form.formState.isDirty)+ }+ >+ {form.formState.isSubmitting+ ? mode === 'create'+ ? t('admin.actions.creating')+ : t('admin.actions.saving')+ : mode === 'create'+ ? t('admin.actions.create')+ : t('admin.actions.save')}+ </Button>+ </div>+ }+ />+ }+ main={+ <>+ {form.formState.errors.root?.message && (+ <p+ className="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive"+ role="alert">- {form.formState.isSubmitting- ? mode === 'create'- ? t('admin.actions.creating')- : t('admin.actions.saving')- : mode === 'create'- ? t('admin.actions.create')- : t('admin.actions.save')}- </Button>- </div>- }- />- }- main={- <>- {form.formState.errors.root?.message && (- <p- className="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive"- role="alert"- >- {form.formState.errors.root.message}- </p>- )}- <RulesCard form={form} rulesArray={rulesArray} />- <ProductsCard form={form} />- {mode === 'edit' && priceList && <PricesCard priceList={priceList} />}- </>- }- sidebar={- <>- <BasicsCard form={form} />- <ScheduleCard form={form} />- </>- }- />- </form>+ {form.formState.errors.root.message}+ </p>+ )}+ <RulesCard form={form} rulesArray={rulesArray} />+ {mode === 'edit' && priceList && (+ <DeferredProductMembershipCard+ parentId={priceList.id}+ storeId={storeId}+ canEdit={canEdit}+ useProducts={usePriceListProducts}+ translationNamespace="admin.pages.products.price_lists"+ description={+ (priceList.prices_count ?? 0) > 0+ ? t('admin.pages.products.price_lists.products_help_with_prices', {+ count: priceList.prices_count ?? 0,+ })+ : t('admin.pages.products.price_lists.products_help')+ }+ />+ )}+ </>+ }+ sidebar={+ <>+ <BasicsCard form={form} />+ <ScheduleCard form={form} />+ </>+ }+ />+ </form>+ </ProductMembershipStagingProvider>)}@@ -855,82 +908,21 @@ function DefaultRuleEditor({ draft, onSave, onClose }: PriceRuleEditorContext) {)}-// =============================================================================-// Products card — inline multi-autocomplete + link to spreadsheet-// =============================================================================-/**- * Products that belong to the price list. The picker writes directly to- * the form's `product_ids` field — on Save the whole list ships in the- * same PATCH that handles name, schedule, and rules. No separate- * add/remove endpoints, no sheet.- *- * The spreadsheet for filling in the actual amounts is rendered as a- * sibling card below, so adding a product here causes its variant rows- * to appear (after Save) in the Prices card without any navigation.+ * Opens the bulk price spreadsheet from the page header. It used to be a card+ * below the products table, where a long assortment pushed it off-screen — it+ * holds no content of its own, only this action.*/-function ProductsCard({ form }: { form: UseFormReturn<PriceListFormValues> }) {- const { t } = useTranslation()- const productIds = form.watch('product_ids')-- return (- <Card>- <CardHeader>- <CardTitle>{t('admin.pages.products.price_lists.products_section')}</CardTitle>- <p className="mt-1 text-xs text-muted-foreground">- {t('admin.pages.products.price_lists.products_help')}- </p>- </CardHeader>- <CardContent>- <Controller- name="product_ids"- control={form.control}- render={({ field }) => (- <ResourceMultiAutocomplete- queryKey="price-list-products"- value={field.value}- onChange={field.onChange}- search={(q) => adminClient.products.list({ name_cont: q, limit: 10, sort: 'name' })}- hydrate={(ids) => adminClient.products.list({ id_in: ids, limit: ids.length })}- getOptionLabel={(p) => p.name ?? p.id}- placeholder={t('admin.pages.products.price_lists.products_search_placeholder')}- emptyText={t('admin.pages.products.price_lists.products_empty_search')}- />- )}- />- {productIds.length > 0 && (- <p className="mt-2 text-xs text-muted-foreground">- {t('admin.pages.products.price_lists.products_selected', {- count: productIds.length,- })}- </p>- )}- </CardContent>- </Card>- )-}--function PricesCard({ priceList }: { priceList: PriceList }) {+function EditPricesButton({ priceList }: { priceList: PriceList }) {const { t } = useTranslation()const [editorOpen, setEditorOpen] = useState(false)- const count = priceList.prices_count ?? 0return (<>- <Card>- <CardHeader className="flex flex-row items-center justify-between gap-3 space-y-0">- <div>- <CardTitle>{t('admin.common.prices')}</CardTitle>- <p className="mt-1 text-xs text-muted-foreground">- {t('admin.pages.products.price_lists.prices_help', { count })}- </p>- </div>- <Button type="button" size="sm" variant="outline" onClick={() => setEditorOpen(true)}>- <TableIcon className="mr-1 size-4" />- {t('admin.pages.products.price_lists.edit_prices_cta')}- </Button>- </CardHeader>- </Card>+ <Button type="button" variant="outline" onClick={() => setEditorOpen(true)}>+ <TableIcon className="size-4" />+ {t('admin.pages.products.price_lists.edit_prices_cta')}+ </Button><BulkPriceEditorDialog open={editorOpen} onOpenChange={setEditorOpen} priceList={priceList} /></>)diff --git a/packages/dashboard/src/components/spree/product-membership-card.tsx b/packages/dashboard/src/components/spree/product-membership-card.tsxdeleted file mode 100644index 5d1c04199c..0000000000--- a/packages/dashboard/src/components/spree/product-membership-card.tsx+++ /dev/null@@ -1,431 +0,0 @@-import {- closestCenter,- DndContext,- type DragEndEvent,- KeyboardSensor,- PointerSensor,- useSensor,- useSensors,-} from '@dnd-kit/core'-import {- arrayMove,- SortableContext,- sortableKeyboardCoordinates,- useSortable,- verticalListSortingStrategy,-} from '@dnd-kit/sortable'-import { CSS } from '@dnd-kit/utilities'-import type { PaginationMeta, Product } from '@spree/admin-sdk'-import { adminClient, ResourcePickerSheet } from '@spree/dashboard-core'-import {- Button,- Card,- CardContent,- CardDescription,- CardHeader,- CardTitle,- Checkbox,- cn,- DragHandle,- Pagination,- SearchInput,- Table,- TableBody,- TableCell,- TableHead,- TableHeader,- TableRow,- Thumbnail,- useConfirm,-} from '@spree/dashboard-ui'-import { Link } from '@tanstack/react-router'-import { PlusIcon, Trash2Icon, XIcon } from 'lucide-react'-import { useEffect, useMemo, useState } from 'react'-import { useTranslation } from 'react-i18next'--/**- * The five mutations/queries a grouping needs to own its product membership.- * `use-categories` and `use-collections` both expose exactly this shape, which- * is what lets one card serve both.- */-export interface ProductMembershipHooks {- useProducts: (- parentId: string | undefined,- page?: number,- ) => { data?: { data: Product[]; meta: PaginationMeta }; isLoading: boolean }- useAdd: (parentId: string) => { mutateAsync: (productIds: string[]) => Promise<unknown> }- useRemoveOne: (parentId: string) => { mutate: (productId: string) => void }- useRemoveMany: (parentId: string) => {- mutateAsync: (productIds: string[]) => Promise<unknown>- isPending: boolean- }- useReposition: (parentId: string) => {- mutate: (- vars: { productId: string; new_position: number },- opts?: { onError?: () => void },- ) => void- }-}--/**- * Product membership for a category or collection: add via the picker sheet,- * select rows to bulk-remove, remove a single row inline, drag to reorder,- * click a product to open its detail page.- *- * Every write persists immediately — this panel is not part of the surrounding- * form's save cycle — so both removals confirm first, and the confirm copy says- * the change is immediate.- *- * Pass `readOnly` when membership is derived rather than curated (an automatic- * collection materializes its members from rules): the list still renders, but- * the checkboxes, drag handles, remove buttons and picker all disappear.- */-export function ProductMembershipCard({- parentId,- storeId,- hooks,- translationNamespace,- readOnly = false,- description,-}: {- parentId: string- storeId: string- hooks: ProductMembershipHooks- /** Locale namespace holding the `products.*` copy, e.g. `admin.collections`. */- translationNamespace: string- readOnly?: boolean- /** Rendered under the title — used to explain a read-only list. */- description?: string-}) {- const { t } = useTranslation()- const confirm = useConfirm()- const tr = (key: string, options?: Record<string, unknown>) =>- t(`${translationNamespace}.products.${key}`, options ?? {})-- const [page, setPage] = useState(1)- const { data, isLoading } = hooks.useProducts(parentId, page)- const meta = data?.meta- const addProducts = hooks.useAdd(parentId)- const removeProduct = hooks.useRemoveOne(parentId)- const removeProducts = hooks.useRemoveMany(parentId)- const reposition = hooks.useReposition(parentId)-- const [pickerOpen, setPickerOpen] = useState(false)- const [selected, setSelected] = useState<Set<string>>(new Set())- const [query, setQuery] = useState('')-- // Local order mirrors the server page so a drag re-renders instantly; the- // reposition mutation invalidates and re-syncs.- const [order, setOrder] = useState<Product[]>([])- useEffect(() => {- if (data?.data) setOrder(data.data)- }, [data])-- // Drop stale selections when the underlying list changes (after a removal).- useEffect(() => {- setSelected((prev) => {- const present = new Set(order.map((p) => p.id))- const next = new Set([...prev].filter((id) => present.has(id)))- return next.size === prev.size ? prev : next- })- }, [order])-- const sensors = useSensors(- useSensor(PointerSensor, { activationConstraint: { distance: 5 } }),- useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),- )-- const ids = useMemo(() => order.map((p) => p.id), [order])-- // Client-side quick filter over the current page. While a filter is active,- // drag-reorder is disabled — reordering a filtered subset would compute- // positions against the wrong neighbours.- const trimmedQuery = query.trim().toLowerCase()- const filtering = trimmedQuery.length > 0- const visible = useMemo(- () =>- filtering ? order.filter((p) => (p.name ?? '').toLowerCase().includes(trimmedQuery)) : order,- [order, filtering, trimmedQuery],- )- const visibleIds = useMemo(() => visible.map((p) => p.id), [visible])-- function handleDragEnd(event: DragEndEvent) {- const { active, over } = event- if (!over || active.id === over.id) return- const from = order.findIndex((p) => p.id === active.id)- const to = order.findIndex((p) => p.id === over.id)- if (from === -1 || to === -1) return- const previousOrder = order- setOrder(arrayMove(order, from, to)) // optimistic- reposition.mutate(- // `to` is an index within the current page; the endpoint wants a 0-based- // index across the whole grouping. `meta.from` is 1-based.- { productId: String(active.id), new_position: (meta?.from ?? 1) - 1 + to },- { onError: () => setOrder(previousOrder) }, // roll back if the move fails- )- }-- function toggleSelected(id: string) {- setSelected((prev) => {- const next = new Set(prev)- if (next.has(id)) next.delete(id)- else next.add(id)- return next- })- }-- // Operate only on the currently-visible (filtered) rows so "select all" never- // pulls in hidden products that a later bulk-remove would delete unseen.- function toggleAll() {- setSelected((prev) => {- if (visibleIds.length > 0 && visibleIds.every((id) => prev.has(id))) {- const next = new Set(prev)- for (const id of visibleIds) next.delete(id)- return next- }- return new Set([...prev, ...visibleIds])- })- }-- // Both removals fire straight from a click with no sheet to review, so each- // confirms first.- async function handleBulkRemove() {- const ids = [...selected]- if (ids.length === 0) return-- const ok = await confirm({- title: tr('remove_confirm.title'),- message: tr('remove_confirm.message', { count: ids.length }),- confirmLabel: t('admin.actions.remove'),- variant: 'destructive',- })- if (!ok) return-- try {- await removeProducts.mutateAsync(ids)- setSelected(new Set())- } catch {- // The mutation toasts its own error; swallow the rethrow so the click- // handler doesn't reject, and keep the selection so the user can retry.- }- }-- async function handleRemoveOne(product: Product) {- const ok = await confirm({- title: tr('remove_confirm.title'),- message: tr('remove_confirm.message_named', { name: product.name ?? '' }),- confirmLabel: t('admin.actions.remove'),- variant: 'destructive',- })- if (!ok) return-- removeProduct.mutate(product.id)- }-- const allSelected = visibleIds.length > 0 && visibleIds.every((id) => selected.has(id))- const hasSelection = selected.size > 0- const curatable = !readOnly-- return (- <Card className="overflow-hidden">- <CardHeader className="flex flex-row items-center justify-between">- <div>- <CardTitle>- {tr('title')}- {(meta?.count ?? 0) > 0 && (- <span className="ml-2 font-normal text-muted-foreground text-sm">{meta?.count}</span>- )}- </CardTitle>- {description && <CardDescription>{description}</CardDescription>}- </div>- {curatable &&- (hasSelection ? (- <Button- type="button"- variant="outline"- size="sm"- className="text-destructive hover:text-destructive"- onClick={handleBulkRemove}- disabled={removeProducts.isPending}- >- <Trash2Icon className="size-4" />- {tr('remove_selected', { count: selected.size })}- </Button>- ) : (- <Button type="button" variant="outline" size="sm" onClick={() => setPickerOpen(true)}>- <PlusIcon className="size-4" />- {tr('add_cta')}- </Button>- ))}- </CardHeader>- <CardContent className="p-0">- {isLoading ? (- <p className="p-6 text-muted-foreground text-sm">{t('admin.common.loading')}</p>- ) : order.length === 0 ? (- <p className="p-6 text-muted-foreground text-sm">- {/* `empty_automatic` only exists for groupings that can be readOnly. */}- {tr(readOnly ? 'empty_automatic' : 'empty')}- </p>- ) : (- <>- <div className="border-border border-b p-3">- <SearchInput- value={query}- onValueChange={setQuery}- onKeyDown={(e) => e.key === 'Enter' && e.preventDefault()}- placeholder={tr('filter_placeholder')}- clearLabel={t('admin.common.clear')}- />- </div>- {visible.length === 0 ? (- <p className="p-6 text-muted-foreground text-sm">{tr('no_matches')}</p>- ) : (- <DndContext- sensors={sensors}- collisionDetection={closestCenter}- onDragEnd={handleDragEnd}- >- <Table>- <TableHeader>- <TableRow>- {curatable && (- <TableHead className="w-10">- <Checkbox- checked={allSelected}- onCheckedChange={toggleAll}- aria-label={tr('select_all')}- />- </TableHead>- )}- <TableHead className="w-8" />- <TableHead>{tr('column_product')}</TableHead>- <TableHead className="w-10" />- </TableRow>- </TableHeader>- <SortableContext items={ids} strategy={verticalListSortingStrategy}>- <TableBody className="border-t border-border">- {visible.map((product) => (- <ProductRow- key={product.id}- product={product}- storeId={storeId}- curatable={curatable}- // Reorder only makes sense over the full page; disable- // the drag handle while a filter narrows the rows.- reorderable={curatable && !filtering}- selected={selected.has(product.id)}- onToggleSelected={() => toggleSelected(product.id)}- onRemove={() => handleRemoveOne(product)}- removeLabel={tr('remove')}- selectRowLabel={tr('select_row')}- />- ))}- </TableBody>- </SortableContext>- </Table>- </DndContext>- )}- {/* Pagination brings its own top border + padding. */}- {meta && <Pagination meta={meta} onPageChange={setPage} />}- </>- )}- </CardContent>-- {curatable && (- <ResourcePickerSheet<Product>- open={pickerOpen}- onOpenChange={setPickerOpen}- queryKey={`${translationNamespace}-${parentId}-products`}- selectedIds={ids}- onConfirm={async (picked) => {- await addProducts.mutateAsync(picked)- }}- search={(q) => adminClient.products.list({ name_cont: q, limit: 25, sort: 'name' })}- getOptionLabel={(p) => p.name ?? p.id}- getOptionImageUrl={(p) => p.thumbnail_url}- getOptionSubtitle={(p) => p.slug ?? null}- title={tr('picker_title')}- description={tr('picker_description')}- searchPlaceholder={tr('search_placeholder')}- />- )}- </Card>- )-}--function ProductRow({- product,- storeId,- curatable,- reorderable,- selected,- onToggleSelected,- onRemove,- removeLabel,- selectRowLabel,-}: {- product: Product- storeId: string- curatable: boolean- reorderable: boolean- selected: boolean- onToggleSelected: () => void- onRemove: () => void- removeLabel: string- selectRowLabel: string-}) {- const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({- id: product.id,- disabled: !reorderable,- })-- return (- <tr- ref={setNodeRef}- style={{ transform: CSS.Transform.toString(transform), transition }}- // Mirror <TableRow> styling — a plain <tr> is required so dnd-kit's- // setNodeRef attaches (TableRow doesn't forward refs).- className={cn(- 'group/row last:*:border-b-0 hover:bg-accent/60',- selected && 'bg-accent/60 hover:bg-accent',- isDragging && 'relative z-10 opacity-70',- )}- >- {curatable && (- <TableCell>- <Checkbox- checked={selected}- onCheckedChange={onToggleSelected}- aria-label={selectRowLabel}- />- </TableCell>- )}- <TableCell className="pr-0">- {reorderable && <DragHandle attributes={attributes} listeners={listeners} />}- </TableCell>- <TableCell>- <Link- to="/$storeId/products/$productId"- params={{ storeId, productId: product.id }}- className="flex items-center gap-3 hover:underline"- >- <Thumbnail src={product.thumbnail_url} size="sm" />- <span className="truncate text-sm">{product.name}</span>- </Link>- </TableCell>- <TableCell className="text-right">- {curatable && (- <Button- type="button"- variant="ghost"- size="icon"- onClick={onRemove}- aria-label={removeLabel}- >- <XIcon className="size-4" />- </Button>- )}- </TableCell>- </tr>- )-}diff --git a/packages/dashboard/src/components/spree/product-membership-staging.tsx b/packages/dashboard/src/components/spree/product-membership-staging.tsxnew file mode 100644index 0000000000..cadfb66741--- /dev/null+++ b/packages/dashboard/src/components/spree/product-membership-staging.tsx@@ -0,0 +1,133 @@+import type { Product } from '@spree/admin-sdk'+import type { QueryClient, QueryKey } from '@tanstack/react-query'+import { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react'+import { type FieldValues, type Path, type UseFormReturn, useController } from 'react-hook-form'++/**+ * The staged membership edits a deferred products card reads and writes.+ * Held in the surrounding form rather than in the card, so the page's Save+ * and Discard govern them like any other field.+ */+export interface ProductMembershipStaging {+ adds: Product[]+ removes: string[]+ setAdds: (products: Product[]) => void+ setRemoves: (ids: string[]) => void+ /** True when anything is staged — drives the "applies on save" hint. */+ dirty: boolean+ /** Clears both sets. Called after a successful flush. */+ reset: () => void+}++const StagingContext = createContext<ProductMembershipStaging | null>(null)++/** The staged value as it lives in form state. */+export interface ProductMembershipStagingValue {+ adds: Product[]+ removes: string[]+}++export const EMPTY_STAGING: ProductMembershipStagingValue = { adds: [], removes: [] }++/**+ * Backs the staged membership with a real form field, so react-hook-form+ * owns it: `isDirty` flips when a product is staged (enabling Save and the+ * unsaved-changes guards), and Discard rolls it back with everything else.+ *+ * The field holds `Product` records rather than ids alone, because a staged+ * addition has to render a name and thumbnail before it exists server-side.+ * Keep the field out of the schema's parsed output — `useController` reads+ * and writes it directly, and the submit handler consumes it before the Zod+ * parse strips it.+ */+export function ProductMembershipStagingProvider<TFieldValues extends FieldValues>({+ form,+ name,+ children,+}: {+ form: UseFormReturn<TFieldValues, any, any>+ /** Form field holding the staged sets, e.g. `staged_products`. */+ name: Path<TFieldValues>+ children: ReactNode+}) {+ const { field } = useController({ control: form.control, name })+ const value = (field.value as ProductMembershipStagingValue | undefined) ?? EMPTY_STAGING++ const setAdds = useCallback(+ (adds: Product[]) => field.onChange({ ...value, adds }),+ [field, value],+ )+ const setRemoves = useCallback(+ (removes: string[]) => field.onChange({ ...value, removes }),+ [field, value],+ )+ const reset = useCallback(() => field.onChange(EMPTY_STAGING), [field])++ const staging = useMemo<ProductMembershipStaging>(+ () => ({+ adds: value.adds,+ removes: value.removes,+ setAdds,+ setRemoves,+ dirty: value.adds.length > 0 || value.removes.length > 0,+ reset,+ }),+ [value, setAdds, setRemoves, reset],+ )++ return <StagingContext.Provider value={staging}>{children}</StagingContext.Provider>+}++/**+ * The staged membership for the surrounding form. Throws outside a provider+ * rather than silently staging into nothing, which would look like a card+ * that accepts edits and drops them on Save.+ */+export function useProductMembershipStaging(): ProductMembershipStaging {+ const staging = useContext(StagingContext)+ if (!staging) {+ throw new Error(+ 'useProductMembershipStaging must be used inside <ProductMembershipStagingProvider>',+ )+ }+ return staging+}++/**+ * Applies staged membership through a parent's nested products endpoints,+ * then refreshes the list once.+ *+ * Removals go first, so a product removed and re-added in one session ends+ * with fresh membership rather than a delete landing on top of the re-add.+ *+ * The single refresh at the end is the point: the individual writes don't+ * invalidate, and the parent's own update holds the products list back, so+ * the list keeps its pre-save rows — staged ones still pinned on top — until+ * everything is written. Without that it refetches mid-save and paints the+ * old membership for a frame before the real state lands.+ *+ * Awaited, so the fresh rows are in the cache before the caller resets the+ * form. The two have to land in one commit: reset first and the staged rows+ * vanish a frame before the server's arrive (the list drops to its pre-save+ * contents); refresh first without awaiting and both are drawn at once, so+ * every added product appears twice.+ */+export async function flushProductMembership({+ staging,+ add,+ remove,+ queryClient,+ productsKey,+}: {+ staging: ProductMembershipStagingValue+ add: (productIds: string[]) => Promise<unknown>+ remove: (productIds: string[]) => Promise<unknown>+ queryClient: QueryClient+ /** Store-scoped key prefix of the nested products query. */+ productsKey: QueryKey+}): Promise<void> {+ if (staging.removes.length > 0) await remove(staging.removes)+ if (staging.adds.length > 0) await add(staging.adds.map((product) => product.id))++ await queryClient.invalidateQueries({ queryKey: productsKey })+}diff --git a/packages/dashboard/src/hooks/use-catalogs.ts b/packages/dashboard/src/hooks/use-catalogs.tsindex 2fb984fd26..7dec862772 100644--- a/packages/dashboard/src/hooks/use-catalogs.ts+++ b/packages/dashboard/src/hooks/use-catalogs.ts@@ -55,7 +55,7 @@ export function useDeleteCatalog() {}// ----------------------------------------------------------------------------// Assortment — the ProductMembershipHooks shape ProductMembershipCard expects+// Assortment// ---------------------------------------------------------------------------export function useCatalogProducts(catalogId: string | undefined, page = 1) {@@ -67,51 +67,33 @@ export function useCatalogProducts(catalogId: string | undefined, page = 1) {})}-export function useAddCatalogProducts(catalogId: string) {- return useResourceMutation<{ added_count: number }, Error, string[]>({- mutationFn: (productIds) => adminClient.catalogs.products.create(catalogId, productIds),- invalidate: [- ['catalogs', catalogId, 'products'],- ['catalogs', catalogId],- ],- successMessage: i18n.t('admin.catalogs.messages.products_added'),- errorMessage: i18n.t('admin.errors.failed_to_update'),- })-}--export function useRemoveCatalogProduct(catalogId: string) {- return useResourceMutation<void, Error, string>({- mutationFn: (productId) => adminClient.catalogs.products.delete(catalogId, productId),- invalidate: [- ['catalogs', catalogId, 'products'],- ['catalogs', catalogId],- ],- successMessage: i18n.t('admin.catalogs.messages.product_removed'),- errorMessage: i18n.t('admin.errors.failed_to_update'),- })-}--export function useRemoveCatalogProducts(catalogId: string) {- return useResourceMutation<unknown, Error, string[]>({- mutationFn: (productIds) =>- Promise.all(- productIds.map((productId) => adminClient.catalogs.products.delete(catalogId, productId)),- ),- invalidate: [- ['catalogs', catalogId, 'products'],- ['catalogs', catalogId],- ],- successMessage: i18n.t('admin.catalogs.messages.products_removed'),- errorMessage: i18n.t('admin.errors.failed_to_update'),- })+export interface CatalogSavePayload {+ /** Settings PATCH body; omitted when the form is clean. */+ attributes?: CatalogParams+ /** Staged assortment additions, flushed on Save. */+ addProductIds?: string[]+ /** Staged assortment removals, flushed on Save. */+ removeProductIds?: string[]}-export function useRepositionCatalogProduct(catalogId: string) {- return useResourceMutation<void, Error, { productId: string; new_position: number }>({- mutationFn: ({ productId, new_position }) =>- adminClient.catalogs.products.reposition(catalogId, productId, new_position),- invalidate: [['catalogs', catalogId, 'products']],- successMessage: false,+/**+ * One-shot save for the catalog page: settings plus the staged membership+ * changes, in one mutation with one toast. Settings go first so a+ * validation failure aborts before any membership write.+ */+export function useSaveCatalog(catalogId: string) {+ return useResourceMutation<void, Error, CatalogSavePayload>({+ mutationFn: async ({ attributes, addProductIds = [], removeProductIds = [] }) => {+ if (attributes) await adminClient.catalogs.update(catalogId, attributes)+ if (removeProductIds.length > 0) {+ await adminClient.catalogs.products.delete(catalogId, removeProductIds)+ }+ if (addProductIds.length > 0) {+ await adminClient.catalogs.products.create(catalogId, addProductIds)+ }+ },+ invalidate: [['catalogs'], ['catalogs', catalogId], ['catalogs', catalogId, 'products']],+ successMessage: i18n.t('admin.catalogs.messages.updated'),errorMessage: i18n.t('admin.errors.failed_to_update'),})}@@ -123,7 +105,10 @@ export function useRepositionCatalogProduct(catalogId: string) {export function useImportCatalogPriceListProducts(catalogId: string) {return useResourceMutation<{ added_count: number }, Error, void>({mutationFn: () => adminClient.catalogs.importProducts(catalogId),- invalidate: [['catalogs', catalogId]],+ invalidate: [+ ['catalogs', catalogId],+ ['catalogs', catalogId, 'products'],+ ],successMessage: i18n.t('admin.catalogs.messages.products_imported'),errorMessage: i18n.t('admin.errors.failed_to_update'),})diff --git a/packages/dashboard/src/hooks/use-categories.ts b/packages/dashboard/src/hooks/use-categories.tsindex f86d8554f7..665d7ef348 100644--- a/packages/dashboard/src/hooks/use-categories.ts+++ b/packages/dashboard/src/hooks/use-categories.ts@@ -53,7 +53,12 @@ export function useCreateCategory() {export function useUpdateCategory(id: string) {return useResourceMutation<Category, Error, CategoryUpdateParams>({mutationFn: (params) => adminClient.categories.update(id, params),+ // The nested products list is held back: it prefix-matches+ // `['categories', id]`, and this update runs before the membership flush+ // inside the page's Save — refreshing it there paints the pre-save rows+ // for a frame. The flush refreshes it once, at the end.invalidate: [['categories'], ['categories', id]],+ doNotInvalidate: ['products'],successMessage: i18n.t('admin.categories.messages.updated'),errorMessage: i18n.t('admin.errors.failed_to_update'),})@@ -109,34 +114,31 @@ export function useCategoryProducts(categoryId: string | undefined, page = 1, li/** Add one or many products to a category in a single request. */export function useAddCategoryProducts(categoryId: string) {return useResourceMutation<unknown, Error, string[]>({- mutationFn: (productIds) =>- adminClient.products.bulkAddToCategories({ ids: productIds, category_ids: [categoryId] }),- invalidate: [categoryProductsKey(categoryId), ['categories']],+ mutationFn: (productIds) => adminClient.categories.products.create(categoryId, productIds),+ // No invalidate: this runs inside the page's Save, and the parent's own+ // update mutation already invalidates `['categories']`, which prefix-matches+ // the products list. Invalidating here too refetches mid-flush — once+ // before the membership is written — which renders the pre-save list for a+ // frame before the final state lands.+ // Silent: this runs inside the page's Save, whose own mutation reports+ // the outcome — a second toast per flush would stack on it.+ successMessage: false,errorMessage: i18n.t('admin.errors.failed_to_update'),})}-export function useRemoveCategoryProduct(categoryId: string) {- return useResourceMutation<void, Error, string>({- mutationFn: (productId) => adminClient.categories.products.remove(categoryId, productId),- invalidate: [categoryProductsKey(categoryId), ['categories']],- errorMessage: i18n.t('admin.errors.failed_to_update'),- })-}--/**- * Remove many products from a category in one request. Reuses the existing- * products bulk endpoint (the same one the product-list bulk actions use) —- * no category-specific bulk route needed.- */+/** Remove many products from a category in one request. */export function useRemoveCategoryProducts(categoryId: string) {return useResourceMutation<unknown, Error, string[]>({- mutationFn: (productIds) =>- adminClient.products.bulkRemoveFromCategories({- ids: productIds,- category_ids: [categoryId],- }),- invalidate: [categoryProductsKey(categoryId), ['categories']],+ mutationFn: (productIds) => adminClient.categories.products.delete(categoryId, productIds),+ // No invalidate: this runs inside the page's Save, and the parent's own+ // update mutation already invalidates `['categories']`, which prefix-matches+ // the products list. Invalidating here too refetches mid-flush — once+ // before the membership is written — which renders the pre-save list for a+ // frame before the final state lands.+ // Silent: this runs inside the page's Save, whose own mutation reports+ // the outcome — a second toast per flush would stack on it.+ successMessage: false,errorMessage: i18n.t('admin.errors.failed_to_update'),})}diff --git a/packages/dashboard/src/hooks/use-collections.ts b/packages/dashboard/src/hooks/use-collections.tsindex b9c2f6d93c..19f3f2f8d3 100644--- a/packages/dashboard/src/hooks/use-collections.ts+++ b/packages/dashboard/src/hooks/use-collections.ts@@ -48,7 +48,12 @@ export function useCreateCollection() {export function useUpdateCollection(id: string) {return useResourceMutation<Collection, Error, CollectionUpdateParams>({mutationFn: (params) => adminClient.collections.update(id, params),+ // The nested products list is held back: it prefix-matches+ // `['collections', id]`, and this update runs before the membership flush+ // inside the page's Save — refreshing it there paints the pre-save rows+ // for a frame. The flush refreshes it once, at the end.invalidate: [['collections'], ['collections', id]],+ doNotInvalidate: ['products'],successMessage: i18n.t('admin.collections.messages.updated'),errorMessage: i18n.t('admin.errors.failed_to_update'),})@@ -111,20 +116,15 @@ export function useCollectionProducts(collectionId: string | undefined, page = 1/** Add one or many products to a manual collection in a single request. */export function useAddCollectionProducts(collectionId: string) {return useResourceMutation<unknown, Error, string[]>({- mutationFn: (productIds) =>- adminClient.products.bulkAddToCollections({- ids: productIds,- collection_ids: [collectionId],- }),- invalidate: [collectionProductsKey(collectionId), ['collections']],- errorMessage: i18n.t('admin.errors.failed_to_update'),- })-}--export function useRemoveCollectionProduct(collectionId: string) {- return useResourceMutation<void, Error, string>({- mutationFn: (productId) => adminClient.collections.products.remove(collectionId, productId),- invalidate: [collectionProductsKey(collectionId), ['collections']],+ mutationFn: (productIds) => adminClient.collections.products.create(collectionId, productIds),+ // No invalidate: this runs inside the page's Save, and the parent's own+ // update mutation already invalidates `['collections']`, which prefix-matches+ // the products list. Invalidating here too refetches mid-flush — once+ // before the membership is written — which renders the pre-save list for a+ // frame before the final state lands.+ // Silent: this runs inside the page's Save, whose own mutation reports+ // the outcome — a second toast per flush would stack on it.+ successMessage: false,errorMessage: i18n.t('admin.errors.failed_to_update'),})}@@ -132,12 +132,15 @@ export function useRemoveCollectionProduct(collectionId: string) {/** Remove many products from a collection in one request. */export function useRemoveCollectionProducts(collectionId: string) {return useResourceMutation<unknown, Error, string[]>({- mutationFn: (productIds) =>- adminClient.products.bulkRemoveFromCollections({- ids: productIds,- collection_ids: [collectionId],- }),- invalidate: [collectionProductsKey(collectionId), ['collections']],+ mutationFn: (productIds) => adminClient.collections.products.delete(collectionId, productIds),+ // No invalidate: this runs inside the page's Save, and the parent's own+ // update mutation already invalidates `['collections']`, which prefix-matches+ // the products list. Invalidating here too refetches mid-flush — once+ // before the membership is written — which renders the pre-save list for a+ // frame before the final state lands.+ // Silent: this runs inside the page's Save, whose own mutation reports+ // the outcome — a second toast per flush would stack on it.+ successMessage: false,errorMessage: i18n.t('admin.errors.failed_to_update'),})}diff --git a/packages/dashboard/src/hooks/use-price-lists.ts b/packages/dashboard/src/hooks/use-price-lists.tsindex dffaf8c151..c5a696b313 100644--- a/packages/dashboard/src/hooks/use-price-lists.ts+++ b/packages/dashboard/src/hooks/use-price-lists.ts@@ -29,7 +29,12 @@ export function useCreatePriceList() {export function useUpdatePriceList(id: string) {return useResourceMutation<PriceList, Error, PriceListUpdateParams>({mutationFn: (params) => adminClient.priceLists.update(id, params),+ // The nested products list is held back: it prefix-matches+ // `['price-lists', id]`, and this update runs before the membership flush+ // inside the page's Save — refreshing it there paints the pre-save rows+ // for a frame. The flush refreshes it once, at the end.invalidate: [['price-lists'], ['price-lists', id]],+ doNotInvalidate: ['products'],successMessage: i18n.t('admin.products.price_lists.messages.updated'),errorMessage: i18n.t('admin.errors.failed_to_update'),})@@ -68,6 +73,41 @@ export function useDeactivatePriceList(id: string) {})}+// ---------------------------------------------------------------------------+// Product membership — the uniform nested surface, staged in the editor and+// flushed on Save (deferred card).+// ---------------------------------------------------------------------------++export function usePriceListProducts(priceListId: string | undefined, page = 1) {+ return useQuery({+ queryKey: useResourceKey('price-lists', priceListId ?? 'noop', 'products', `${page}`),+ queryFn: () => adminClient.priceLists.products.list(priceListId as string, { page, limit: 25 }),+ enabled: !!priceListId,+ placeholderData: (previous) => previous,+ })+}++// Both flush mutations stay silent — they run inside the editor's Save,+// whose update mutation already reports the outcome.++export function useAddPriceListProducts(priceListId: string) {+ return useResourceMutation<{ added_count: number }, Error, string[]>({+ mutationFn: (productIds) => adminClient.priceLists.products.create(priceListId, productIds),+ // No invalidate: the flush refreshes the list once, after every write.+ successMessage: false,+ errorMessage: i18n.t('admin.errors.failed_to_update'),+ })+}++export function useRemovePriceListProducts(priceListId: string) {+ return useResourceMutation<{ removed_count: number }, Error, string[]>({+ mutationFn: (productIds) => adminClient.priceLists.products.delete(priceListId, productIds),+ // No invalidate: the flush refreshes the list once, after every write.+ successMessage: false,+ errorMessage: i18n.t('admin.errors.failed_to_update'),+ })+}+// Prices ride along on `useUpdatePriceList` — there's no separate// mutation hook for the spreadsheet anymore.diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex c0aeed1103..2e7d9ab6d2 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -127,10 +127,7 @@"assigned": "تم تعيين الكتالوج","created": "تم إنشاء الكتالوج","deleted": "تم حذف الكتالوج",- "product_removed": "تمت إزالة المنتج",- "products_added": "تمت إضافة المنتجات","products_imported": "تم استيراد المنتجات",- "products_removed": "تمت إزالة المنتجات","unassigned": "تمت إزالة التعيين","updated": "تم تحديث الكتالوج"},@@ -140,19 +137,13 @@"empty": "لا توجد منتجات في هذا الكتالوج بعد.","filter_placeholder": "تصفية المنتجات…","no_matches": "لا توجد منتجات مطابقة للتصفية.",+ "pending_added_badge": "جديد",+ "pending_changes_hint": "تُطبَّق تغييرات قائمة المنتجات عند الحفظ.","picker_description": "ابحث واختر منتجات لإضافتها إلى هذا الكتالوج.","picker_title": "إضافة منتجات إلى الكتالوج","remove": "إزالة من الكتالوج",- "remove_confirm": {- "message_few": "إزالة {{count}} منتجات من هذا الكتالوج؟ يسري ذلك فورًا. تبقى المنتجات في متجرك.",- "message_many": "إزالة {{count}} منتجًا من هذا الكتالوج؟ يسري ذلك فورًا. تبقى المنتجات في متجرك.",- "message_named": "إزالة \"{{name}}\" من هذا الكتالوج؟ يسري ذلك فورًا. يبقى المنتج في متجرك.",- "message_one": "إزالة منتج واحد من هذا الكتالوج؟ يسري ذلك فورًا. تبقى المنتجات في متجرك.",- "message_other": "إزالة {{count}} منتج من هذا الكتالوج؟ يسري ذلك فورًا. تبقى المنتجات في متجرك.",- "message_two": "إزالة منتجين من هذا الكتالوج؟ يسري ذلك فورًا. تبقى المنتجات في متجرك.",- "title": "إزالة من الكتالوج"- },"remove_selected": "إزالة",+ "restore": "استعادة","search_placeholder": "البحث في المنتجات…","select_all": "تحديد الكل","select_row": "تحديد المنتج",@@ -203,16 +194,13 @@"empty": "لا توجد منتجات في هذه الفئة بعد.","filter_placeholder": "تصفية المنتجات…","no_matches": "لا توجد منتجات تطابق عامل التصفية.",+ "pending_added_badge": "جديد",+ "pending_changes_hint": "تُطبَّق تغييرات قائمة المنتجات عند الحفظ.","picker_description": "ابحث وحدد المنتجات لإضافتها إلى هذه الفئة.","picker_title": "إضافة منتجات إلى الفئة","remove": "إزالة من الفئة",- "remove_confirm": {- "message_named": "إزالة «{{name}}» من هذه الفئة؟ يسري التغيير فورًا. سيبقى المنتج في الكتالوج.",- "message_one": "إزالة {{count}} منتج من هذه الفئة؟ يسري التغيير فورًا. ستبقى المنتجات في الكتالوج.",- "message_other": "إزالة {{count}} منتجات من هذه الفئة؟ يسري التغيير فورًا. ستبقى المنتجات في الكتالوج.",- "title": "إزالة من الفئة"- },"remove_selected": "إزالة",+ "restore": "استعادة","search_placeholder": "البحث عن المنتجات…","select_all": "تحديد الكل","select_row": "تحديد المنتج",@@ -297,16 +285,13 @@"empty_automatic": "لا توجد منتجات مطابقة للقواعد بعد.","filter_placeholder": "تصفية المنتجات…","no_matches": "لا توجد منتجات مطابقة للتصفية.",+ "pending_added_badge": "جديد",+ "pending_changes_hint": "تُطبَّق تغييرات قائمة المنتجات عند الحفظ.","picker_description": "ابحث واختر منتجات لإضافتها إلى هذه المجموعة.","picker_title": "إضافة منتجات إلى المجموعة","remove": "إزالة من المجموعة",- "remove_confirm": {- "message_named": "إزالة «{{name}}» من هذه المجموعة؟ يسري التغيير فورًا. سيبقى المنتج في الكتالوج.",- "message_one": "إزالة {{count}} منتج من هذه المجموعة؟ يسري التغيير فورًا. ستبقى المنتجات في الكتالوج.",- "message_other": "إزالة {{count}} منتجات من هذه المجموعة؟ يسري التغيير فورًا. ستبقى المنتجات في الكتالوج.",- "title": "إزالة من المجموعة"- },"remove_selected": "إزالة",+ "restore": "استعادة","search_placeholder": "ابحث عن منتجات…","select_all": "تحديد الكل","select_row": "تحديد المنتج",@@ -3004,7 +2989,6 @@"title": "تفعيل قائمة الأسعار؟"},"add_cta": "قائمة الأسعار الجديدة",- "add_products_cta": "أضف المنتجات","add_rule": "أضف القاعدة","add_rule_help": "اختر نوع القاعدة لتكوينه.","basics_section": "الأساسيات",@@ -3055,16 +3039,27 @@},"edit_prices_cta": "تحرير الأسعار","no_changes": "لا توجد تغييرات للحفظ.",- "prices_help_one": "{{count}} تم تكوين السعر. افتح المحرر المجمع لتحديثه.",- "prices_help_other": "{{count}} الأسعار مضبوطة. افتح المحرر المجمع لتحديثها.",- "prices_help_zero": "اختر المنتجات أعلاه لتحديد أسعار العناصر النائبة، ثم افتح المحرر المجمع.",- "products_empty": "لا توجد منتجات حتى الآن — أضف منتجًا لبدء تعديل الأسعار.",- "products_empty_search": "لا توجد منتجات متطابقة",- "products_help": "اختر المنتجات التي تنطبق عليها هذه القائمة. يتم إنشاء أسعار العناصر النائبة عند الحفظ - املأها أدناه.",- "products_search_placeholder": "البحث عن المنتجات بالاسم…",- "products_section": "منتجات",- "products_selected_one": "{{count}} المنتج المحدد.",- "products_selected_other": "{{count}} منتجات المختارة.",+ "products": {+ "add_cta": "إضافة منتجات",+ "column_product": "المنتج",+ "empty": "لا توجد منتجات بعد — أضف منتجًا لبدء تعديل الأسعار.",+ "filter_placeholder": "تصفية المنتجات…",+ "no_matches": "لا توجد منتجات مطابقة لعامل التصفية.",+ "pending_added_badge": "جديد",+ "pending_changes_hint": "تُطبَّق تغييرات قائمة المنتجات عند الحفظ.",+ "picker_description": "ابحث واختر المنتجات لإضافتها إلى قائمة الأسعار هذه.",+ "picker_title": "إضافة منتجات إلى قائمة الأسعار",+ "remove": "إزالة من قائمة الأسعار",+ "remove_selected": "إزالة",+ "restore": "استعادة",+ "search_placeholder": "البحث عن منتجات…",+ "select_all": "تحديد الكل",+ "select_row": "تحديد المنتج",+ "title": "المنتجات"+ },+ "products_help": "اختر المنتجات التي تنطبق عليها هذه القائمة. تُنشأ أسعار مؤقتة عند الحفظ — املأها عبر «تعديل الأسعار».",+ "products_help_with_prices_one": "اختر المنتجات التي تنطبق عليها هذه القائمة. تم ضبط سعر واحد ({{count}}) — استخدم «تعديل الأسعار» لتحديثه.",+ "products_help_with_prices_other": "اختر المنتجات التي تنطبق عليها هذه القائمة. تم ضبط {{count}} سعر — استخدم «تعديل الأسعار» لتحديثها.","remove_rule_confirm": {"message": "تتم إزالة القاعدة عند حفظ قائمة الأسعار.","title": "هل تريد إزالة القاعدة؟"diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 4c5a9e9cfc..4342494c00 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -127,10 +127,7 @@"assigned": "Katalog zugewiesen","created": "Katalog erstellt","deleted": "Katalog gelöscht",- "product_removed": "Produkt entfernt",- "products_added": "Produkte hinzugefügt","products_imported": "Produkte importiert",- "products_removed": "Produkte entfernt","unassigned": "Zuweisung entfernt","updated": "Katalog aktualisiert"},@@ -140,16 +137,13 @@"empty": "Noch keine Produkte in diesem Katalog.","filter_placeholder": "Produkte filtern…","no_matches": "Keine Produkte entsprechen Ihrem Filter.",+ "pending_added_badge": "Neu",+ "pending_changes_hint": "Änderungen an der Produktliste werden beim Speichern übernommen.","picker_description": "Produkte suchen und auswählen, um sie diesem Katalog hinzuzufügen.","picker_title": "Produkte zum Katalog hinzufügen","remove": "Aus Katalog entfernen",- "remove_confirm": {- "message_named": "\"{{name}}\" aus diesem Katalog entfernen? Dies gilt sofort. Das Produkt bleibt in Ihrem Shop.",- "message_one": "{{count}} Produkt aus diesem Katalog entfernen? Dies gilt sofort. Die Produkte bleiben in Ihrem Shop.",- "message_other": "{{count}} Produkte aus diesem Katalog entfernen? Dies gilt sofort. Die Produkte bleiben in Ihrem Shop.",- "title": "Aus Katalog entfernen"- },"remove_selected": "Entfernen",+ "restore": "Wiederherstellen","search_placeholder": "Produkte suchen…","select_all": "Alle auswählen","select_row": "Produkt auswählen",@@ -200,16 +194,13 @@"empty": "Noch keine Produkte in dieser Kategorie.","filter_placeholder": "Produkte filtern…","no_matches": "Keine Produkte entsprechen dem Filter.",+ "pending_added_badge": "Neu",+ "pending_changes_hint": "Änderungen an der Produktliste werden beim Speichern übernommen.","picker_description": "Suchen und wählen Sie Produkte für diese Kategorie aus.","picker_title": "Produkte zur Kategorie hinzufügen","remove": "Aus Kategorie entfernen",- "remove_confirm": {- "message_named": "„{{name}}“ aus dieser Kategorie entfernen? Die Änderung wird sofort wirksam. Das Produkt bleibt im Katalog.",- "message_one": "{{count}} Produkt aus dieser Kategorie entfernen? Die Änderung wird sofort wirksam. Die Produkte bleiben im Katalog.",- "message_other": "{{count}} Produkte aus dieser Kategorie entfernen? Die Änderung wird sofort wirksam. Die Produkte bleiben im Katalog.",- "title": "Aus Kategorie entfernen"- },"remove_selected": "Entfernen",+ "restore": "Wiederherstellen","search_placeholder": "Produkte suchen…","select_all": "Alle auswählen","select_row": "Produkt auswählen",@@ -294,16 +285,13 @@"empty_automatic": "Noch keine Produkte erfüllen die Regeln.","filter_placeholder": "Produkte filtern…","no_matches": "Keine Produkte entsprechen dem Filter.",+ "pending_added_badge": "Neu",+ "pending_changes_hint": "Änderungen an der Produktliste werden beim Speichern übernommen.","picker_description": "Produkte suchen und zu dieser Kollektion hinzufügen.","picker_title": "Produkte zur Kollektion hinzufügen","remove": "Aus Kollektion entfernen",- "remove_confirm": {- "message_named": "„{{name}}“ aus dieser Kollektion entfernen? Die Änderung wird sofort wirksam. Das Produkt bleibt im Katalog.",- "message_one": "{{count}} Produkt aus dieser Kollektion entfernen? Die Änderung wird sofort wirksam. Die Produkte bleiben im Katalog.",- "message_other": "{{count}} Produkte aus dieser Kollektion entfernen? Die Änderung wird sofort wirksam. Die Produkte bleiben im Katalog.",- "title": "Aus Kollektion entfernen"- },"remove_selected": "Entfernen",+ "restore": "Wiederherstellen","search_placeholder": "Produkte suchen…","select_all": "Alle auswählen","select_row": "Produkt auswählen",@@ -2988,7 +2976,6 @@"title": "Preisliste aktivieren?"},"add_cta": "Neue Preisliste",- "add_products_cta": "Produkte hinzufügen","add_rule": "Regel hinzufügen","add_rule_help": "Wählen Sie einen Regeltyp zum Konfigurieren.","basics_section": "Grunddaten",@@ -3039,16 +3026,27 @@},"edit_prices_cta": "Preise bearbeiten","no_changes": "Keine Änderungen zum Speichern.",- "prices_help_one": "{{count}} Preis konfiguriert. Öffnen Sie den Mehrfacheditor, um ihn zu aktualisieren.",- "prices_help_other": "{{count}} Preise konfiguriert. Öffnen Sie den Mehrfacheditor, um sie zu aktualisieren.",- "prices_help_zero": "Wählen Sie oben Produkte aus, um Platzhalterpreise anzulegen, und öffnen Sie dann den Mehrfacheditor.",- "products_empty": "Noch keine Produkte — fügen Sie eins hinzu, um die Preisbearbeitung zu starten.",- "products_empty_search": "Keine passenden Produkte",- "products_help": "Wählen Sie die Produkte, für die diese Liste gilt. Platzhalterpreise werden beim Speichern erstellt — füllen Sie sie unten aus.",- "products_search_placeholder": "Produkte nach Namen suchen…",- "products_section": "Produkte",- "products_selected_one": "{{count}} Produkt ausgewählt.",- "products_selected_other": "{{count}} Produkte ausgewählt.",+ "products": {+ "add_cta": "Produkte hinzufügen",+ "column_product": "Produkt",+ "empty": "Noch keine Produkte – fügen Sie eines hinzu, um Preise zu bearbeiten.",+ "filter_placeholder": "Produkte filtern…",+ "no_matches": "Keine Produkte entsprechen Ihrem Filter.",+ "pending_added_badge": "Neu",+ "pending_changes_hint": "Änderungen an der Produktliste werden beim Speichern übernommen.",+ "picker_description": "Suchen und wählen Sie Produkte für diese Preisliste aus.",+ "picker_title": "Produkte zur Preisliste hinzufügen",+ "remove": "Aus der Preisliste entfernen",+ "remove_selected": "Entfernen",+ "restore": "Wiederherstellen",+ "search_placeholder": "Produkte suchen…",+ "select_all": "Alle auswählen",+ "select_row": "Produkt auswählen",+ "title": "Produkte"+ },+ "products_help": "Wählen Sie die Produkte, für die diese Liste gilt. Platzhalterpreise werden beim Speichern angelegt — über „Preise bearbeiten\" ausfüllen.",+ "products_help_with_prices_one": "Wählen Sie die Produkte, für die diese Liste gilt. {{count}} Preis ist hinterlegt — über „Preise bearbeiten\" anpassen.",+ "products_help_with_prices_other": "Wählen Sie die Produkte, für die diese Liste gilt. {{count}} Preise sind hinterlegt — über „Preise bearbeiten\" anpassen.","remove_rule_confirm": {"message": "Die Regel wird entfernt, wenn Sie die Preisliste speichern.","title": "Regel entfernen?"diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex 21851eea8c..9759bce4f6 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -127,10 +127,7 @@"assigned": "Catalog assigned","created": "Catalog created","deleted": "Catalog deleted",- "product_removed": "Product removed",- "products_added": "Products added","products_imported": "Products imported",- "products_removed": "Products removed","unassigned": "Assignment removed","updated": "Catalog updated"},@@ -140,16 +137,13 @@"empty": "No products in this catalog yet.","filter_placeholder": "Filter products…","no_matches": "No products match your filter.",+ "pending_added_badge": "New",+ "pending_changes_hint": "Changes to the product list apply when you save.","picker_description": "Search and select products to add to this catalog.","picker_title": "Add products to catalog","remove": "Remove from catalog",- "remove_confirm": {- "message_named": "Remove \"{{name}}\" from this catalog? This takes effect immediately. The product stays in your store.",- "message_one": "Remove {{count}} product from this catalog? This takes effect immediately. The products stay in your store.",- "message_other": "Remove {{count}} products from this catalog? This takes effect immediately. The products stay in your store.",- "title": "Remove from catalog"- },"remove_selected": "Remove",+ "restore": "Restore","search_placeholder": "Search products…","select_all": "Select all","select_row": "Select product",@@ -200,16 +194,13 @@"empty": "No products in this category yet.","filter_placeholder": "Filter products…","no_matches": "No products match your filter.",+ "pending_added_badge": "New",+ "pending_changes_hint": "Changes to the product list apply when you save.","picker_description": "Search and select products to add to this category.","picker_title": "Add products to category","remove": "Remove from category",- "remove_confirm": {- "message_named": "Remove \"{{name}}\" from this category? This takes effect immediately. The product stays in your catalog.",- "message_one": "Remove {{count}} product from this category? This takes effect immediately. The products stay in your catalog.",- "message_other": "Remove {{count}} products from this category? This takes effect immediately. The products stay in your catalog.",- "title": "Remove from category"- },"remove_selected": "Remove",+ "restore": "Restore","search_placeholder": "Search products…","select_all": "Select all","select_row": "Select product",@@ -294,16 +285,13 @@"empty_automatic": "No products match the rules yet.","filter_placeholder": "Filter products…","no_matches": "No products match your filter.",+ "pending_added_badge": "New",+ "pending_changes_hint": "Changes to the product list apply when you save.","picker_description": "Search and select products to add to this collection.","picker_title": "Add products to collection","remove": "Remove from collection",- "remove_confirm": {- "message_named": "Remove \"{{name}}\" from this collection? This takes effect immediately. The product stays in your catalog.",- "message_one": "Remove {{count}} product from this collection? This takes effect immediately. The products stay in your catalog.",- "message_other": "Remove {{count}} products from this collection? This takes effect immediately. The products stay in your catalog.",- "title": "Remove from collection"- },"remove_selected": "Remove",+ "restore": "Restore","search_placeholder": "Search products…","select_all": "Select all","select_row": "Select product",@@ -2988,7 +2976,6 @@"title": "Activate price list?"},"add_cta": "New price list",- "add_products_cta": "Add products","add_rule": "Add rule","add_rule_help": "Pick a rule type to configure.","basics_section": "Basics",@@ -3039,16 +3026,27 @@},"edit_prices_cta": "Edit prices","no_changes": "No changes to save.",- "prices_help_one": "{{count}} price configured. Open the bulk editor to update it.",- "prices_help_other": "{{count}} prices configured. Open the bulk editor to update them.",- "prices_help_zero": "Pick products above to seed placeholder prices, then open the bulk editor.",- "products_empty": "No products yet — add one to start editing prices.",- "products_empty_search": "No products match",- "products_help": "Pick the products this list applies to. Placeholder prices are created on save — fill them in below.",- "products_search_placeholder": "Search products by name…",- "products_section": "Products",- "products_selected_one": "{{count}} product selected.",- "products_selected_other": "{{count}} products selected.",+ "products": {+ "add_cta": "Add products",+ "column_product": "Product",+ "empty": "No products yet — add one to start editing prices.",+ "filter_placeholder": "Filter products…",+ "no_matches": "No products match your filter.",+ "pending_added_badge": "New",+ "pending_changes_hint": "Changes to the product list apply when you save.",+ "picker_description": "Search and select products to add to this price list.",+ "picker_title": "Add products to price list",+ "remove": "Remove from price list",+ "remove_selected": "Remove",+ "restore": "Restore",+ "search_placeholder": "Search products…",+ "select_all": "Select all",+ "select_row": "Select product",+ "title": "Products"+ },+ "products_help": "Pick the products this list applies to. Placeholder prices are created on save — fill them in with Edit prices.",+ "products_help_with_prices_one": "Pick the products this list applies to. {{count}} price is configured — use Edit prices to update it.",+ "products_help_with_prices_other": "Pick the products this list applies to. {{count}} prices are configured — use Edit prices to update them.","remove_rule_confirm": {"message": "The rule is removed when you save the price list.","title": "Remove rule?"diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 7fdc31bc64..517d55ef73 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -127,10 +127,7 @@"assigned": "Catalogue affecté","created": "Catalogue créé","deleted": "Catalogue supprimé",- "product_removed": "Produit retiré",- "products_added": "Produits ajoutés","products_imported": "Produits importés",- "products_removed": "Produits retirés","unassigned": "Affectation retirée","updated": "Catalogue mis à jour"},@@ -140,16 +137,13 @@"empty": "Aucun produit dans ce catalogue pour le moment.","filter_placeholder": "Filtrer les produits…","no_matches": "Aucun produit ne correspond à votre filtre.",+ "pending_added_badge": "Nouveau",+ "pending_changes_hint": "Les modifications de la liste de produits s'appliquent à l'enregistrement.","picker_description": "Recherchez et sélectionnez des produits à ajouter à ce catalogue.","picker_title": "Ajouter des produits au catalogue","remove": "Retirer du catalogue",- "remove_confirm": {- "message_named": "Retirer « {{name}} » de ce catalogue ? Effet immédiat. Le produit reste dans votre boutique.",- "message_one": "Retirer {{count}} produit de ce catalogue ? Effet immédiat. Les produits restent dans votre boutique.",- "message_other": "Retirer {{count}} produits de ce catalogue ? Effet immédiat. Les produits restent dans votre boutique.",- "title": "Retirer du catalogue"- },"remove_selected": "Retirer",+ "restore": "Restaurer","search_placeholder": "Rechercher des produits…","select_all": "Tout sélectionner","select_row": "Sélectionner le produit",@@ -200,16 +194,13 @@"empty": "Aucun produit dans cette catégorie pour le moment.","filter_placeholder": "Filtrer les produits…","no_matches": "Aucun produit ne correspond au filtre.",+ "pending_added_badge": "Nouveau",+ "pending_changes_hint": "Les modifications de la liste de produits s'appliquent à l'enregistrement.","picker_description": "Recherchez et sélectionnez des produits à ajouter à cette catégorie.","picker_title": "Ajouter des produits à la catégorie","remove": "Retirer de la catégorie",- "remove_confirm": {- "message_named": "Retirer « {{name}} » de cette catégorie ? L'effet est immédiat. Le produit reste dans votre catalogue.",- "message_one": "Retirer {{count}} produit de cette catégorie ? L'effet est immédiat. Les produits restent dans votre catalogue.",- "message_other": "Retirer {{count}} produits de cette catégorie ? L'effet est immédiat. Les produits restent dans votre catalogue.",- "title": "Retirer de la catégorie"- },"remove_selected": "Retirer",+ "restore": "Restaurer","search_placeholder": "Rechercher des produits…","select_all": "Tout sélectionner","select_row": "Sélectionner le produit",@@ -294,16 +285,13 @@"empty_automatic": "Aucun produit ne correspond encore aux règles.","filter_placeholder": "Filtrer les produits…","no_matches": "Aucun produit ne correspond à votre filtre.",+ "pending_added_badge": "Nouveau",+ "pending_changes_hint": "Les modifications de la liste de produits s'appliquent à l'enregistrement.","picker_description": "Recherchez et sélectionnez des produits à ajouter à cette collection.","picker_title": "Ajouter des produits à la collection","remove": "Retirer de la collection",- "remove_confirm": {- "message_named": "Retirer « {{name}} » de cette collection ? L'effet est immédiat. Le produit reste dans votre catalogue.",- "message_one": "Retirer {{count}} produit de cette collection ? L'effet est immédiat. Les produits restent dans votre catalogue.",- "message_other": "Retirer {{count}} produits de cette collection ? L'effet est immédiat. Les produits restent dans votre catalogue.",- "title": "Retirer de la collection"- },"remove_selected": "Retirer",+ "restore": "Restaurer","search_placeholder": "Rechercher des produits…","select_all": "Tout sélectionner","select_row": "Sélectionner le produit",@@ -2988,7 +2976,6 @@"title": "Activer la liste de prix ?"},"add_cta": "Nouvelle liste de prix",- "add_products_cta": "Ajouter des produits","add_rule": "Ajouter une règle","add_rule_help": "Choisissez un type de règle à configurer.","basics_section": "Informations de base",@@ -3039,16 +3026,27 @@},"edit_prices_cta": "Modifier les prix","no_changes": "Aucune modification à enregistrer.",- "prices_help_one": "{{count}} prix configuré. Ouvrez l'éditeur groupé pour le mettre à jour.",- "prices_help_other": "{{count}} prix configurés. Ouvrez l'éditeur groupé pour les mettre à jour.",- "prices_help_zero": "Choisissez les produits ci-dessus pour générer des prix indicatifs, puis ouvrez l'éditeur groupé.",- "products_empty": "Aucun produit pour le moment — ajoutez-en un pour commencer à modifier les prix.",- "products_empty_search": "Aucun produit ne correspond",- "products_help": "Choisissez les produits auxquels cette liste s'applique. Des prix indicatifs sont créés à l'enregistrement — renseignez-les ci-dessous.",- "products_search_placeholder": "Rechercher des produits par nom…",- "products_section": "Produits",- "products_selected_one": "{{count}} produit sélectionné.",- "products_selected_other": "{{count}} produits sélectionnés.",+ "products": {+ "add_cta": "Ajouter des produits",+ "column_product": "Produit",+ "empty": "Aucun produit pour le moment — ajoutez-en un pour commencer à modifier les prix.",+ "filter_placeholder": "Filtrer les produits…",+ "no_matches": "Aucun produit ne correspond à votre filtre.",+ "pending_added_badge": "Nouveau",+ "pending_changes_hint": "Les modifications de la liste de produits s'appliquent à l'enregistrement.",+ "picker_description": "Recherchez et sélectionnez des produits à ajouter à cette liste de prix.",+ "picker_title": "Ajouter des produits à la liste de prix",+ "remove": "Retirer de la liste de prix",+ "remove_selected": "Retirer",+ "restore": "Restaurer",+ "search_placeholder": "Rechercher des produits…",+ "select_all": "Tout sélectionner",+ "select_row": "Sélectionner le produit",+ "title": "Produits"+ },+ "products_help": "Choisissez les produits auxquels cette liste s'applique. Des prix provisoires sont créés à l'enregistrement — renseignez-les via « Modifier les prix ».",+ "products_help_with_prices_one": "Choisissez les produits auxquels cette liste s'applique. {{count}} prix est configuré — utilisez « Modifier les prix » pour le mettre à jour.",+ "products_help_with_prices_other": "Choisissez les produits auxquels cette liste s'applique. {{count}} prix sont configurés — utilisez « Modifier les prix » pour les mettre à jour.","remove_rule_confirm": {"message": "La règle est supprimée lorsque vous enregistrez la liste de prix.","title": "Retirer la règle ?"diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 456b04cd58..ab09a1c874 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -129,10 +129,7 @@"assigned": "Katalog przypisany","created": "Katalog utworzony","deleted": "Katalog usunięty",- "product_removed": "Produkt usunięty",- "products_added": "Produkty dodane","products_imported": "Produkty zaimportowane",- "products_removed": "Produkty usunięte","unassigned": "Przypisanie usunięte","updated": "Katalog zaktualizowany"},@@ -142,18 +139,13 @@"empty": "Brak produktów w tym katalogu.","filter_placeholder": "Filtruj produkty…","no_matches": "Żaden produkt nie pasuje do filtra.",+ "pending_added_badge": "Nowy",+ "pending_changes_hint": "Zmiany na liście produktów zostaną zastosowane po zapisaniu.","picker_description": "Wyszukaj i wybierz produkty do dodania do tego katalogu.","picker_title": "Dodaj produkty do katalogu","remove": "Usuń z katalogu",- "remove_confirm": {- "message_few": "Usunąć {{count}} produkty z tego katalogu? Zmiana działa natychmiast. Produkty pozostają w sklepie.",- "message_many": "Usunąć {{count}} produktów z tego katalogu? Zmiana działa natychmiast. Produkty pozostają w sklepie.",- "message_named": "Usunąć „{{name}}” z tego katalogu? Zmiana działa natychmiast. Produkt pozostaje w sklepie.",- "message_one": "Usunąć {{count}} produkt z tego katalogu? Zmiana działa natychmiast. Produkty pozostają w sklepie.",- "message_other": "Usunąć {{count}} produktów z tego katalogu? Zmiana działa natychmiast. Produkty pozostają w sklepie.",- "title": "Usuń z katalogu"- },"remove_selected": "Usuń",+ "restore": "Przywróć","search_placeholder": "Szukaj produktów…","select_all": "Zaznacz wszystko","select_row": "Zaznacz produkt",@@ -204,18 +196,13 @@"empty": "Brak produktów w tej kategorii.","filter_placeholder": "Filtruj produkty…","no_matches": "Żaden produkt nie pasuje do filtra.",+ "pending_added_badge": "Nowy",+ "pending_changes_hint": "Zmiany na liście produktów zostaną zastosowane po zapisaniu.","picker_description": "Wyszukaj i wybierz produkty do dodania do tej kategorii.","picker_title": "Dodaj produkty do kategorii","remove": "Usuń z kategorii",- "remove_confirm": {- "message_few": "Usunąć {{count}} produkty z tej kategorii? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_many": "Usunąć {{count}} produktów z tej kategorii? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_named": "Usunąć „{{name}}” z tej kategorii? Zmiana zadziała natychmiast. Produkt pozostanie w katalogu.",- "message_one": "Usunąć {{count}} produkt z tej kategorii? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_other": "Usunąć {{count}} produktu z tej kategorii? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "title": "Usuń z kategorii"- },"remove_selected": "Usuń",+ "restore": "Przywróć","search_placeholder": "Szukaj produktów…","select_all": "Zaznacz wszystko","select_row": "Zaznacz produkt",@@ -300,18 +287,13 @@"empty_automatic": "Żaden produkt nie spełnia jeszcze reguł.","filter_placeholder": "Filtruj produkty…","no_matches": "Żaden produkt nie pasuje do filtra.",+ "pending_added_badge": "Nowy",+ "pending_changes_hint": "Zmiany na liście produktów zostaną zastosowane po zapisaniu.","picker_description": "Wyszukaj i wybierz produkty do dodania do tej kolekcji.","picker_title": "Dodaj produkty do kolekcji","remove": "Usuń z kolekcji",- "remove_confirm": {- "message_few": "Usunąć {{count}} produkty z tej kolekcji? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_many": "Usunąć {{count}} produktów z tej kolekcji? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_named": "Usunąć „{{name}}” z tej kolekcji? Zmiana zadziała natychmiast. Produkt pozostanie w katalogu.",- "message_one": "Usunąć {{count}} produkt z tej kolekcji? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "message_other": "Usunąć {{count}} produktu z tej kolekcji? Zmiana zadziała natychmiast. Produkty pozostaną w katalogu.",- "title": "Usuń z kolekcji"- },"remove_selected": "Usuń",+ "restore": "Przywróć","search_placeholder": "Szukaj produktów…","select_all": "Zaznacz wszystko","select_row": "Zaznacz produkt",@@ -3020,7 +3002,6 @@"title": "Aktywować cennik?"},"add_cta": "Nowy cennik",- "add_products_cta": "Dodaj produkty","add_rule": "Dodaj regułę","add_rule_help": "Wybierz typ reguły do skonfigurowania.","basics_section": "Podstawy",@@ -3079,20 +3060,27 @@},"edit_prices_cta": "Edytuj ceny","no_changes": "Brak zmian do zapisania.",- "prices_help_few": "Skonfigurowano {{count}} ceny. Otwórz edytor zbiorczy, aby je zaktualizować.",- "prices_help_many": "Skonfigurowano {{count}} cen. Otwórz edytor zbiorczy, aby je zaktualizować.",- "prices_help_one": "Skonfigurowano {{count}} cenę. Otwórz edytor zbiorczy, aby ją zaktualizować.",- "prices_help_other": "Skonfigurowano {{count}} cen. Otwórz edytor zbiorczy, aby je zaktualizować.",- "prices_help_zero": "Wybierz produkty powyżej, aby utworzyć ceny zastępcze, a następnie otwórz edytor zbiorczy.",- "products_empty": "Brak produktów — dodaj jeden, aby rozpocząć edycję cen.",- "products_empty_search": "Brak pasujących produktów",- "products_help": "Wybierz produkty, których dotyczy ten cennik. Ceny zastępcze zostaną utworzone podczas zapisywania — uzupełnij je poniżej.",- "products_search_placeholder": "Szukaj produktów po nazwie…",- "products_section": "Produkty",- "products_selected_few": "Wybrano {{count}} produkty.",- "products_selected_many": "Wybrano {{count}} produktów.",- "products_selected_one": "Wybrano {{count}} produkt.",- "products_selected_other": "Wybrano {{count}} produktów.",+ "products": {+ "add_cta": "Dodaj produkty",+ "column_product": "Produkt",+ "empty": "Brak produktów — dodaj produkt, aby zacząć edytować ceny.",+ "filter_placeholder": "Filtruj produkty…",+ "no_matches": "Żadne produkty nie pasują do filtra.",+ "pending_added_badge": "Nowy",+ "pending_changes_hint": "Zmiany na liście produktów zostaną zastosowane po zapisaniu.",+ "picker_description": "Wyszukaj i wybierz produkty do dodania do tego cennika.",+ "picker_title": "Dodaj produkty do cennika",+ "remove": "Usuń z cennika",+ "remove_selected": "Usuń",+ "restore": "Przywróć",+ "search_placeholder": "Szukaj produktów…",+ "select_all": "Zaznacz wszystkie",+ "select_row": "Wybierz produkt",+ "title": "Produkty"+ },+ "products_help": "Wybierz produkty, których dotyczy ten cennik. Ceny zastępcze zostaną utworzone przy zapisie — uzupełnij je przez „Edytuj ceny”.",+ "products_help_with_prices_one": "Wybierz produkty, których dotyczy ten cennik. Skonfigurowano {{count}} cenę — użyj „Edytuj ceny”, aby ją zaktualizować.",+ "products_help_with_prices_other": "Wybierz produkty, których dotyczy ten cennik. Skonfigurowano {{count}} ceny — użyj „Edytuj ceny”, aby je zaktualizować.","remove_rule_confirm": {"message": "Reguła zostanie usunięta po zapisaniu cennika.","title": "Usunąć regułę?"diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex cff62adde5..d4e5ad67ae 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -127,10 +127,7 @@"assigned": "目录已分配","created": "目录已创建","deleted": "目录已删除",- "product_removed": "产品已移除",- "products_added": "产品已添加","products_imported": "产品已导入",- "products_removed": "产品已移除","unassigned": "分配已移除","updated": "目录已更新"},@@ -140,15 +137,13 @@"empty": "该目录中暂无产品。","filter_placeholder": "筛选产品…","no_matches": "没有匹配筛选条件的产品。",+ "pending_added_badge": "新增",+ "pending_changes_hint": "产品列表的更改将在保存时生效。","picker_description": "搜索并选择要添加到该目录的产品。","picker_title": "向目录添加产品","remove": "从目录中移除",- "remove_confirm": {- "message_named": "将“{{name}}”从该目录中移除?立即生效。产品仍保留在您的商店中。",- "message_other": "将 {{count}} 个产品从该目录中移除?立即生效。产品仍保留在您的商店中。",- "title": "从目录中移除"- },"remove_selected": "移除",+ "restore": "恢复","search_placeholder": "搜索产品…","select_all": "全选","select_row": "选择产品",@@ -199,16 +194,13 @@"empty": "此分类中暂无商品。","filter_placeholder": "筛选商品…","no_matches": "没有商品匹配筛选条件。",+ "pending_added_badge": "新增",+ "pending_changes_hint": "产品列表的更改将在保存时生效。","picker_description": "搜索并选择要添加到此分类的商品。","picker_title": "向分类添加商品","remove": "从分类中移除",- "remove_confirm": {- "message_named": "从该分类中移除“{{name}}”吗?将立即生效。商品仍保留在目录中。",- "message_one": "从该分类中移除 {{count}} 件商品吗?将立即生效。商品仍保留在目录中。",- "message_other": "从该分类中移除 {{count}} 件商品吗?将立即生效。商品仍保留在目录中。",- "title": "从分类中移除"- },"remove_selected": "移除",+ "restore": "恢复","search_placeholder": "搜索商品…","select_all": "全选","select_row": "选择商品",@@ -293,16 +285,13 @@"empty_automatic": "暂无商品符合规则。","filter_placeholder": "筛选商品…","no_matches": "没有符合筛选条件的商品。",+ "pending_added_badge": "新增",+ "pending_changes_hint": "产品列表的更改将在保存时生效。","picker_description": "搜索并选择要添加到该系列的商品。","picker_title": "向系列添加商品","remove": "从系列中移除",- "remove_confirm": {- "message_named": "从该系列中移除“{{name}}”吗?将立即生效。商品仍保留在目录中。",- "message_one": "从该系列中移除 {{count}} 件商品吗?将立即生效。商品仍保留在目录中。",- "message_other": "从该系列中移除 {{count}} 件商品吗?将立即生效。商品仍保留在目录中。",- "title": "从系列中移除"- },"remove_selected": "移除",+ "restore": "恢复","search_placeholder": "搜索商品…","select_all": "全选","select_row": "选择商品",@@ -2980,7 +2969,6 @@"title": "激活价格列表?"},"add_cta": "新建价格表",- "add_products_cta": "添加商品","add_rule": "添加规则","add_rule_help": "选择要配置的规则类型。","basics_section": "基本信息",@@ -3031,16 +3019,27 @@},"edit_prices_cta": "编辑价格","no_changes": "没有需要保存的更改。",- "prices_help_one": "已配置 {{count}} 个价格。打开批量编辑器进行更新。",- "prices_help_other": "已配置 {{count}} 个价格。打开批量编辑器进行更新。",- "prices_help_zero": "在上方选择商品以生成占位价格,然后打开批量编辑器。",- "products_empty": "暂无商品——添加一个以开始编辑价格。",- "products_empty_search": "没有匹配的商品",- "products_help": "选择此价格表适用的商品。保存时会创建占位价格——请在下方填写。",- "products_search_placeholder": "按名称搜索商品…",- "products_section": "商品",- "products_selected_one": "已选择 {{count}} 个商品。",- "products_selected_other": "已选择 {{count}} 个商品。",+ "products": {+ "add_cta": "添加产品",+ "column_product": "产品",+ "empty": "还没有产品——添加一个以开始编辑价格。",+ "filter_placeholder": "筛选产品…",+ "no_matches": "没有符合筛选条件的产品。",+ "pending_added_badge": "新增",+ "pending_changes_hint": "产品列表的更改将在保存时生效。",+ "picker_description": "搜索并选择要添加到此价格表的产品。",+ "picker_title": "向价格表添加产品",+ "remove": "从价格表中移除",+ "remove_selected": "移除",+ "restore": "恢复",+ "search_placeholder": "搜索产品…",+ "select_all": "全选",+ "select_row": "选择产品",+ "title": "产品"+ },+ "products_help": "选择此价格表适用的产品。保存时会创建占位价格 — 使用“编辑价格”填写。",+ "products_help_with_prices_one": "选择此价格表适用的产品。已配置 {{count}} 个价格 — 使用“编辑价格”进行更新。",+ "products_help_with_prices_other": "选择此价格表适用的产品。已配置 {{count}} 个价格 — 使用“编辑价格”进行更新。","remove_rule_confirm": {"message": "保存价格列表时将移除该规则。","title": "移除规则?"diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/catalogs/$catalogId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/catalogs/$catalogId.tsxindex 6eb944ab6a..3b2ad796a5 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/catalogs/$catalogId.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/catalogs/$catalogId.tsx@@ -42,22 +42,19 @@ import {import { createFileRoute, useNavigate } from '@tanstack/react-router'import { PlusIcon, TrashIcon } from 'lucide-react'import { useEffect, useState } from 'react'-import { Controller, useForm } from 'react-hook-form'+import { Controller, type UseFormReturn, useForm } from 'react-hook-form'import { useTranslation } from 'react-i18next'-import { ProductMembershipCard } from '../../../../../components/spree/product-membership-card'+import { DeferredProductMembershipCard } from '../../../../../components/spree/deferred-product-membership-card'+import { ProductMembershipStagingProvider } from '../../../../../components/spree/product-membership-staging'import { ResourceDetailSkeleton } from '../../../../../components/spree/route-pending'import {- useAddCatalogProducts,useAssignCatalog,useCatalog,useCatalogProducts,useDeleteCatalog,useImportCatalogPriceListProducts,- useRemoveCatalogProduct,- useRemoveCatalogProducts,- useRepositionCatalogProduct,+ useSaveCatalog,useUnassignCatalog,- useUpdateCatalog,} from '../../../../../hooks/use-catalogs'import { spreeJsonLinkResolver } from '../../../../../lib/json-link-resolver'import {@@ -91,116 +88,139 @@ function CatalogDetailPage() {return <CatalogBody key={catalog.id} catalog={catalog} />}+/**+ * The whole page is one form, saved from the header: catalog settings and+ * the staged assortment changes flush together, so removing a product is+ * not final until Save — the same model as the price list editor.+ * Assignments stay immediate (their dialog is its own explicit commit).+ */function CatalogBody({ catalog }: { catalog: Catalog }) {const { t } = useTranslation()const { storeId } = Route.useParams()const navigate = useNavigate()const { permissions } = usePermissions()const deleteMutation = useDeleteCatalog()+ const saveMutation = useSaveCatalog(catalog.id)const canEdit = permissions.can('update', Subject.Catalog)- async function handleDelete() {- await deleteMutation.mutateAsync(catalog.id)- navigate({ to: '/$storeId/products/catalogs', params: { storeId } })- }-- return (- <ResourceLayout- header={- <PageHeader- title={catalog.name}- badges={- catalog.active ? undefined : (- <Badge variant="secondary">{t('admin.common.inactive')}</Badge>- )- }- backTo="products/catalogs"- resource={{ id: catalog.id }}- jsonPreview={{- title: `Catalog ${catalog.name}`,- fetch: () => adminClient.catalogs.get(catalog.id, { expand: ['assignments'] }),- endpoint: `/api/v3/admin/catalogs/${catalog.id}`,- resolveLink: spreeJsonLinkResolver(storeId),- }}- onDelete={permissions.can('destroy', Subject.Catalog) ? handleDelete : undefined}- deleteLabel={t('admin.catalogs.detail.delete_label')}- />- }- main={<CatalogProductsCard catalog={catalog} canEdit={canEdit} />}- sidebar={- <>- <CatalogSettingsCard catalog={catalog} canEdit={canEdit} />- <CatalogAssignmentsCard catalog={catalog} canEdit={canEdit} />- </>- }- />- )-}--// Adapters shaping the catalog mutations to the ProductMembershipHooks-// contract — custom hooks, so the rules of hooks stay satisfied.-function useRemoveOneCatalogProductAdapter(catalogId: string) {- const mutation = useRemoveCatalogProduct(catalogId)- return { mutate: (productId: string) => mutation.mutate(productId) }-}--function useRepositionCatalogProductAdapter(catalogId: string) {- const mutation = useRepositionCatalogProduct(catalogId)- return {- mutate: (vars: { productId: string; new_position: number }, opts?: { onError?: () => void }) =>- mutation.mutate(vars, opts),- }-}--function CatalogProductsCard({ catalog, canEdit }: { catalog: Catalog; canEdit: boolean }) {- const { storeId } = Route.useParams()-- return (- <ProductMembershipCard- parentId={catalog.id}- storeId={storeId}- translationNamespace="admin.catalogs"- readOnly={!canEdit}- hooks={{- useProducts: useCatalogProducts,- useAdd: useAddCatalogProducts,- useRemoveOne: useRemoveOneCatalogProductAdapter,- useRemoveMany: useRemoveCatalogProducts,- useReposition: useRepositionCatalogProductAdapter,- }}- />- )-}--function CatalogSettingsCard({ catalog, canEdit }: { catalog: Catalog; canEdit: boolean }) {- const { t } = useTranslation()- const updateMutation = useUpdateCatalog(catalog.id)- const importMutation = useImportCatalogPriceListProducts(catalog.id)-const form = useForm<CatalogFormValues>({// eslint-disable-next-line @typescript-eslint/no-explicit-anyresolver: zodResolver(catalogFormSchema) as any,defaultValues: CATALOG_DEFAULTS,})+ // Hydrate (and re-baseline after save) from the source row, unless the+ // merchant has unsaved edits in flight: importing from the price list+ // refetches the catalog mid-edit, and an unguarded reset would drop both+ // the settings being typed and any staged product changes.useEffect(() => {+ if (form.formState.isDirty) returnform.reset({name: catalog.name,active: catalog.active,price_list_id: catalog.price_list_id ?? '',+ staged_products: { adds: [], removes: [] },})}, [catalog, form])- async function onSubmit(values: CatalogFormValues) {+ async function handleDelete() {+ await deleteMutation.mutateAsync(catalog.id)+ navigate({ to: '/$storeId/products/catalogs', params: { storeId } })+ }++ async function handleSave(values: CatalogFormValues) {try {- await updateMutation.mutateAsync(catalogValuesToParams(values))- form.reset(values)+ await saveMutation.mutateAsync({+ attributes: catalogValuesToParams(values),+ addProductIds: values.staged_products.adds.map((product) => product.id),+ removeProductIds: values.staged_products.removes,+ })+ form.reset({ ...values, staged_products: { adds: [], removes: [] } })} catch (err) {if (!mapSpreeErrorsToForm(err, form.setError)) throw err}}+ return (+ <ProductMembershipStagingProvider form={form} name="staged_products">+ <form onSubmit={form.handleSubmit(handleSave)}>+ <ResourceLayout+ header={+ <PageHeader+ title={catalog.name}+ badges={+ catalog.active ? undefined : (+ <Badge variant="secondary">{t('admin.common.inactive')}</Badge>+ )+ }+ backTo="products/catalogs"+ resource={{ id: catalog.id }}+ jsonPreview={{+ title: `Catalog ${catalog.name}`,+ fetch: () => adminClient.catalogs.get(catalog.id, { expand: ['assignments'] }),+ endpoint: `/api/v3/admin/catalogs/${catalog.id}`,+ resolveLink: spreeJsonLinkResolver(storeId),+ }}+ onDelete={permissions.can('destroy', Subject.Catalog) ? handleDelete : undefined}+ deleteLabel={t('admin.catalogs.detail.delete_label')}+ actions={+ canEdit ? (+ <Button+ type="submit"+ disabled={form.formState.isSubmitting || !form.formState.isDirty}+ >+ {form.formState.isSubmitting+ ? t('admin.actions.saving')+ : t('admin.actions.save')}+ </Button>+ ) : undefined+ }+ />+ }+ main={+ <>+ {form.formState.errors.root?.message && (+ <p+ className="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive"+ role="alert"+ >+ {form.formState.errors.root.message}+ </p>+ )}+ <DeferredProductMembershipCard+ parentId={catalog.id}+ storeId={storeId}+ canEdit={canEdit}+ useProducts={useCatalogProducts}+ translationNamespace="admin.catalogs"+ />+ </>+ }+ sidebar={+ <>+ <CatalogSettingsCard catalog={catalog} form={form} canEdit={canEdit} />+ <CatalogAssignmentsCard catalog={catalog} canEdit={canEdit} />+ </>+ }+ />+ </form>+ </ProductMembershipStagingProvider>+ )+}++function CatalogSettingsCard({+ catalog,+ form,+ canEdit,+}: {+ catalog: Catalog+ form: UseFormReturn<CatalogFormValues>+ canEdit: boolean+}) {+ const { t } = useTranslation()+ const importMutation = useImportCatalogPriceListProducts(catalog.id)+const { errors } = form.formStatereturn (@@ -210,11 +230,6 @@ function CatalogSettingsCard({ catalog, canEdit }: { catalog: Catalog; canEdit:</CardHeader><CardContent><FieldGroup>- {errors.root?.message && (- <p className="text-destructive text-sm" role="alert">- {errors.root.message}- </p>- )}<Field><FieldLabel htmlFor="catalog-name">{t('admin.fields.name.label')}</FieldLabel><Input@@ -278,19 +293,6 @@ function CatalogSettingsCard({ catalog, canEdit }: { catalog: Catalog; canEdit:</label>)}/>-- {canEdit && (- <div className="flex justify-end">- <Button- type="button"- size="sm"- disabled={form.formState.isSubmitting || !form.formState.isDirty}- onClick={form.handleSubmit(onSubmit)}- >- {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}- </Button>- </div>- )}</FieldGroup></CardContent></Card>@@ -327,7 +329,7 @@ function CatalogAssignmentsCard({ catalog, canEdit }: { catalog: Catalog; canEdi<CardTitle>{t('admin.catalogs.assignments.title')}</CardTitle>{canEdit && (<CardAction>- <Button size="sm" variant="outline" onClick={() => setAddOpen(true)}>+ <Button size="sm" variant="outline" type="button" onClick={() => setAddOpen(true)}><PlusIcon className="size-4" />{t('admin.catalogs.assignments.add_cta')}</Button>@@ -353,6 +355,7 @@ function CatalogAssignmentsCard({ catalog, canEdit }: { catalog: Catalog; canEdi<Buttonvariant="ghost"size="icon-xs"+ type="button"onClick={() => handleUnassign(assignment)}aria-label={t('admin.actions.delete')}>diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/categories/$categoryId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/categories/$categoryId.tsxindex 37dca2a940..5ca3fbaa03 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/categories/$categoryId.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/categories/$categoryId.tsx@@ -7,6 +7,7 @@ import {mapSpreeErrorsToForm,PageHeader,Slot,+ useResourceKey,} from '@spree/dashboard-core'import {ErrorState,@@ -17,6 +18,7 @@ import {useConfirm,useFormSubmitShortcut,} from '@spree/dashboard-ui'+import { useQueryClient } from '@tanstack/react-query'import { createFileRoute, useRouter } from '@tanstack/react-router'import { useEffect } from 'react'import { FormProvider, useForm } from 'react-hook-form'@@ -26,8 +28,14 @@ import {CategorySidebar,} from '../../../../../components/spree/categories/category-form'import {+ flushProductMembership,+ ProductMembershipStagingProvider,+} from '../../../../../components/spree/product-membership-staging'+import {+ useAddCategoryProducts,useCategory,useDeleteCategory,+ useRemoveCategoryProducts,useUpdateCategory,} from '../../../../../hooks/use-categories'import {@@ -68,6 +76,10 @@ function CategoryDetail({ categoryId, storeId }: { categoryId: string; storeId:const { data: category } = useCategory(categoryId)const updateCategory = useUpdateCategory(categoryId)const deleteCategory = useDeleteCategory()+ const queryClient = useQueryClient()+ const productsKey = useResourceKey('categories', categoryId, 'products')+ const addProducts = useAddCategoryProducts(categoryId)+ const removeProducts = useRemoveCategoryProducts(categoryId)const form = useForm<CategoryFormValues>({resolver: zodResolver(categoryFormSchema),@@ -87,12 +99,23 @@ function CategoryDetail({ categoryId, storeId }: { categoryId: string; storeId:const extensionValues = extensionSubmitValues('category', form)try {await updateCategory.mutateAsync({ ...categoryToParams(values), ...extensionValues })+ // Membership flushes after the row saves, so a validation failure aborts+ // before any membership write. It ends by refreshing the products list —+ // the only refresh of the whole Save.+ await flushProductMembership({+ staging: values.staged_products,+ add: (ids) => addProducts.mutateAsync(ids),+ remove: (ids) => removeProducts.mutateAsync(ids),+ queryClient,+ productsKey,+ })// Re-baseline so isDirty flips false before the refetch lands; drop the// consumed signed_ids + clear flags so a second save can't re-send a// stale upload/purge (the refetch hydrates the persisted image state).form.reset({...values,...extensionValues,+ staged_products: { adds: [], removes: [] },image_signed_id: null,image_cleared: false,square_image_signed_id: null,@@ -124,37 +147,39 @@ function CategoryDetail({ categoryId, storeId }: { categoryId: string; storeId:return (<FormProvider {...form}>- <form onSubmit={form.handleSubmit(onSubmit)}>- {form.formState.errors.root?.message && (- <p className="text-sm text-destructive" role="alert">- {form.formState.errors.root.message}- </p>- )}- <ResourceLayout- header={- <PageHeader- title={category?.name ?? ''}- backTo="products/categories"- actions={<FormActions form={form} saveLabel={t('admin.actions.save')} />}- resource={category ? { id: category.id } : undefined}- onDelete={handleDelete}- deleteLabel={t('admin.categories.delete_label')}- jsonPreview={{- title: `Category ${category?.name ?? ''}`,- fetch: () => adminClient.categories.get(categoryId),- endpoint: `/api/v3/admin/categories/${categoryId}`,- }}- />- }- main={<CategoryMain form={form} category={category} />}- sidebar={- <>- <CategorySidebar form={form} category={category} />- <Slot name="category.form_sidebar" context={{ category }} />- </>- }- />- </form>+ <ProductMembershipStagingProvider form={form} name="staged_products">+ <form onSubmit={form.handleSubmit(onSubmit)}>+ {form.formState.errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {form.formState.errors.root.message}+ </p>+ )}+ <ResourceLayout+ header={+ <PageHeader+ title={category?.name ?? ''}+ backTo="products/categories"+ actions={<FormActions form={form} saveLabel={t('admin.actions.save')} />}+ resource={category ? { id: category.id } : undefined}+ onDelete={handleDelete}+ deleteLabel={t('admin.categories.delete_label')}+ jsonPreview={{+ title: `Category ${category?.name ?? ''}`,+ fetch: () => adminClient.categories.get(categoryId),+ endpoint: `/api/v3/admin/categories/${categoryId}`,+ }}+ />+ }+ main={<CategoryMain form={form} category={category} />}+ sidebar={+ <>+ <CategorySidebar form={form} category={category} />+ <Slot name="category.form_sidebar" context={{ category }} />+ </>+ }+ />+ </form>+ </ProductMembershipStagingProvider></FormProvider>)}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/collections/$collectionId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/collections/$collectionId.tsxindex 34cda1adcd..2aee952a17 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/collections/$collectionId.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/collections/$collectionId.tsx@@ -7,6 +7,7 @@ import {mapSpreeErrorsToForm,PageHeader,Slot,+ useResourceKey,} from '@spree/dashboard-core'import {ErrorState,@@ -17,6 +18,7 @@ import {useConfirm,useFormSubmitShortcut,} from '@spree/dashboard-ui'+import { useQueryClient } from '@tanstack/react-query'import { createFileRoute, useRouter } from '@tanstack/react-router'import { useEffect } from 'react'import { FormProvider, useForm } from 'react-hook-form'@@ -26,8 +28,15 @@ import {CollectionSidebar,} from '../../../../../components/spree/collections/collection-form'import {+ EMPTY_STAGING,+ flushProductMembership,+ ProductMembershipStagingProvider,+} from '../../../../../components/spree/product-membership-staging'+import {+ useAddCollectionProducts,useCollection,useDeleteCollection,+ useRemoveCollectionProducts,useUpdateCollection,} from '../../../../../hooks/use-collections'import {@@ -70,6 +79,10 @@ function CollectionDetail({ collectionId, storeId }: { collectionId: string; stoconst { data: collection } = useCollection(collectionId)const updateCollection = useUpdateCollection(collectionId)const deleteCollection = useDeleteCollection()+ const queryClient = useQueryClient()+ const productsKey = useResourceKey('collections', collectionId, 'products')+ const addProducts = useAddCollectionProducts(collectionId)+ const removeProducts = useRemoveCollectionProducts(collectionId)const form = useForm<CollectionFormValues>({resolver: zodResolver(collectionFormSchema),@@ -92,12 +105,31 @@ function CollectionDetail({ collectionId, storeId }: { collectionId: string; stoconst extensionValues = extensionSubmitValues('collection', form)try {await updateCollection.mutateAsync({ ...collectionToParams(values), ...extensionValues })+ // Membership flushes after the row saves, so a validation failure aborts+ // before any membership write. It ends by refreshing the products list —+ // the only refresh of the whole Save.+ //+ // Skipped once the collection is automatic: staging survives the manual →+ // automatic toggle in form state, and the API rejects curating a+ // rule-driven collection — flushing it would fail the Save after the+ // collection itself already persisted. Rules own membership from here.+ // Defensive rather than reachable today: toggling `automatic` on+ // requires at least one rule, so the merchant cannot save straight from+ // the toggle with products still staged.+ await flushProductMembership({+ staging: values.automatic ? EMPTY_STAGING : values.staged_products,+ add: (ids) => addProducts.mutateAsync(ids),+ remove: (ids) => removeProducts.mutateAsync(ids),+ queryClient,+ productsKey,+ })// Re-baseline so isDirty flips false before the refetch lands; drop the// consumed signed_ids + clear flags so a second save can't re-send a// stale upload/purge (the refetch hydrates the persisted image state).form.reset({...values,...extensionValues,+ staged_products: { adds: [], removes: [] },image_signed_id: null,image_cleared: false,square_image_signed_id: null,@@ -129,37 +161,39 @@ function CollectionDetail({ collectionId, storeId }: { collectionId: string; storeturn (<FormProvider {...form}>- <form onSubmit={form.handleSubmit(onSubmit)}>- {form.formState.errors.root?.message && (- <p className="text-sm text-destructive" role="alert">- {form.formState.errors.root.message}- </p>- )}- <ResourceLayout- header={- <PageHeader- title={collection?.name ?? ''}- backTo="products/collections"- actions={<FormActions form={form} saveLabel={t('admin.actions.save')} />}- resource={collection ? { id: collection.id } : undefined}- onDelete={handleDelete}- deleteLabel={t('admin.collections.delete_label')}- jsonPreview={{- title: `Collection ${collection?.name ?? ''}`,- fetch: () => adminClient.collections.get(collectionId),- endpoint: `/api/v3/admin/collections/${collectionId}`,- }}- />- }- main={<CollectionMain form={form} collection={collection} />}- sidebar={- <>- <CollectionSidebar form={form} collection={collection} />- <Slot name="collection.form_sidebar" context={{ collection }} />- </>- }- />- </form>+ <ProductMembershipStagingProvider form={form} name="staged_products">+ <form onSubmit={form.handleSubmit(onSubmit)}>+ {form.formState.errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {form.formState.errors.root.message}+ </p>+ )}+ <ResourceLayout+ header={+ <PageHeader+ title={collection?.name ?? ''}+ backTo="products/collections"+ actions={<FormActions form={form} saveLabel={t('admin.actions.save')} />}+ resource={collection ? { id: collection.id } : undefined}+ onDelete={handleDelete}+ deleteLabel={t('admin.collections.delete_label')}+ jsonPreview={{+ title: `Collection ${collection?.name ?? ''}`,+ fetch: () => adminClient.collections.get(collectionId),+ endpoint: `/api/v3/admin/collections/${collectionId}`,+ }}+ />+ }+ main={<CollectionMain form={form} collection={collection} />}+ sidebar={+ <>+ <CollectionSidebar form={form} collection={collection} />+ <Slot name="collection.form_sidebar" context={{ collection }} />+ </>+ }+ />+ </form>+ </ProductMembershipStagingProvider></FormProvider>)}diff --git a/packages/dashboard/src/schemas/catalog.ts b/packages/dashboard/src/schemas/catalog.tsindex 0ca41bbeed..24ddc47985 100644--- a/packages/dashboard/src/schemas/catalog.ts+++ b/packages/dashboard/src/schemas/catalog.ts@@ -2,10 +2,19 @@ import type { CatalogParams } from '@spree/admin-sdk'import { blankToNull } from '@spree/dashboard-core'import { requiredMessage } from '@spree/dashboard-ui'import { z } from 'zod/v4'+import type { ProductMembershipStagingValue } from '../components/spree/product-membership-staging'/** Validation for the catalog create sheet and settings card. */export const catalogFormSchema = z.object({name: z.string().min(1, { error: requiredMessage('name') }),+ /**+ * Staged product membership, applied on Save through the nested products+ * endpoints. Opaque by design — it holds SDK `Product` records so a staged+ * addition can render before it exists server-side, and RHF's `Path<T>`+ * must not walk that object graph. Never sent to the API;+ * `catalogValuesToParams` drops it.+ */+ staged_products: z.custom<ProductMembershipStagingValue>(() => true),active: z.boolean(),// Empty string = assortment-only (base prices).price_list_id: z.string().optional(),@@ -15,7 +24,12 @@ export const catalogFormSchema = z.object({export type CatalogFormValues = z.infer<typeof catalogFormSchema>/** A new catalog: named on create, active, priced by base prices. */-export const CATALOG_DEFAULTS: CatalogFormValues = { name: '', active: true, price_list_id: '' }+export const CATALOG_DEFAULTS: CatalogFormValues = {+ name: '',+ active: true,+ price_list_id: '',+ staged_products: { adds: [], removes: [] },+}/*** Maps form values to the Admin API payload; a blank price list meansdiff --git a/packages/dashboard/src/schemas/category.ts b/packages/dashboard/src/schemas/category.tsindex c7305f20e5..0e6d97c463 100644--- a/packages/dashboard/src/schemas/category.ts+++ b/packages/dashboard/src/schemas/category.ts@@ -2,6 +2,7 @@ import type { Category } from '@spree/admin-sdk'import { customFieldFormSchema } from '@spree/dashboard-core'import { requiredMessage } from '@spree/dashboard-ui'import { z } from 'zod/v4'+import type { ProductMembershipStagingValue } from '../components/spree/product-membership-staging'// Each image field is a small state machine: untouched (omit on save),// uploaded (send signed_id), or cleared (send null to purge). `*_signed_id`@@ -18,6 +19,15 @@ const imageFields = {}export const categoryFormSchema = z.object({+ /**+ * Staged product membership, applied on Save through the nested products+ * endpoints. Deliberately opaque: it holds SDK `Product` records so a+ * staged addition can render before it exists server-side, and RHF's+ * `Path<T>` must not walk that object graph (see the note on+ * `RuleEmbedRecord` in schemas/price-list.ts). Never sent to the API —+ * `categoryToParams` drops it.+ */+ staged_products: z.custom<ProductMembershipStagingValue>(() => true),name: z.string().min(1, { error: requiredMessage('name') }),/** Prefixed parent category id; null = top-level category. */parent_id: z.string().nullable(),@@ -44,6 +54,7 @@ const IMAGE_DEFAULTS = {} satisfies Partial<CategoryFormValues>export const CATEGORY_DEFAULTS: CategoryFormValues = {+ staged_products: { adds: [], removes: [] },name: '',parent_id: null,description: '',@@ -69,6 +80,9 @@ export function categoryToForm(category: Category): CategoryFormValues {custom_field_definition_id: cf.custom_field_definition_id,value: cf.value,})) ?? [],+ // Membership starts unstaged on every hydrate — a reset re-baselines the+ // form, and anything staged has either been flushed or discarded.+ staged_products: { adds: [], removes: [] },...IMAGE_DEFAULTS,}}diff --git a/packages/dashboard/src/schemas/collection.ts b/packages/dashboard/src/schemas/collection.tsindex 20bd247bf8..1c34c6a74c 100644--- a/packages/dashboard/src/schemas/collection.ts+++ b/packages/dashboard/src/schemas/collection.ts@@ -2,6 +2,7 @@ import type { Collection, CollectionRuleParam, CollectionSortOrder } from '@spreimport { customFieldFormSchema } from '@spree/dashboard-core'import { requiredMessage } from '@spree/dashboard-ui'import { z } from 'zod/v4'+import type { ProductMembershipStagingValue } from '../components/spree/product-membership-staging'/*** Canonical values only — labels are resolved at render time via@@ -94,6 +95,15 @@ const collectionRuleSchema = z.object({export type CollectionRuleFormValues = z.infer<typeof collectionRuleSchema>export const collectionFormSchema = z.object({+ /**+ * Staged product membership, applied on Save through the nested products+ * endpoints. Deliberately opaque: it holds SDK `Product` records so a+ * staged addition can render before it exists server-side, and RHF's+ * `Path<T>` must not walk that object graph (see the note on+ * `RuleEmbedRecord` in schemas/price-list.ts). Never sent to the API —+ * `collectionToParams` drops it.+ */+ staged_products: z.custom<ProductMembershipStagingValue>(() => true),name: z.string().min(1, { error: requiredMessage('name') }),description: z.string(),permalink: z.string(),@@ -119,6 +129,7 @@ const IMAGE_DEFAULTS = {} satisfies Partial<CollectionFormValues>export const COLLECTION_DEFAULTS: CollectionFormValues = {+ staged_products: { adds: [], removes: [] },name: '',description: '',permalink: '',@@ -164,6 +175,9 @@ export function collectionToForm(collection: Collection): CollectionFormValues {custom_field_definition_id: cf.custom_field_definition_id,value: cf.value,})) ?? [],+ // Membership starts unstaged on every hydrate — a reset re-baselines the+ // form, and anything staged has either been flushed or discarded.+ staged_products: { adds: [], removes: [] },...IMAGE_DEFAULTS,}}diff --git a/packages/dashboard/src/schemas/price-list.ts b/packages/dashboard/src/schemas/price-list.tsindex 78b9073534..da8fd42a03 100644--- a/packages/dashboard/src/schemas/price-list.ts+++ b/packages/dashboard/src/schemas/price-list.ts@@ -8,6 +8,7 @@ import { blankToNull, defaultPreferences } from '@spree/dashboard-core'import { requiredMessage } from '@spree/dashboard-ui'import i18n from 'i18next'import { z } from 'zod/v4'+import type { ProductMembershipStagingValue } from '../components/spree/product-membership-staging'export const MATCH_POLICIES = ['all', 'any'] as constexport type MatchPolicy = (typeof MATCH_POLICIES)[number]@@ -86,11 +87,13 @@ export const priceListFormSchema = zmatch_policy: z.enum(MATCH_POLICIES).default('all'),rules: z.array(priceRuleDraftSchema).default([]),/**- * Prefixed product ids in the list. The server reconciles this set- * on every PATCH — adds placeholder prices for new ids, drops prices- * for removed ones — so the form ships the full desired set.+ * Staged product membership, applied on Save through the nested products+ * endpoints. Opaque by design — it holds SDK `Product` records so a staged+ * addition can render before it exists server-side, and RHF's `Path<T>`+ * must not walk that object graph (same reason as `RuleEmbedRecord`).+ * Never sent to the API; `priceListValuesToParams` drops it.*/- product_ids: z.array(z.string()).default([]),+ staged_products: z.custom<ProductMembershipStagingValue>(() => true),}).refine((v) => {@@ -112,7 +115,7 @@ export const PRICE_LIST_DEFAULTS: PriceListFormValues = {ends_at: null,match_policy: 'all',rules: [],- product_ids: [],+ staged_products: { adds: [], removes: [] },}export function priceListValuesToParams(@@ -125,7 +128,6 @@ export function priceListValuesToParams(ends_at: v.ends_at || null,match_policy: v.match_policy,rules: v.rules.map(ruleDraftToPayload),- product_ids: v.product_ids,}}diff --git a/spree/api/app/controllers/concerns/spree/api/v3/admin/product_membership.rb b/spree/api/app/controllers/concerns/spree/api/v3/admin/product_membership.rbnew file mode 100644index 0000000000..b2ace2d0d3--- /dev/null+++ b/spree/api/app/controllers/concerns/spree/api/v3/admin/product_membership.rb@@ -0,0 +1,110 @@+module Spree+ module Api+ module V3+ module Admin+ # The uniform nested products surface every product-curating parent+ # exposes — categories, collections, catalogs and price lists all+ # speak the same protocol:+ #+ # GET /{parents}/:parent_id/products — paginated members+ # POST /{parents}/:parent_id/products — { product_ids: [...] } → 201 { added_count }+ # DELETE /{parents}/:parent_id/products — { product_ids: [...] } → 200 { removed_count }+ # PATCH /{parents}/:parent_id/products/:id/reposition — positioned parents only+ #+ # Both writes are bulk: one request adds or removes any number of+ # products. Ids that don't resolve to a product in the current store+ # are silently dropped, already-present ids don't fail an add, and+ # non-member ids don't fail a remove — the counts report what actually+ # changed. Declared in routes through the +:product_membership++ # routing concern.+ #+ # A host controller implements:+ # +set_parent+ — load + authorize the parent record+ # +scope+ — the parent's member products+ # +add_member_products+ — persist membership for the given products+ # +remove_member_products+ — remove membership for the given products+ module ProductMembership+ extend ActiveSupport::Concern++ included do+ include Spree::Api::V3::Admin::ProductListing++ # Membership actions resolve products themselves; the base+ # single-resource load has nothing to look up.+ skip_before_action :set_resource+ end++ # POST /{parents}/:parent_id/products+ def create+ products = requested_products(product_scope)+ existing_ids = scope.where(id: products.map(&:id)).pluck(:id).to_set+ new_products = products.reject { |product| existing_ids.include?(product.id) }++ # Counted by re-reading membership rather than trusting the check+ # above: a concurrent request can claim one of these rows in+ # between, and the caller is told what actually changed.+ added = 0+ if new_products.any?+ add_member_products(new_products)+ added = scope.where(id: new_products.map(&:id)).reorder(nil).distinct.count+ end++ render json: { added_count: added }, status: :created+ end++ # DELETE /{parents}/:parent_id/products+ def destroy+ products = requested_products(scope)++ removed = 0+ if products.any?+ remove_member_products(products)+ # Counted from what is left, for the same reason as `create`.+ still_members = scope.where(id: products.map(&:id)).reorder(nil).distinct.count+ removed = products.size - still_members+ end++ render json: { removed_count: removed }+ end++ protected++ def model_class+ Spree::Product+ end++ def serializer_class+ Spree.api.admin_product_serializer+ end++ # @abstract Persist membership for products verified as new members.+ def add_member_products(_products)+ raise NotImplementedError+ end++ # @abstract Remove membership for products verified as members.+ def remove_member_products(_products)+ raise NotImplementedError+ end++ # Products the caller may act on, regardless of membership.+ def product_scope+ current_store.products.accessible_by(current_ability, :show)+ end++ private++ # Resolves the request's `product_ids` against the given relation.+ # Reordered: a positioned membership scope orders by a join-table+ # column, which PostgreSQL rejects under the DISTINCT needed here —+ # a derived scope (a price list's products through its price rows)+ # can join a product several times.+ def requested_products(relation)+ ids = decode_prefixed_ids(Array(params.require(:product_ids)))+ relation.reorder(nil).where(id: ids).distinct.to_a+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/catalogs/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/catalogs/products_controller.rbindex f8ea09a69f..45541ad3f5 100644--- a/spree/api/app/controllers/spree/api/v3/admin/catalogs/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/catalogs/products_controller.rb@@ -3,88 +3,48 @@ module Spreemodule V3module Adminmodule Catalogs- # The products curated into a catalog's assortment. Listing is- # ordered by the CatalogProduct position so the merchant's manual- # ordering round-trips; +reposition+ persists a drag-to-reorder.+ # The products curated into a catalog's assortment — the uniform+ # nested membership surface (see+ # Spree::Api::V3::Admin::ProductMembership). A catalog decides what+ # a buyer sees, never the order they see it in, so membership+ # carries no position and listing is ordered by name.class ProductsController < ResourceController- include Spree::Api::V3::Admin::ProductListing+ include Spree::Api::V3::Admin::ProductMembershipscoped_resource :products- # Skip the base single-resource load — membership actions resolve- # the product against the catalog's scope themselves.- skip_before_action :set_resource- before_action :set_product, only: [:destroy, :reposition]-- # POST /api/v3/admin/catalogs/:catalog_id/products- # Body: { product_ids: ['prod_…', …] } — bulk add, skipping rows- # already present.- def create- product_ids = Array(params.require(:product_ids)).map do |id|- Spree::Product.decode_prefixed_id(id) || id- end- added = @parent_catalog.add_products(product_scope.where(id: product_ids).ids)-- render json: { added_count: added }, status: :created- end-- # DELETE /api/v3/admin/catalogs/:catalog_id/products/:id- def destroy- @parent_catalog.catalog_products.where(product_id: @product.id).destroy_all- head :no_content- end-- # PATCH /api/v3/admin/catalogs/:catalog_id/products/:id/reposition- # Body: { new_position: 0 } — 0-based index within the assortment.- def reposition- position = integer_param(:new_position)- return render_invalid_position if position.nil?-- @parent_catalog.catalog_products.find_by(product_id: @product.id).insert_at(position + 1)- head :no_content- end-protected- def model_class- Spree::Product- end-- def serializer_class- Spree.api.admin_product_serializer- end-- # The catalog's assortment, in the merchant's manual order.def scopeproduct_scope.joins(:catalog_products).where(Spree::CatalogProduct.table_name => { catalog_id: @parent_catalog.id }).- order(Spree::CatalogProduct.table_name => { position: :asc })+ order(:name)end# A product is curated at most once per catalog (unique- # [catalog_id, product_id]), so the join can't duplicate rows —- # DISTINCT is unnecessary and breaks Postgres ordering by position.+ # [catalog_id, product_id]), so the join can't duplicate rows and+ # DISTINCT is unnecessary.def collection_distinct?falseend+ def add_member_products(products)+ @parent_catalog.add_products(products.map(&:id))+ end++ # One statement — the join rows carry no callbacks worth firing.+ def remove_member_products(products)+ @parent_catalog.catalog_products.where(product_id: products.map(&:id)).delete_all+ @parent_catalog.touch+ end+def set_parent@parent_catalog = current_store.catalogs.accessible_by(current_ability, parent_ability_action).find_by_prefix_id!(params[:catalog_id])authorize_parent!(@parent_catalog)end-- private-- def set_product- @product = scope.find_by_prefix_id!(params[:id])- end-- def product_scope- current_store.products.accessible_by(current_ability, :show)- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/categories/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/categories/products_controller.rbindex 7217de09ec..bd5e0a5572 100644--- a/spree/api/app/controllers/spree/api/v3/admin/categories/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/categories/products_controller.rb@@ -3,35 +3,17 @@ module Spreemodule V3module Adminmodule Categories- # Manages the products classified under a category — the manual- # membership half of the old Rails admin's taxon "Products" panel.- # Listing is ordered by the classification position so the merchant's- # manual ordering round-trips; +reposition+ persists a drag-to-reorder.+ # The products classified under a category — the uniform nested+ # membership surface (see Spree::Api::V3::Admin::ProductMembership),+ # plus per-member reposition: listing is ordered by the+ # classification position so the merchant's manual ordering+ # round-trips.class ProductsController < ResourceController- include Spree::Api::V3::Admin::ProductListing+ include Spree::Api::V3::Admin::ProductMembershipscoped_resource :products- # Skip the base single-resource load — membership actions resolve- # the product against the category's scope themselves (set_product).- skip_before_action :set_resource- before_action :set_product, only: [:destroy, :reposition]-- # POST /api/v3/admin/categories/:category_id/products- # Body: { product_id: 'prod_…' }- def create- product = product_scope.find_by_prefix_id!(params[:product_id])- Spree::Categories::AddProducts.call(categories: [@category], products: [product])- render json: serialize_resource(product), status: :created- end-- # DELETE /api/v3/admin/categories/:category_id/products/:id- # Bulk removal goes through the existing- # POST /products/bulk_remove_from_categories ({ ids, category_ids }).- def destroy- Spree::Categories::RemoveProducts.call(categories: [@category], products: [@product])- head :no_content- end+ before_action :set_product, only: [:reposition]# PATCH /api/v3/admin/categories/:category_id/products/:id/reposition# Body: { new_position: 0 } — 0-based index among the category's products.@@ -50,14 +32,6 @@ module Spreeprotected- def model_class- Spree::Product- end-- def serializer_class- Spree.api.admin_product_serializer- end-# The category's products, ordered by classification position.def scopeproduct_scope.@@ -74,13 +48,21 @@ module Spreefalseend+ def add_member_products(products)+ Spree::Categories::AddProducts.call(categories: [@category], products: products)+ end++ def remove_member_products(products)+ Spree::Categories::RemoveProducts.call(categories: [@category], products: products)+ end+# Loads the parent category (runs before the base set_resource).# Scoped to +manual+ so automatic (rule-based) rows — hidden by the# categories CRUD controller and migrating to Spree::Collection — can't# have their membership listed or mutated through this endpoint.def set_parent@category = Spree::Category.manual.- accessible_by(current_ability, :update).+ accessible_by(current_ability, parent_ability_action).for_store(current_store).find_by_prefix_id!(params[:category_id])authorize_parent!(@category)@@ -92,10 +74,6 @@ module Spree@product = scope.find_by_prefix_id!(params[:id])end- def product_scope- current_store.products.accessible_by(current_ability, :show)- end-def classification_for(product)Spree::ProductCategory.find_by(category_id: @category.id, product_id: product.id)enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/collections/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/collections/products_controller.rbindex bfb2c64c5e..c56f87a0e7 100644--- a/spree/api/app/controllers/spree/api/v3/admin/collections/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/collections/products_controller.rb@@ -3,35 +3,19 @@ module Spreemodule V3module Adminmodule Collections- # Manages the products curated under a collection — the manual- # membership half. Listing is ordered by the ProductCollection- # position so the merchant's manual ordering round-trips; +reposition+- # persists a drag-to-reorder. Automatic (rule-based) membership is- # materialized by the rules, not managed here.+ # The products curated under a collection — the uniform nested+ # membership surface (see Spree::Api::V3::Admin::ProductMembership),+ # plus per-member reposition: listing is ordered by the+ # ProductCollection position so the merchant's manual ordering+ # round-trips. Automatic (rule-based) membership is materialized by+ # the rules, not managed here.class ProductsController < ResourceController- include Spree::Api::V3::Admin::ProductListing+ include Spree::Api::V3::Admin::ProductMembershipscoped_resource :products- # Skip the base single-resource load — membership actions resolve- # the product against the collection's scope themselves (set_product).- skip_before_action :set_resourcebefore_action :ensure_manual_collection, only: [:create, :destroy, :reposition]- before_action :set_product, only: [:destroy, :reposition]-- # POST /api/v3/admin/collections/:collection_id/products- # Body: { product_id: 'prod_…' }- def create- product = product_scope.find_by_prefix_id!(params[:product_id])- Spree::Collections::AddProducts.call(collections: [@parent_collection], products: [product])- render json: serialize_resource(product), status: :created- end-- # DELETE /api/v3/admin/collections/:collection_id/products/:id- def destroy- Spree::Collections::RemoveProducts.call(collections: [@parent_collection], products: [@product])- head :no_content- end+ before_action :set_product, only: [:reposition]# PATCH /api/v3/admin/collections/:collection_id/products/:id/reposition# Body: { new_position: 0 } — 0-based index among the collection's products.@@ -50,14 +34,6 @@ module Spreeprotected- def model_class- Spree::Product- end-- def serializer_class- Spree.api.admin_product_serializer- end-# The collection's products, ordered by membership position.def scopeproduct_scope.@@ -73,13 +49,21 @@ module Spreefalseend+ def add_member_products(products)+ Spree::Collections::AddProducts.call(collections: [@parent_collection], products: products)+ end++ def remove_member_products(products)+ Spree::Collections::RemoveProducts.call(collections: [@parent_collection], products: products)+ end+# Loads the parent collection (runs before the base set_resource).# Any collection resolves — listing (index) an automatic collection's# rule-materialized membership is valid. Manual-only curation is enforced# separately by +ensure_manual_collection+ on the write actions.def set_parent@parent_collection = Spree::Collection.- accessible_by(current_ability, :update).+ accessible_by(current_ability, parent_ability_action).for_store(current_store).find_by_prefix_id!(params[:collection_id])authorize_parent!(@parent_collection)@@ -106,10 +90,6 @@ module Spree@product = scope.find_by_prefix_id!(params[:id])end- def product_scope- current_store.products.accessible_by(current_ability, :show)- end-def product_collection_for(product)Spree::ProductCollection.find_by(collection_id: @parent_collection.id, product_id: product.id)enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/price_lists/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/price_lists/products_controller.rbnew file mode 100644index 0000000000..f9b101e4d6--- /dev/null+++ b/spree/api/app/controllers/spree/api/v3/admin/price_lists/products_controller.rb@@ -0,0 +1,50 @@+module Spree+ module Api+ module V3+ module Admin+ module PriceLists+ # The products a price list covers — the uniform nested membership+ # surface (see Spree::Api::V3::Admin::ProductMembership). Membership+ # is derived from the list's price rows: adding a product+ # materializes a placeholder price for every variant × store+ # currency (the spreadsheet's empty cells), removing hard-deletes+ # its price rows. Unordered — a price list prices, it never+ # merchandises — so listing is by name.+ class ProductsController < ResourceController+ include Spree::Api::V3::Admin::ProductMembership++ # Price lists ride the products scope like their parent+ # controller — no separate read_price_lists scope.+ scoped_resource :products++ protected++ # DISTINCT (the base default): a product joins once per+ # variant × currency price row.+ def scope+ product_scope.+ joins(variants: :prices).+ where(Spree::Price.table_name => { price_list_id: @price_list.id }).+ order(:name)+ end++ def add_member_products(products)+ @price_list.add_products(products.map(&:id))+ end++ def remove_member_products(products)+ @price_list.remove_products(products.map(&:id))+ end++ def set_parent+ @price_list = current_store.price_lists.+ accessible_by(current_ability, parent_ability_action).+ find_by_prefix_id!(params[:price_list_id])+ authorize_parent!(@price_list)+ end+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/price_lists_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/price_lists_controller.rbindex edd90ce338..7d6f8d2fd2 100644--- a/spree/api/app/controllers/spree/api/v3/admin/price_lists_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/price_lists_controller.rb@@ -6,13 +6,12 @@ module Spree# (`activate` / `deactivate`) and the spreadsheet's data feed# (`prices`).#- # Everything writable on the list — name, schedule, match policy,- # product membership (`product_ids: [...]`), nested rules- # (`rules: [...]`), and individual price overrides- # (`prices: [...]`) — flows through the regular PATCH payload, so- # the SPA saves the entire editor in one round-trip. No separate- # add_products / remove_products / add_rule / bulk_update_prices- # endpoints.+ # Everything writable on the list itself — name, schedule, match+ # policy, nested rules (`rules: [...]`), and individual price+ # overrides (`prices: [...]`) — flows through the regular PATCH+ # payload. Product membership lives on the uniform nested surface+ # (PriceLists::ProductsController), the same protocol categories,+ # collections and catalogs use.## Scoped under the `products` API-key scope — price lists are a# product/pricing concern; we don't introduce a separate@@ -119,24 +118,18 @@ module Spreeparams.permit(:name, :description, :position,:starts_at, :ends_at, :match_policy,- product_ids: [],rules: [:id, :type, { preferences: {} }],prices: [:id, :variant_id, :currency, :amount, :compare_at_amount]))- reject_foreign_membership(attrs)+ reject_foreign_variants(attrs)end- # The PriceList model setters (`product_ids=`, `prices=`) resolve- # member ids with no store scoping, so a list in this store could- # otherwise be populated with another store's products/variants.- # Drop any id that isn't in the current store before assignment.- def reject_foreign_membership(attrs)- if attrs[:product_ids].present?- store_product_ids = current_store.products.where(id: attrs[:product_ids]).pluck(:id).map(&:to_s).to_set- attrs[:product_ids] = Array(attrs[:product_ids]).select { |id| store_product_ids.include?(id.to_s) }- end-+ # The price rows resolve variant ids with no store scoping, so a+ # list in this store could otherwise be populated with another+ # store's variants. Drop any id that isn't in the current store+ # before assignment.+ def reject_foreign_variants(attrs)if attrs[:prices].present?incoming = Array(attrs[:prices])store_variant_ids = current_store.variants.where(id: incoming.map { |r| r[:variant_id] }.compact).diff --git a/spree/api/app/serializers/spree/api/v3/admin/price_list_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/price_list_serializer.rbindex 341f668803..647990ca30 100644--- a/spree/api/app/serializers/spree/api/v3/admin/price_list_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/price_list_serializer.rb@@ -17,8 +17,7 @@ module Spreematch_policy: :string,currently_active: :boolean,products_count: :number,- prices_count: :number,- product_ids: [:string, multi: true]+ prices_count: :numberattributes :name, :description, :status, :position, :match_policy,starts_at: :iso8601, ends_at: :iso8601, deleted_at: :iso8601,@@ -36,11 +35,6 @@ module Spreepl.prices.countend- # Prefixed product ids in the list — drives the SPA's- # Products picker pre-fill, and is the same payload the- # client ships back on PATCH to reconcile membership.- attribute :product_ids, &:product_prefixed_ids-many :price_rules,resource: proc { Spree.api.admin_price_rule_serializer },if: proc { expand?('price_rules') }diff --git a/spree/api/config/routes.rb b/spree/api/config/routes.rbindex 74f0f0403f..bda1f459b6 100644--- a/spree/api/config/routes.rb+++ b/spree/api/config/routes.rb@@ -172,6 +172,19 @@ Spree::Core::Engine.add_routes doresources :translations, only: [:index], controller: 'translations'end+ # Mounts the uniform nested products surface on parents that curate+ # products (categories, collections, catalogs, price lists). Bulk by+ # design: POST adds and DELETE removes any number of products in one+ # request. `positioned: true` adds per-member reposition where the+ # membership carries a manual order. See+ # Spree::Api::V3::Admin::ProductMembership.+ concern :product_membership do |options|+ resources :products, controller: options.fetch(:controller), only: [:index, :create] do+ patch :reposition, on: :member if options[:positioned]+ end+ delete 'products', to: "#{options.fetch(:controller)}#destroy"+ end+# Definitions are per resource type, not per instance.resources :custom_field_definitions docollection do@@ -349,12 +362,7 @@ Spree::Core::Engine.add_routes doend# Manual product membership + ordering within the category.- # (Bulk add/remove reuse POST /products/bulk_{add,remove}_*_categories.)- resources :products, controller: 'categories/products', only: [:index, :create, :destroy] do- member do- patch :reposition- end- end+ concerns :product_membership, controller: 'categories/products', positioned: trueend# Collections (flat, merchandising). Reordering the collection itself is a@@ -362,11 +370,7 @@ Spree::Core::Engine.add_routes do# top-level reposition action — only the nested membership has one.resources :collections, concerns: [:custom_fieldable, :translatable] do# Manual product membership + ordering within the collection.- resources :products, controller: 'collections/products', only: [:index, :create, :destroy] do- member do- patch :reposition- end- end+ concerns :product_membership, controller: 'collections/products', positioned: trueend# Subclass discovery for the collection rules editor, mirroring@@ -598,12 +602,9 @@ Spree::Core::Engine.add_routes dopost :assignpost :import_productsend- # Manual assortment membership + ordering within the catalog.- resources :products, controller: 'catalogs/products', only: [:index, :create, :destroy] do- member do- patch :reposition- end- end+ # Assortment membership. Unordered: a catalog decides what a buyer+ # sees, never the order they see it in.+ concerns :product_membership, controller: 'catalogs/products'endresources :catalog_assignments, only: [:show, :destroy]@@ -616,6 +617,9 @@ Spree::Core::Engine.add_routes dopatch :activatepatch :deactivateend+ # Which products the list prices. Adding materializes placeholder+ # prices per variant x currency; removing hard-deletes the rows.+ concerns :product_membership, controller: 'price_lists/products'end# Prices (generic — covers base prices AND price-list overrides).diff --git a/spree/api/spec/controllers/spree/api/v3/admin/catalogs/products_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/catalogs/products_controller_spec.rbindex cf9af6635d..48af894825 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/catalogs/products_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/catalogs/products_controller_spec.rb@@ -9,66 +9,31 @@ RSpec.describe Spree::Api::V3::Admin::Catalogs::ProductsController, type: :contrbefore { request.headers.merge!(headers) }- describe 'GET #index' do- it 'lists the assortment in manual order' do- first = create(:catalog_product, catalog: catalog)- second = create(:catalog_product, catalog: catalog)- second.move_to_top-- get :index, params: { catalog_id: catalog.prefixed_id }, as: :json-- expect(response).to have_http_status(:ok)- expect(json_response['data'].map { |row| row['id'] }).- to eq([second.product.prefixed_id, first.product.prefixed_id])+ it_behaves_like 'a product membership surface' do+ let(:parent_route_params) { { catalog_id: catalog.prefixed_id } }+ let(:foreign_parent_route_params) do+ { catalog_id: create(:catalog, store: create(:store)).prefixed_id }end- it '404s under another store catalog' do- get :index, params: { catalog_id: create(:catalog, store: create(:store)).prefixed_id }, as: :json-- expect(response).to have_http_status(:not_found)+ def seed_member(product)+ catalog.add_products([product.id])end- end-- describe 'POST #create' do- it 'adds store products in bulk by prefixed id' do- product = create(:product, store: store)- post :create, params: { catalog_id: catalog.prefixed_id, product_ids: [product.prefixed_id] }, as: :json-- expect(response).to have_http_status(:created)- expect(json_response['added_count']).to eq(1)- expect(catalog.products.reload).to contain_exactly(product)- end-- it 'silently drops products of another store' do- foreign = create(:product, store: create(:store))-- post :create, params: { catalog_id: catalog.prefixed_id, product_ids: [foreign.prefixed_id] }, as: :json-- expect(json_response['added_count']).to eq(0)+ def member_products+ catalog.products.reload.to_aendend- describe 'DELETE #destroy' do- it 'removes one product from the assortment' do- entry = create(:catalog_product, catalog: catalog)-- delete :destroy, params: { catalog_id: catalog.prefixed_id, id: entry.product.prefixed_id }, as: :json-- expect(response).to have_http_status(:no_content)- expect(catalog.catalog_products.reload).to be_empty- end- end-- describe 'PATCH #reposition' do- it 'persists a drag-to-reorder' do- first = create(:catalog_product, catalog: catalog)- second = create(:catalog_product, catalog: catalog)+ describe 'GET #index' do+ it 'lists the assortment by name' do+ last = create(:catalog_product, catalog: catalog, product: create(:product, store: store, name: 'Zebra'))+ first = create(:catalog_product, catalog: catalog, product: create(:product, store: store, name: 'Aardvark'))- patch :reposition, params: { catalog_id: catalog.prefixed_id, id: second.product.prefixed_id, new_position: 0 }, as: :json+ get :index, params: { catalog_id: catalog.prefixed_id }, as: :json- expect(response).to have_http_status(:no_content)- expect(catalog.catalog_products.order(:position).map(&:id)).to eq([second.id, first.id])+ expect(response).to have_http_status(:ok)+ expect(json_response['data'].map { |row| row['id'] }).+ to eq([first.product.prefixed_id, last.product.prefixed_id])endendenddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/categories/products_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/categories/products_controller_spec.rbindex 81767ce19b..ad4de0e8f2 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/categories/products_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/categories/products_controller_spec.rb@@ -48,41 +48,18 @@ RSpec.describe Spree::Api::V3::Admin::Categories::ProductsController, type: :conendend- describe 'POST #create' do- let!(:product) { create(:product, store: store) }-- it 'adds the product to the category' do- post :create, params: { category_id: category.prefixed_id, product_id: product.prefixed_id }, as: :json-- expect(response).to have_http_status(:created)- expect(classified_ids).to include(product.id)+ it_behaves_like 'a product membership surface' do+ let(:parent_route_params) { { category_id: category.prefixed_id } }+ let(:foreign_parent_route_params) do+ { category_id: create(:category, store: create(:store)).prefixed_id }end- it '404s for a product outside the store' do- other = create(:product, store: create(:store))- post :create, params: { category_id: category.prefixed_id, product_id: other.prefixed_id }, as: :json-- expect(response).to have_http_status(:not_found)+ def seed_member(product)+ Spree::Categories::AddProducts.call(categories: [category], products: [product])end- end-- describe 'DELETE #destroy' do- let!(:product) { create(:product, store: store) }-- before { create(:product_category, category: category, product: product, position: 1) }-- it 'removes the product from the category' do- delete :destroy, params: { category_id: category.prefixed_id, id: product.prefixed_id }, as: :json-- expect(response).to have_http_status(:no_content)- expect(classified_ids).not_to include(product.id)- end-- it '404s for a product not in the category' do- stray = create(:product, store: store)- delete :destroy, params: { category_id: category.prefixed_id, id: stray.prefixed_id }, as: :json- expect(response).to have_http_status(:not_found)+ def member_products+ category.products.reload.to_aendenddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/collections/products_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/collections/products_controller_spec.rbindex c1d2f880a3..9087037b28 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/collections/products_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/collections/products_controller_spec.rb@@ -57,56 +57,35 @@ RSpec.describe Spree::Api::V3::Admin::Collections::ProductsController, type: :coendend- describe 'POST #create' do- let!(:product) { create(:product, store: store) }-- it 'adds the product to the collection' do- post :create, params: { collection_id: collection.prefixed_id, product_id: product.prefixed_id }, as: :json-- expect(response).to have_http_status(:created)- expect(member_ids).to include(product.id)+ it_behaves_like 'a product membership surface' do+ let(:parent_route_params) { { collection_id: collection.prefixed_id } }+ let(:foreign_parent_route_params) do+ { collection_id: create(:collection, store: create(:store)).prefixed_id }end- it '404s for a product outside the store' do- other = create(:product, store: create(:store))- post :create, params: { collection_id: collection.prefixed_id, product_id: other.prefixed_id }, as: :json-- expect(response).to have_http_status(:not_found)+ def seed_member(product)+ Spree::Collections::AddProducts.call(collections: [collection], products: [product])end- it 'rejects adding to an automatic collection (rule-managed, not curated)' do- automatic = create(:automatic_collection, store: store)- post :create, params: { collection_id: automatic.prefixed_id, product_id: product.prefixed_id }, as: :json-- expect(response).to have_http_status(:unprocessable_content)- expect(json_response['error']['code']).to eq('validation_error')- expect(json_response['error']['message']).to eq(Spree.t('api.errors.automatic_collection_curation'))- expect(member_ids).not_to include(product.id)+ def member_products+ collection.products.reload.to_aendend- describe 'DELETE #destroy' do+ describe 'automatic collections' dolet!(:product) { create(:product, store: store) }+ let(:automatic) { create(:automatic_collection, store: store) }- before { Spree::ProductCollection.create!(collection: collection, product: product, position: 1) }+ it 'rejects adding (rule-managed, not curated)' do+ post :create, params: { collection_id: automatic.prefixed_id, product_ids: [product.prefixed_id] }, as: :json- it 'removes the product from the collection' do- delete :destroy, params: { collection_id: collection.prefixed_id, id: product.prefixed_id }, as: :json-- expect(response).to have_http_status(:no_content)- expect(member_ids).not_to include(product.id)- end-- it '404s for a product not in the collection' do- stray = create(:product, store: store)- delete :destroy, params: { collection_id: collection.prefixed_id, id: stray.prefixed_id }, as: :json-- expect(response).to have_http_status(:not_found)+ expect(response).to have_http_status(:unprocessable_content)+ expect(json_response['error']['code']).to eq('validation_error')+ expect(json_response['error']['message']).to eq(Spree.t('api.errors.automatic_collection_curation'))end- it 'rejects removing from an automatic collection before looking up the product' do- automatic = create(:automatic_collection, store: store)- delete :destroy, params: { collection_id: automatic.prefixed_id, id: product.prefixed_id }, as: :json+ it 'rejects removing before looking up the products' do+ delete :destroy, params: { collection_id: automatic.prefixed_id, product_ids: [product.prefixed_id] }, as: :jsonexpect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')diff --git a/spree/api/spec/controllers/spree/api/v3/admin/price_lists/products_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/price_lists/products_controller_spec.rbnew file mode 100644index 0000000000..2f7af328e7--- /dev/null+++ b/spree/api/spec/controllers/spree/api/v3/admin/price_lists/products_controller_spec.rb@@ -0,0 +1,58 @@+require 'spec_helper'++RSpec.describe Spree::Api::V3::Admin::PriceLists::ProductsController, type: :controller do+ render_views++ include_context 'API v3 Admin authenticated'++ let!(:price_list) { create(:price_list, store: store) }++ before { request.headers.merge!(headers) }++ it_behaves_like 'a product membership surface' do+ let(:parent_route_params) { { price_list_id: price_list.prefixed_id } }+ let(:foreign_parent_route_params) do+ { price_list_id: create(:price_list, store: create(:store)).prefixed_id }+ end++ def seed_member(product)+ price_list.add_products([product.id])+ end++ def member_products+ price_list.products.reload.to_a+ end+ end++ describe 'POST #create' do+ it 'materializes a placeholder price per variant and store currency' do+ product = create(:product, store: store)++ post :create,+ params: { price_list_id: price_list.prefixed_id, product_ids: [product.prefixed_id] },+ as: :json++ expect(response).to have_http_status(:created)+ placeholders = price_list.prices.where(variant_id: product.variants.ids)+ expect(placeholders).to be_present+ expect(placeholders.pluck(:amount)).to all(be_nil)+ end+ end++ describe 'DELETE #destroy' do+ # A product joins the scope once per price row (variant x currency), so+ # the count must still say 1 per product, not per row.+ it 'counts products, not price rows' do+ product = create(:product, store: store)+ price_list.add_products([product.id])+ price_list.prices.update_all(amount: 10)++ delete :destroy,+ params: { price_list_id: price_list.prefixed_id, product_ids: [product.prefixed_id] },+ as: :json++ expect(json_response['removed_count']).to eq(1)+ expect(price_list.prices.where(variant_id: product.variants.ids)).to be_empty+ end+ end+enddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/price_lists_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/price_lists_controller_spec.rbindex fbeaf8f61e..df3d34835b 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/price_lists_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/price_lists_controller_spec.rb@@ -12,17 +12,13 @@ RSpec.describe Spree::Api::V3::Admin::PriceListsController, type: :controller dodescribe 'POST #create — one-shot creation' dolet(:customer_group) { create(:customer_group, store: store) }- context 'admin UI shape (product_ids + rules)' do- let(:product1) { create(:product) }- let(:product2) { create(:product) }-- it 'persists metadata, products, and rules in one request' do+ context 'admin UI shape (rules)' do+ it 'persists metadata and rules in one request' dopost :create,params: {name: 'EU wholesale',description: 'B2B verified customers',match_policy: 'all',- product_ids: [product1.prefixed_id, product2.prefixed_id],rules: [{type: 'customer_group_rule',@@ -36,7 +32,6 @@ RSpec.describe Spree::Api::V3::Admin::PriceListsController, type: :controller doexpect(response).to have_http_status(:created)list = Spree::PriceList.for_store(store).find_by!(name: 'EU wholesale')expect(list.match_policy).to eq('all')- expect(list.products).to contain_exactly(product1, product2)expect(list.price_rules.length).to eq(2)cg_rule = list.price_rules.find { |r| r.is_a?(Spree::PriceRules::CustomerGroupRule) }volume_rule = list.price_rules.find { |r| r.is_a?(Spree::PriceRules::VolumeRule) }@@ -48,10 +43,10 @@ RSpec.describe Spree::Api::V3::Admin::PriceListsController, type: :controller doendend- context 'server-to-server shape (rules + prices, no product_ids)' do+ context 'server-to-server shape (rules + prices)' do# The natural API shape when the caller already knows per-variant# prices. Variants in `prices` implicitly become part of the list- # via the unique-key upsert — no separate `product_ids` round trip.+ # via the unique-key upsert — no separate membership round trip.let(:product) { create(:product) }let(:variant_a) { product.default_variant }let(:variant_b) { create(:variant, product: product) }@@ -98,16 +93,6 @@ RSpec.describe Spree::Api::V3::Admin::PriceListsController, type: :controller dolet(:foreign_product) { create(:product, store: other_store) }let(:foreign_variant) { foreign_product.default_variant }- it 'ignores another store\'s product in product_ids' do- post :create,- params: { name: 'Sneaky list', match_policy: 'all', product_ids: [foreign_product.prefixed_id] },- as: :json-- expect(response).to have_http_status(:created)- list = Spree::PriceList.for_store(store).find_by!(name: 'Sneaky list')- expect(list.products).to be_empty- end-it 'ignores another store\'s variant in nested prices' dopost :create,params: {diff --git a/spree/api/spec/integration/spree/api/v3/admin/catalogs_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/catalogs_spec.rbindex 58ad409ad6..dd40465696 100644--- a/spree/api/spec/integration/spree/api/v3/admin/catalogs_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/catalogs_spec.rb@@ -111,4 +111,87 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceendendend+ path '/api/v3/admin/catalogs/{catalog_id}/products' do+ get 'List catalog products' do+ tags 'Catalogs'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description "The catalog's curated assortment, listed by product name — membership carries no order."+ admin_scope :read, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :catalog_id, in: :path, type: :string, required: true++ response '200', 'products found' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:catalog_id) { catalog.prefixed_id }++ schema SwaggerSchemaHelpers.paginated('Product')++ run_test!+ end+ end++ post 'Add products to a catalog' do+ tags 'Catalogs'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Curates products into the assortment in bulk. Already-present products are skipped; the count reports what was added.'+ admin_scope :write, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :catalog_id, in: :path, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }++ response '201', 'products added' do+ let!(:product) { create(:product, store: store) }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:catalog_id) { catalog.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }++ run_test! do |response|+ expect(JSON.parse(response.body)['added_count']).to eq(1)+ end+ end+ end++ delete 'Remove products from a catalog' do+ tags 'Catalogs'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Removes products from the assortment in bulk. Ids that are not members are ignored; the count reports what was removed.'+ admin_scope :write, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :catalog_id, in: :path, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }++ response '200', 'products removed' do+ let!(:product) { create(:product, store: store) }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:catalog_id) { catalog.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }++ before { catalog.add_products([product.id]) }++ run_test! do |response|+ expect(JSON.parse(response.body)['removed_count']).to eq(1)+ end+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/admin/categories_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/categories_spec.rbindex cfd3eb4766..dc917080c9 100644--- a/spree/api/spec/integration/spree/api/v3/admin/categories_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/categories_spec.rb@@ -239,12 +239,13 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenendend- post 'Add a product to a category' do+ post 'Add products to a category' dotags 'Categories'consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Classifies a product under the category (appended to the end).'+ description 'Classifies products under the category in bulk (appended to the end). ' \+ 'Already-classified products are skipped; the count reports what was added.'admin_scope :write, :categoriesparameter name: 'x-spree-api-key', in: :header, type: :string, required: true@@ -253,46 +254,52 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter name: :category_id, in: :path, type: :string, required: true, description: 'Category ID'parameter name: :body, in: :body, schema: {type: :object,- properties: { product_id: { type: :string, example: 'prod_abc123' } },- required: %w[product_id]+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]}- response '201', 'product added' do+ response '201', 'products added' dolet!(:product) { create(:product, store: store) }let(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:category_id) { category.prefixed_id }- let(:body) { { product_id: product.prefixed_id } }+ let(:body) { { product_ids: [product.prefixed_id] } }- schema '$ref' => '#/components/schemas/Product'-- run_test!+ run_test! do |response|+ expect(JSON.parse(response.body)['added_count']).to eq(1)+ endendend- end- path '/api/v3/admin/categories/{category_id}/products/{id}' do- delete 'Remove a product from a category' do+ delete 'Remove products from a category' dotags 'Categories'+ consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Removes a product from the category\'s manual classification.'+ description 'Removes products from the category\'s manual classification in bulk. ' \+ 'Ids that are not classified are ignored; the count reports what was removed.'admin_scope :write, :categoriesparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :category_id, in: :path, type: :string, required: true, description: 'Category ID'- parameter name: :id, in: :path, type: :string, required: true, description: 'Product ID'+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }- response '204', 'product removed' do+ response '200', 'products removed' dolet!(:product) { create(:product, store: store) }let(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:category_id) { category.prefixed_id }- let(:id) { product.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }before { create(:product_category, category: category, product: product, position: 1) }- run_test!+ run_test! do |response|+ expect(JSON.parse(response.body)['removed_count']).to eq(1)+ endendendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/collections_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/collections_spec.rbindex 84af00aedf..23f5fe1133 100644--- a/spree/api/spec/integration/spree/api/v3/admin/collections_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/collections_spec.rb@@ -244,12 +244,13 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereendend- post 'Add a product to a collection' do+ post 'Add products to a collection' dotags 'Collections'consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Curates a product into the collection (appended to the end).'+ description 'Curates products into the collection in bulk (appended to the end). ' \+ 'Already-curated products are skipped; the count reports what was added.'admin_scope :write, :collectionsparameter name: 'x-spree-api-key', in: :header, type: :string, required: true@@ -258,46 +259,52 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereparameter name: :collection_id, in: :path, type: :string, required: true, description: 'Collection ID'parameter name: :body, in: :body, schema: {type: :object,- properties: { product_id: { type: :string, example: 'prod_abc123' } },- required: %w[product_id]+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]}- response '201', 'product added' do+ response '201', 'products added' dolet!(:product) { create(:product, store: store) }let(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:collection_id) { collection.prefixed_id }- let(:body) { { product_id: product.prefixed_id } }+ let(:body) { { product_ids: [product.prefixed_id] } }- schema '$ref' => '#/components/schemas/Product'-- run_test!+ run_test! do |response|+ expect(JSON.parse(response.body)['added_count']).to eq(1)+ endendend- end- path '/api/v3/admin/collections/{collection_id}/products/{id}' do- delete 'Remove a product from a collection' do+ delete 'Remove products from a collection' dotags 'Collections'+ consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Removes a product from the collection\'s manual curation.'+ description 'Removes products from the collection\'s manual curation in bulk. ' \+ 'Ids that are not curated are ignored; the count reports what was removed.'admin_scope :write, :collectionsparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :collection_id, in: :path, type: :string, required: true, description: 'Collection ID'- parameter name: :id, in: :path, type: :string, required: true, description: 'Product ID'+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }- response '204', 'product removed' do+ response '200', 'products removed' dolet!(:product) { create(:product, store: store) }let(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:collection_id) { collection.prefixed_id }- let(:id) { product.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }before { Spree::ProductCollection.create!(collection: collection, product: product, position: 1) }- run_test!+ run_test! do |response|+ expect(JSON.parse(response.body)['removed_count']).to eq(1)+ endendendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/price_lists_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/price_lists_spec.rbindex 8591b8a293..5bd464f7f3 100644--- a/spree/api/spec/integration/spree/api/v3/admin/price_lists_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/price_lists_spec.rb@@ -62,12 +62,6 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereends_at: { type: :string, nullable: true, example: '2026-09-01T00:00:00Z' },match_policy: { type: :string, enum: %w[all any], example: 'all' },position: { type: :integer, example: 1 },- product_ids: {- type: :array,- items: { type: :string },- description: 'Prefixed product ids to seed the list with.',- example: ['prod_aBc123']- },rules: {type: :array,description: 'STI-typed price rules to attach on create. Existing rules ' \@@ -83,12 +77,12 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refere},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.',+ description: 'Server-to-server shape: ship the exact per-variant prices ' \+ 'the list should contain. Each row upserts on the unique key ' \+ '`(variant_id, currency, price_list_id)` — `prices` alone tells ' \+ 'the server which variants belong to the list and what the ' \+ 'override amount is. Curating whole products goes through the ' \+ 'nested `/price_lists/{id}/products` surface instead.',items: {type: :object,required: %w[variant_id currency],@@ -103,10 +97,8 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refere}}- response '201', 'price list created (one-shot — metadata, schedule, products, rules)' do+ response '201', 'price list created (one-shot — metadata, schedule, rules)' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:product1) { create(:product) }- let(:product2) { create(:product) }let(:customer_group) { create(:customer_group, store: store) }let(:body) do{@@ -115,7 +107,6 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-referematch_policy: 'all',starts_at: '2026-06-01T00:00:00Z',ends_at: '2026-09-01T00:00:00Z',- product_ids: [product1.prefixed_id, product2.prefixed_id],rules: [{type: 'customer_group_rule',@@ -137,7 +128,6 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereexpect(list.name).to eq('EU wholesale')expect(list.match_policy).to eq('all')expect(list.status).to eq('draft')- expect(list.products).to contain_exactly(product1, product2)expect(list.price_rules.length).to eq(2)cg_rule = list.price_rules.find { |r| r.is_a?(Spree::PriceRules::CustomerGroupRule) }volume_rule = list.price_rules.find { |r| r.is_a?(Spree::PriceRules::VolumeRule) }@@ -149,10 +139,10 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereendend- response '201', 'price list created (server-to-server — rules + prices, no product_ids)' do+ response '201', 'price list created (server-to-server — rules + prices)' do# The natural API shape when you already know the exact per-variant- # prices: skip `product_ids` and ship `prices` directly. Variants- # referenced in `prices` implicitly become part of the list.+ # prices: ship `prices` directly. Variants referenced in `prices`+ # implicitly become part of the list.let(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:product) { create(:product) }let(:variant_a) { product.default_variant }@@ -272,12 +262,6 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereends_at: { type: :string, nullable: true },match_policy: { type: :string, enum: %w[all any] },position: { type: :integer },- product_ids: {- type: :array,- items: { type: :string },- description: 'Prefixed product ids — reconciles list membership (adds + removes).',- example: ['prod_aBc123']- },rules: {type: :array,items: {@@ -326,29 +310,6 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereendend- response '200', 'price list membership reconciles via product_ids' do- let(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:id) { price_list.prefixed_id }- let(:kept_product) { create(:product) }- let(:removed_product) { create(:product) }- let(:added_product) { create(:product) }- let(:body) { { product_ids: [kept_product.prefixed_id, added_product.prefixed_id] } }-- before do- # Seed the list with kept + removed; PATCH should drop `removed`- # and pick up `added` in a single round-trip.- price_list.add_products([kept_product.id, removed_product.id])- end-- schema '$ref' => '#/components/schemas/PriceList'-- run_test! do- products = price_list.reload.products- expect(products).to include(kept_product, added_product)- expect(products).not_to include(removed_product)- end- end-response '200', 'price overrides reconcile via prices' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { price_list.prefixed_id }@@ -484,4 +445,87 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereendend+ path '/api/v3/admin/price_lists/{price_list_id}/products' do+ get 'List price list products' do+ tags 'Price Lists'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'The products the list prices, listed by name — membership is derived from the price rows.'+ admin_scope :read, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :price_list_id, in: :path, type: :string, required: true++ response '200', 'products found' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:price_list_id) { price_list.prefixed_id }++ schema SwaggerSchemaHelpers.paginated('Product')++ run_test!+ end+ end++ post 'Add products to a price list' do+ tags 'Price Lists'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Adds products to the list in bulk, materializing a placeholder price per variant and store currency. Already-present products are skipped.'+ admin_scope :write, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :price_list_id, in: :path, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }++ response '201', 'products added' do+ let!(:product) { create(:product, store: store) }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:price_list_id) { price_list.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }++ run_test! do |response|+ expect(JSON.parse(response.body)['added_count']).to eq(1)+ end+ end+ end++ delete 'Remove products from a price list' do+ tags 'Price Lists'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Removes products from the list in bulk, hard-deleting their price rows. Ids that are not members are ignored.'+ admin_scope :write, :products++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :price_list_id, in: :path, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },+ required: %w[product_ids]+ }++ response '200', 'products removed' do+ let!(:product) { create(:product, store: store) }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:price_list_id) { price_list.prefixed_id }+ let(:body) { { product_ids: [product.prefixed_id] } }++ before { price_list.add_products([product.id]) }++ run_test! do |response|+ expect(JSON.parse(response.body)['removed_count']).to eq(1)+ end+ end+ end+ end+enddiff --git a/spree/api/spec/support/shared_examples/product_membership.rb b/spree/api/spec/support/shared_examples/product_membership.rbnew file mode 100644index 0000000000..38cb8feb39--- /dev/null+++ b/spree/api/spec/support/shared_examples/product_membership.rb@@ -0,0 +1,108 @@+# The battery every host of Spree::Api::V3::Admin::ProductMembership runs —+# categories, collections, catalogs and price lists expose the same uniform+# nested products surface, so its contract is asserted once, against each.+#+# A host spec provides:+# parent_route_params — route params naming the parent (e.g. { catalog_id: … })+# foreign_parent_route_params — the same shape naming another store's parent+# seed_member(product) — makes the product a member outside the endpoint+# member_products — the parent's current member products, freshly read+RSpec.shared_examples 'a product membership surface' do+ describe 'GET #index' do+ it 'lists the members' do+ member = create(:product, store: store)+ seed_member(member)++ get :index, params: parent_route_params, as: :json++ expect(response).to have_http_status(:ok)+ expect(json_response['data'].map { |row| row['id'] }).to include(member.prefixed_id)+ end++ it '404s under another store parent' do+ get :index, params: foreign_parent_route_params, as: :json++ expect(response).to have_http_status(:not_found)+ end+ end++ describe 'POST #create' do+ it 'adds store products in bulk by prefixed id' do+ products = create_list(:product, 2, store: store)++ post :create,+ params: parent_route_params.merge(product_ids: products.map(&:prefixed_id)),+ as: :json++ expect(response).to have_http_status(:created)+ expect(json_response['added_count']).to eq(2)+ expect(member_products).to match_array(products)+ end++ it 'skips ids that are already members' do+ existing = create(:product, store: store)+ seed_member(existing)+ fresh = create(:product, store: store)++ post :create,+ params: parent_route_params.merge(product_ids: [existing, fresh].map(&:prefixed_id)),+ as: :json++ expect(json_response['added_count']).to eq(1)+ expect(member_products).to match_array([existing, fresh])+ end++ # The pre-check can go stale under concurrency, so the count is read back+ # from membership rather than from the request's own intent.+ it 'counts what the write actually added, not what was requested' do+ already = create(:product, store: store)+ seed_member(already)++ post :create,+ params: parent_route_params.merge(product_ids: [already.prefixed_id]),+ as: :json++ expect(json_response['added_count']).to eq(0)+ expect(member_products).to contain_exactly(already)+ end++ it 'silently drops products of another store' do+ foreign = create(:product, store: create(:store))++ post :create,+ params: parent_route_params.merge(product_ids: [foreign.prefixed_id]),+ as: :json++ expect(json_response['added_count']).to eq(0)+ expect(member_products).to be_empty+ end+ end++ describe 'DELETE #destroy' do+ it 'removes several products in one request' do+ members = create_list(:product, 2, store: store)+ members.each { |product| seed_member(product) }++ delete :destroy,+ params: parent_route_params.merge(product_ids: members.map(&:prefixed_id)),+ as: :json++ expect(response).to have_http_status(:ok)+ expect(json_response['removed_count']).to eq(2)+ expect(member_products).to be_empty+ end++ it 'ignores ids that are not members' do+ member = create(:product, store: store)+ seed_member(member)+ outsider = create(:product, store: store)++ delete :destroy,+ params: parent_route_params.merge(product_ids: [member, outsider].map(&:prefixed_id)),+ as: :json++ expect(json_response['removed_count']).to eq(1)+ expect(member_products).to be_empty+ end+ end+enddiff --git a/spree/core/app/models/spree/catalog.rb b/spree/core/app/models/spree/catalog.rbindex c67d69bc7d..5737f21a9f 100644--- a/spree/core/app/models/spree/catalog.rb+++ b/spree/core/app/models/spree/catalog.rb@@ -97,9 +97,7 @@ module Spree# Scoped to this store's products, so an id from another tenant adds# nothing rather than being inserted past the row-level validation the- # bulk write skips. The caller's order is what the positions are numbered- # from, so the filtering keeps it — a database returns matching rows in- # whatever order it likes.+ # bulk write skips.allowed_ids = store.products.where(id: product_ids).ids.to_settaken_ids = catalog_products.pluck(:product_id).to_set@@ -107,21 +105,18 @@ module Spreereturn 0 if new_ids.empty?now = Time.current- next_position = (catalog_products.maximum(:position) || 0) + 1- rows = new_ids.map.with_index do |product_id, index|+ rows = new_ids.map do |product_id|{catalog_id: id,product_id: product_id,- position: next_position + index,created_at: now,updated_at: now}end- # `acts_as_list` assigns positions in a callback the bulk write skips,- # so they are numbered above; :skip keeps a concurrent add from raising- # on the unique (catalog_id, product_id) index.+ # :skip keeps a concurrent add from raising on the unique+ # (catalog_id, product_id) index.opts = { on_duplicate: :skip }# MySQL infers the conflict target from the table's unique constraints# and rejects an explicit +unique_by+; PostgreSQL/SQLite require it.diff --git a/spree/core/app/models/spree/catalog_product.rb b/spree/core/app/models/spree/catalog_product.rbindex e15ac50d84..412da6bb66 100644--- a/spree/core/app/models/spree/catalog_product.rb+++ b/spree/core/app/models/spree/catalog_product.rb@@ -1,10 +1,8 @@module Spree- # Membership of one product in a catalog's assortment, manually ordered.+ # Membership of one product in a catalog's assortment.class CatalogProduct < Spree.base_classhas_prefix_id :catp- acts_as_list scope: :catalog_id-belongs_to :catalog, class_name: 'Spree::Catalog', touch: true, inverse_of: :catalog_productsbelongs_to :product, class_name: 'Spree::Product'diff --git a/spree/core/app/models/spree/price_list.rb b/spree/core/app/models/spree/price_list.rbindex a27f448348..0725e0d9bc 100644--- a/spree/core/app/models/spree/price_list.rb+++ b/spree/core/app/models/spree/price_list.rb@@ -23,13 +23,6 @@ module Spreeafter_save :apply_pending_rules- # @return [Array<String>] prefixed product ids in this list,- # encoded inline to avoid hydrating N Product records.- def product_prefixed_ids- prefix = Spree::Product._prefix_id_prefix- product_ids.sort.map { |pk| "#{prefix}_#{Spree::PrefixedId::SQIDS.encode([pk])}" }- end-# Flat-payload writer for `rules`. See# {Spree::TypedAssociations#assign_typed_association}.def rules=(rows)diff --git a/spree/core/app/workflows/spree/price_lists/create.rb b/spree/core/app/workflows/spree/price_lists/create.rbindex 53ed1616a5..6d06c08f97 100644--- a/spree/core/app/workflows/spree/price_lists/create.rb+++ b/spree/core/app/workflows/spree/price_lists/create.rb@@ -1,16 +1,16 @@module Spreemodule PriceLists- # Creates a price list. The bulk payloads a list can arrive with — which- # products it covers, and their price overrides — are applied by- # Spree::PriceLists::Update once the row exists, since both paths reconcile- # them the same way and membership has to settle before prices.+ # Creates a price list. A `prices` payload the list arrives with is+ # applied by Spree::PriceLists::Update once the row exists, since both+ # paths reconcile it the same way. Product membership is not part of+ # this payload — it lives on the uniform nested products surface.class Create < Spree::Workflowhooks :validate, :after_createattr_reader :price_list# @param store [Spree::Store]- # @param attributes [Hash] may carry `product_ids` and `prices`+ # @param attributes [Hash] may carry `prices`# @return [Spree::ServiceModule::Result] value is the price listdef perform(store:, attributes: {})super@@ -30,13 +30,13 @@ module Spreeprivate# Held back from the new record so it saves as a plain row; the- # collections are reconciled once it has an id.+ # rows are reconciled once it has an id.def build_price_list# See Spree::PriceLists::Update on the indifferent access.attrs = attributes.to_h.with_indifferent_access- @bulk_payloads = attrs.slice(:product_ids, :prices)- @price_list = store.price_lists.new(attrs.except(:product_ids, :prices))+ @bulk_payloads = attrs.slice(:prices)+ @price_list = store.price_lists.new(attrs.except(:prices))enddef save_price_listdiff --git a/spree/core/app/workflows/spree/price_lists/update.rb b/spree/core/app/workflows/spree/price_lists/update.rbindex c191385250..dfee335abd 100644--- a/spree/core/app/workflows/spree/price_lists/update.rb+++ b/spree/core/app/workflows/spree/price_lists/update.rb@@ -1,19 +1,14 @@module Spreemodule PriceLists- # Updates a price list and applies the bulk payloads that ride with it:- # which products the list covers, and the individual price overrides.- #- # Those used to be attribute writers that stashed their input and- # after_save callbacks that applied it — a multi-step flow disguised as an- # assignment, where the order the callbacks happened to run in was- # load-bearing (membership has to settle before prices, so a newly added- # product has a row to overwrite). Here that order is the step order, and a- # handler can veto the whole edit before any of it is written.+ # Updates a price list and applies the price overrides that ride with it.+ # Product membership is not part of this payload — it lives on the+ # uniform nested products surface, the same protocol categories,+ # collections and catalogs use.class Update < Spree::Workflowhooks :validate, :after_update# @param price_list [Spree::PriceList]- # @param attributes [Hash] may carry `product_ids` and `prices`+ # @param attributes [Hash] may carry `prices`# @return [Spree::ServiceModule::Result] value is the price listdef perform(price_list:, attributes: {})super@@ -23,7 +18,6 @@ module SpreeApplicationRecord.transaction dostep :save_price_list- step :apply_product_idsstep :apply_pricesrun_hooks :after_updateend@@ -33,42 +27,22 @@ module Spreeprivate- # The bulk payloads are held back rather than assigned, so the record- # saves as a plain row and the collections are reconciled afterwards.+ # The price payload is held back rather than assigned, so the record+ # saves as a plain row and the rows are reconciled afterwards.def assign_attributes# Indifferent access: a host app or importer may pass string keys, and# a missed key would send the bulk payload to the association setter.attrs = attributes.to_h.with_indifferent_access- @product_ids = attrs.key?(:product_ids) ? decoded_product_ids(attrs[:product_ids]) : nil@prices = attrs.key?(:prices) ? attrs[:prices] : nil- price_list.assign_attributes(attrs.except(:product_ids, :prices))+ price_list.assign_attributes(attrs.except(:prices))enddef save_price_listfailure(price_list) unless price_list.saveend- def apply_product_ids- return if @product_ids.nil?-- current = price_list.product_ids- to_remove = current - @product_ids- to_add = @product_ids - current- return if to_remove.empty? && to_add.empty?-- price_list.remove_products(to_remove) if to_remove.any?- price_list.add_products(to_add) if to_add.any?-- # Membership changes through raw upsert_all/delete_all on prices, which- # leaves the variants and products caches holding the old set — a- # same-request read, such as the serializer's product_ids, would still- # report the membership from before the edit.- price_list.association(:variants).reset- price_list.association(:products).reset- end-def apply_pricesreturn if @prices.nil?@@ -89,35 +63,6 @@ module Spreetouch_variants(variant_ids)end- # Ids arrive prefixed from the console and legacy callers, already- # decoded from a controller that ran normalize_params — the same two- # shapes price_rows handles for variant_id.- #- # Resolved against the store's own products rather than decoded and- # trusted. A prefix only encodes a number, so `variant_xxx` decodes to- # an integer that names a product just as readily; and a blank entry- # matches nothing, which would otherwise read as "remove every current- # member and add none".- def decoded_product_ids(ids)- # `nil` is not a list: Array(nil) is [], which would otherwise read as- # the empty array that means "clear the list".- return nil if ids.nil?-- given = Array(ids)- candidates = given.filter_map do |id|- next if id.blank?-- Spree::PrefixedId.prefixed_id?(id) ? Spree::PrefixedId.decode_prefixed_id(id) : id- end-- # An empty array clears the list; an array of blanks is malformed- # input and must not read as the same instruction.- return nil if candidates.empty? && given.any?- return [] if candidates.empty?-- price_list.store.products.where(id: candidates).ids- end-def price_rowsArray(@prices).filter_map do |raw|row = raw.respond_to?(:to_unsafe_h) ? raw.to_unsafe_h.with_indifferent_access : raw.with_indifferent_accessdiff --git a/spree/core/db/migrate/20260825000001_create_spree_catalogs.rb b/spree/core/db/migrate/20260825000001_create_spree_catalogs.rbindex a439c5640a..e16c4d12a3 100644--- a/spree/core/db/migrate/20260825000001_create_spree_catalogs.rb+++ b/spree/core/db/migrate/20260825000001_create_spree_catalogs.rb@@ -14,10 +14,11 @@ class CreateSpreeCatalogs < ActiveRecord::Migration[8.1]t.timestampsend+ # Membership only: a catalog decides what a buyer sees, never the order+ # they see it in, so there is no position here.create_table :spree_catalog_products do |t|t.references :catalog, null: falset.references :product, null: false- t.integer :positiont.timestampsenddiff --git a/spree/core/spec/models/spree/catalog_spec.rb b/spree/core/spec/models/spree/catalog_spec.rbindex 1416fec820..b916d21803 100644--- a/spree/core/spec/models/spree/catalog_spec.rb+++ b/spree/core/spec/models/spree/catalog_spec.rb@@ -28,9 +28,7 @@ describe Spree::Catalog, type: :model doexpect(catalog.products.reload).to contain_exactly(product)end- # `acts_as_list` numbers rows in a callback the bulk insert skips, so the- # appended positions are assigned by hand and worth asserting.- it 'appends after the existing assortment in one statement' do+ it 'appends to the existing assortment in one statement' dofirst = create(:product, store: store)catalog.add_products([first.id])later = create_list(:product, 2, store: store)@@ -38,9 +36,7 @@ describe Spree::Catalog, type: :model doexpect { catalog.add_products(later.map(&:id)) }.to change { catalog.catalog_products.count }.by(2)- positions = catalog.catalog_products.reload.order(:position).pluck(:product_id, :position)- expect(positions.map(&:first)).to eq([first.id, *later.map(&:id)])- expect(positions.map(&:last)).to eq([1, 2, 3])+ expect(catalog.products.reload).to contain_exactly(first, *later)endit 'adds a batch alongside an existing row without raising on the duplicate' dodiff --git a/spree/core/spec/models/spree/price_list_spec.rb b/spree/core/spec/models/spree/price_list_spec.rbindex 5578949254..1c56279376 100644--- a/spree/core/spec/models/spree/price_list_spec.rb+++ b/spree/core/spec/models/spree/price_list_spec.rb@@ -160,41 +160,6 @@ describe Spree::PriceList, type: :model doendend- describe 'product membership' do- let(:store) { create(:store, supported_currencies: 'USD,EUR,GBP') }- let(:price_list) { create(:price_list, store: store) }- # Same store as the list: membership resolves through the store's own- # products, so a product from another store is not a member to be had.- let(:product1) { create(:product, store: store) }- let(:product2) { create(:product, store: store) }-- # Guards the POST/PATCH /price_lists response: membership is reconciled- # through raw upsert_all/delete_all, which bypasses the products- # association cache, so `product_ids` / `product_prefixed_ids` — which the- # serializer renders — must reflect the change WITHOUT a reload.- it 'reflects assigned products in product_ids without reload' do- Spree.price_list_update_workflow.call(- price_list: price_list, attributes: { product_ids: [product1.id, product2.id] }- )-- expect(price_list.product_ids).to match_array([product1.id, product2.id])- expect(price_list.product_prefixed_ids).to match_array(- [product1.prefixed_id, product2.prefixed_id]- )- end-- it 'reflects a partial removal in product_ids without reload' do- Spree.price_list_update_workflow.call(- price_list: price_list, attributes: { product_ids: [product1.id, product2.id] }- )- Spree.price_list_update_workflow.call(- price_list: price_list, attributes: { product_ids: [product1.id] }- )-- expect(price_list.product_ids).to eq([product1.id])- end- end-describe '#add_products' dolet(:store) { create(:store, supported_currencies: 'USD,EUR,GBP') }let(:price_list) { create(:price_list, store: store) }diff --git a/spree/core/spec/workflows/spree/price_lists/write_spec.rb b/spree/core/spec/workflows/spree/price_lists/write_spec.rbindex 45d1209c56..39d2b63530 100644--- a/spree/core/spec/workflows/spree/price_lists/write_spec.rb+++ b/spree/core/spec/workflows/spree/price_lists/write_spec.rb@@ -14,16 +14,8 @@ RSpec.describe 'Spree::PriceLists write workflows' doexpect(result.value.status).to eq('draft')end- it 'applies the product membership it was created with' do- result = described_class.call(- store: store, attributes: { name: 'Wholesale', product_ids: [product.id] }- )-- expect(result.value.product_ids).to eq([product.id])- end-- it 'fails on an invalid list without applying membership' do- result = described_class.call(store: store, attributes: { product_ids: [product.id] })+ it 'fails on an invalid list' do+ result = described_class.call(store: store, attributes: {})expect(result).not_to be_successend@@ -46,65 +38,8 @@ RSpec.describe 'Spree::PriceLists write workflows' doexpect(price_list.reload.name).to eq('StringKeys')end- # Prefixed ids arrive from the console and legacy callers; comparing them- # against integer primary keys would read as "remove everything".- it 'accepts prefixed product ids' do- described_class.call(price_list: price_list, attributes: { product_ids: [product.prefixed_id] })-- expect(price_list.product_ids).to eq([product.id])- end-- # A prefix only encodes a number, so a variant's id decodes to an integer- # that names a product just as readily. Resolving through the store's own- # products is what stops one standing in for the other.- it 'ignores an id that does not name a product in this store' do- Spree.price_list_update_workflow.call(price_list: price_list, attributes: { product_ids: [product.id] })- foreign = create(:product, store: create(:store))-- described_class.call(price_list: price_list, attributes: { product_ids: [product.id, foreign.id] })-- expect(price_list.reload.product_ids).to eq([product.id])- end-- # Array(nil) is [], so without a guard a nil payload reads as the empty- # array that means "clear the list".- it 'leaves membership alone when product_ids is nil' do- Spree.price_list_update_workflow.call(price_list: price_list, attributes: { product_ids: [product.id] })-- described_class.call(price_list: price_list, attributes: { product_ids: nil })-- expect(price_list.reload.product_ids).to eq([product.id])- end-- # Malformed input is not the same instruction as an empty array.- it 'leaves membership alone when every id is blank' do- Spree.price_list_update_workflow.call(price_list: price_list, attributes: { product_ids: [product.id] })-- described_class.call(price_list: price_list, attributes: { product_ids: ['', ' ', nil] })-- expect(price_list.reload.product_ids).to eq([product.id])- end-- it 'clears membership when given an empty array' do- Spree.price_list_update_workflow.call(price_list: price_list, attributes: { product_ids: [product.id] })-- described_class.call(price_list: price_list, attributes: { product_ids: [] })-- expect(price_list.reload.product_ids).to be_empty- end-- it 'adds and removes products' do- other = create(:product, store: store)-- described_class.call(price_list: price_list, attributes: { product_ids: [product.id, other.id] })- expect(price_list.product_ids).to match_array([product.id, other.id])-- described_class.call(price_list: price_list, attributes: { product_ids: [product.id] })- expect(price_list.product_ids).to eq([product.id])- end-it 'upserts the price overrides it is given' do- described_class.call(price_list: price_list, attributes: { product_ids: [product.id] })+ price_list.add_products([product.id])described_class.call(price_list: price_list,@@ -118,7 +53,7 @@ RSpec.describe 'Spree::PriceLists write workflows' do# An empty array means "clear every override", which is a different# instruction from sending no prices at all.it 'clears every override when given an empty prices array' do- described_class.call(price_list: price_list, attributes: { product_ids: [product.id] })+ price_list.add_products([product.id])described_class.call(price_list: price_list,attributes: { prices: [{ variant_id: variant.id, currency: 'USD', amount: 5 }] }@@ -130,7 +65,7 @@ RSpec.describe 'Spree::PriceLists write workflows' doendit 'leaves prices alone when the payload carries none' do- described_class.call(price_list: price_list, attributes: { product_ids: [product.id] })+ price_list.add_products([product.id])described_class.call(price_list: price_list,attributes: { prices: [{ variant_id: variant.id, currency: 'USD', amount: 5 }] }