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
Added typed request params declared once per endpoint
Damian Legawiec6990f3730ffa
diff --git a/.changeset/typed-request-params.md b/.changeset/typed-request-params.mdnew file mode 100644index 0000000000..e51283d110--- /dev/null+++ b/.changeset/typed-request-params.md@@ -0,0 +1,8 @@+---+"@spree/sdk": minor+"@spree/admin-sdk": minor+"@spree/seller-sdk": minor+"@spree/dashboard": patch+---++Request body types are now generated from the API itself, so every create, update and action method takes exactly the fields its endpoint accepts. Fields the API never accepted are gone from the types, and fields it accepted but the types left out are added. Renamed types keep their old names as deprecated aliases (for example `VariantPrice` is now `PriceParams`, `LineItemInput` is now `LineItemInputParams`). The dashboard now saves the store's digital download limits, which the API used to drop.diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.ymlindex 9c0c9d1a9f..f37e34826b 100644--- a/.github/workflows/packages.yml+++ b/.github/workflows/packages.yml@@ -87,6 +87,17 @@ jobs:exit 1fi+ # Request body types come from the request schemas in docs/api-reference,+ # which swaggerize writes from the controllers' request_params.+ - name: Check SDK request types are up to date+ run: |+ pnpm generate:params+ if [ -n "$(git status --porcelain -- 'packages/*/src/types/params')" ]; then+ git diff -- 'packages/*/src/types/params'+ echo "::error::SDK request types are out of date. Run 'pnpm generate:params' and commit the result."+ exit 1+ fi+- run: pnpm turbo lint typecheck test build --cache-dir=.turbo# Creates a new project with create-spree-app the way a user would, but fromdiff --git a/CLAUDE.md b/CLAUDE.mdindex c7469e55ca..632b0236d3 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -244,7 +244,7 @@ The Store API (customer-facing) and Admin API (back-office) are two halves of th#### Flat request/response structure-API v3 uses flat params — no nested Rails-style wrapping. Declare a controller's writable attributes by overriding **`resource_permitted_attributes`** (a plain list). The base `permitted_attributes` appends extension-contributed attributes to it, and `permitted_params` permits and normalizes the result. `Spree::PermittedAttributes` and its model-name inference are **removed in 6.0** — a controller that declares neither `resource_permitted_attributes` nor `permitted_params` raises `NotImplementedError` on its first write.+API v3 uses flat params — no nested Rails-style wrapping. Declare a controller's writable attributes with **`request_params`** — one typed declaration that the controller permits from, the integration spec documents with `request_body_for`, and the SDK request types are generated from (`pnpm generate:params` → `src/types/params/`), so backend, OpenAPI and TypeScript cannot drift. Never hand-write a request body in an rswag spec or a request type in an SDK. Kinds: `string integer number decimal boolean date datetime id any object`; money is `decimal` (canonical string), never `number`. Shared shapes live in `Spree::Api::V3::RequestShapes`; a custom action declares `request_params 'XyzParams', action: :xyz`. `resource_permitted_attributes` (a plain list) still works but leaves the body undocumented and untyped. The base `permitted_attributes` appends extension-contributed attributes to it, and `permitted_params` permits and normalizes the result. `Spree::PermittedAttributes` and its model-name inference are **removed in 6.0** — a controller that declares neither `resource_permitted_attributes` nor `permitted_params` raises `NotImplementedError` on its first write.Extensions add writable attributes to a core resource from an initializer, appending to the model's `additional_permitted_attributes` (a `class_attribute` on `Spree::Base`, default `[]`): `Spree::Product.additional_permitted_attributes += [:brand_id]`. Always `+=`, never `=` — assigning replaces what another extension added. Core STI subclasses set theirs with `self.additional_permitted_attributes = [...]` in the class body. Three rules that matter:@@ -255,9 +255,10 @@ Extensions add writable attributes to a core resource from an initializer, appenPrefer Custom Fields for merchant-managed data; the hook is for extensions adding real columns.```ruby-# ✅ Flat params-def permitted_params- params.permit(:name, :description, :slug)+# ✅ Flat params, declared once+request_params :product do+ string :name, required: :create+ string :description, :slugend# ❌ Nested params — not used in API v3@@ -729,6 +730,7 @@ cd packages/sdk && pnpm test # 5. SDK tests- TypeScript types → `packages/sdk/src/types/generated/` (Store) and `packages/admin-sdk/src/types/generated/` (Admin)- Zod schemas → `src/zod/generated/` in each SDK, exported as `@spree/sdk/zod`, `@spree/admin-sdk/zod` and `@spree/seller-sdk/zod`. Each SDK's `zod-schemas.test.ts` validates them against the responses recorded in `docs/api-reference/*.yaml`- Store types: `StoreProduct`, `StoreOrder`, etc. Admin types: `AdminProduct`, `AdminOrder`, etc.+- Request body types → `src/types/params/` in each SDK, from the request schemas swaggerize writes (`pnpm generate:params`; the Lefthook hook and CI keep them in sync with `docs/api-reference/*.yaml`)A **Lefthook pre-commit hook** (`lefthook.yml`) regenerates types and Zod schemas automatically whenever `spree/api/app/serializers/**/*.rb` files are committed, then re-stages the generated output. You don't need to run steps 1 and 2 manually if you're committing serializer changes — the hook handles it. It also regenerates the Zod schemas when generated types or the generator change, and CI fails when committed schemas don't match the types. Steps 3–5 (integration tests, OpenAPI regen, SDK tests) still need to run locally before pushing — run step 3 as `pnpm test:rspec api spec/integration/` so it queues with the other sessions.diff --git a/docs/api-reference/admin.yaml b/docs/api-reference/admin.yamlindex d144b40a58..66f164083d 100644--- a/docs/api-reference/admin.yaml+++ b/docs/api-reference/admin.yaml@@ -267,6 +267,78 @@ paths:responses:'204':description: logout successful+ "/api/v3/admin/auth/invitations/{id}/accept":+ parameters:+ - name: id+ in: path+ description: Invitation ID from the emailed link+ required: true+ schema:+ type: string+ post:+ summary: Accept an invitation+ tags:+ - Authentication+ description: |+ Accepts a staff invitation and returns a signed-in admin session, so the+ new member lands in the dashboard rather than on a login form.++ Unauthenticated — the ID and token in the emailed link are the+ credential. The email is never taken from the request; it always comes+ from the invitation.++ `password` is required when no account exists for the invited address,+ in which case it sets one. When an account already exists, the same+ field is how the person proves the account is theirs.+ parameters:+ - name: token+ in: query+ required: true+ description: The token from the emailed link+ schema:+ type: string+ responses:+ '200':+ description: invitation accepted, session issued+ content:+ application/json:+ example:+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjQ2MzZlMDBiLTdmZGMtNDk1Mi1hNzhhLTI4YmEyMTVjNDk0MSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzY4NDc4NzAwfQ.AwpPaRCvRIV36C8k4nChul5s7yq_yWFTSy_TyVlrbXA+ user:+ id: adm_gbHJdmfrXB+ email: [email protected]+ first_name: Robin+ last_name: Ellis+ full_name: Robin Ellis+ selected_locale:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ avatar_url:+ roles:+ - id: role_UkLWZg9DAJ+ name: admin+ stores:+ - id: store_UkLWZg9DAJ+ name: Spree Test Store+ code: spree_1+ schema:+ "$ref": "#/components/schemas/AuthResponse"+ '404':+ description: wrong token, or an invitation that can no longer be accepted+ content:+ application/json:+ example:+ error:+ code: record_not_found+ message: Invitation not found, expired, or already accepted+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/InvitationAcceptParams"+ required: true"/api/v3/admin/me":get:summary: Get current admin user and permissions@@ -544,17 +616,8 @@ paths:content:application/json:schema:- type: object- properties:- selected_locale:- type: string- example: de- first_name:- type: string- example: Ada- last_name:- type: string- example: Lovelace+ "$ref": "#/components/schemas/MeUpdateParams"+ required: true"/api/v3/admin/auth/password_resets":post:summary: Request password reset@@ -611,19 +674,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- redirect_url:- type: string- example: https://admin.your-store.com/reset-password- description: Honoured only on the dashboard origin, for an account- that is staff of the store; ignored otherwise.- required:+ "$ref": "#/components/schemas/PasswordResetRequestParams"+ required: true"/api/v3/admin/auth/password_resets/{id}":patch:summary: Reset password@@ -709,17 +761,8 @@ paths:content:application/json:schema:- type: object- properties:- password:- type: string- example: new-password-123- password_confirmation:- type: string- example: new-password-123- required:- - password- - password_confirmation+ "$ref": "#/components/schemas/PasswordResetParams"+ required: true"/api/v3/admin/auth/setup":get:summary: Check first-run setup availability@@ -783,55 +826,8 @@ paths:content:application/json:schema:- type: object- required:- - setup_token- - password- - country_code- properties:- setup_token:- type: string- description: One-time token from the install output.- email:- type: string- format: email- example: [email protected]- password:- type: string- example: Secret123!- password_confirmation:- type: string- example: Secret123!- first_name:- type: string- example: Olivia- last_name:- type: string- example: Owner- store_name:- type: string- example: My Store- 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.- example: US- locale:- type: string- description: Storefront locale. Defaults to the country's own language.- example: en- currency:- type: string- description: ISO 4217 currency. Defaults to the country's own currency- — pass one only when the store prices in something else.- example: USD- sample_data:- type: boolean- description: Load the demo catalog, customers and orders in the- background once the admin account exists.- example: false+ "$ref": "#/components/schemas/SetupParams"+ required: true"/api/v3/admin/auth/setup/countries":get:summary: List countries for first-run setup@@ -2307,13 +2303,8 @@ paths:content:application/json:schema:- type: object- properties:- origin:- type: string- example: https://admin.example.com- required:- - origin+ "$ref": "#/components/schemas/AllowedOriginCreateParams"+ required: true"/api/v3/admin/allowed_origins/{id}":parameters:- name: id@@ -2461,10 +2452,8 @@ paths:content:application/json:schema:- type: object- properties:- origin:- type: string+ "$ref": "#/components/schemas/AllowedOriginUpdateParams"+ required: truedelete:summary: Delete an allowed origintags:@@ -2724,26 +2713,8 @@ paths:content:application/json:schema:- type: object- required:- - name- - key_type- properties:- name:- type: string- example: Backend integration- key_type:- type: string- enum:- - publishable- - secret- scopes:- type: array- items:- type: string- example:- - read_orders- - write_orders+ "$ref": "#/components/schemas/ApiKeyCreateParams"+ required: true"/api/v3/admin/api_keys/{id}":get:summary: Show an API key@@ -2872,11 +2843,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Backend integration (renamed)+ "$ref": "#/components/schemas/ApiKeyUpdateParams"+ required: truedelete:summary: Delete an API keytags:@@ -3272,27 +3240,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Shirts- parent_id:- type: string- example: ctg_abc123- 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+ "$ref": "#/components/schemas/CategoryCreateParams"+ required: true"/api/v3/admin/categories/{id}":get:summary: Get a category@@ -3439,24 +3388,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Apparel- 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+ "$ref": "#/components/schemas/CategoryUpdateParams"+ required: truedelete:summary: Delete a categorytags:@@ -3556,16 +3489,8 @@ paths: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+ "$ref": "#/components/schemas/CategoryRepositionParams"+ required: true"/api/v3/admin/categories/{category_id}/products":get:summary: List category products@@ -3840,16 +3765,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: truedelete:summary: Remove products from a categorytags:@@ -3890,16 +3807,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: true"/api/v3/admin/categories/{category_id}/products/{id}/reposition":patch:summary: Reposition a category product@@ -3943,13 +3852,8 @@ paths:content:application/json:schema:- type: object- properties:- new_position:- type: integer- description: 0-based index among the category's products- required:- - new_position+ "$ref": "#/components/schemas/ProductMembershipRepositionParams"+ required: true"/api/v3/admin/categories/{category_id}/custom_fields":get:summary: List category custom fields@@ -4273,42 +4177,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Point of Sale- code:- type: string- example: pos- description: Slug — auto-derived from `name` when blank.- active:- type: boolean- default: true- default:- type: boolean- default: false- order_routing_strategy:- type: string- nullable: true- description: 'Routing strategy shorthand (built-in: `rules`). `null`- inherits the store setting.'- storefront_access:- type: string- nullable: true- enum:- - public- - prices_hidden- - login_required- description: Anonymous-visitor access posture. `null` inherits the- store setting.- guest_checkout:- type: boolean- nullable: true- description: Whether guests can check out without an account. `null`- inherits the store setting.+ "$ref": "#/components/schemas/ChannelCreateParams"+ required: true"/api/v3/admin/channels/{id}":parameters:- name: id@@ -4427,35 +4297,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- code:- type: string- active:- type: boolean- default:- type: boolean- order_routing_strategy:- type: string- nullable: true- description: 'Routing strategy shorthand (built-in: `rules`). `null`- inherits the store setting.'- storefront_access:- type: string- nullable: true- enum:- - public- - prices_hidden- - login_required- description: Anonymous-visitor access posture. `null` inherits the- store setting.- guest_checkout:- type: boolean- nullable: true- description: Whether guests can check out without an account. `null`- inherits the store setting.+ "$ref": "#/components/schemas/ChannelUpdateParams"+ required: truedelete:summary: Delete a channeltags:@@ -4562,24 +4405,8 @@ paths: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.+ "$ref": "#/components/schemas/ChannelAddProductsParams"+ required: true"/api/v3/admin/channels/{id}/remove_products":parameters:- name: id@@ -4642,14 +4469,8 @@ paths:content:application/json:schema:- type: object- required:- - product_ids- properties:- product_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ChannelRemoveProductsParams"+ required: true"/api/v3/admin/channels/{channel_id}/order_routing_rules":parameters:- name: channel_id@@ -4839,20 +4660,8 @@ paths:content:application/json:schema:- type: object- properties:- type:- type: string- example: preferred_location- active:- type: boolean- position:- type: integer- preferences:- type: object- additionalProperties: true- required:- - type+ "$ref": "#/components/schemas/OrderRoutingRuleCreateParams"+ required: true"/api/v3/admin/channels/{channel_id}/order_routing_rules/{id}":parameters:- name: channel_id@@ -4924,15 +4733,8 @@ paths:content:application/json:schema:- type: object- properties:- active:- type: boolean- position:- type: integer- preferences:- type: object- additionalProperties: true+ "$ref": "#/components/schemas/OrderRoutingRuleUpdateParams"+ required: truedelete:summary: Delete an order routing ruletags:@@ -5248,40 +5050,8 @@ paths: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 token (`short_text`, `long_text`,- `rich_text`, `number`, …). An extension type that has no token- is named by its registered class instead.- resource_type:- type: string- description: Shorthand of the owning resource, e.g. `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+ "$ref": "#/components/schemas/CustomFieldDefinitionCreateParams"+ required: true"/api/v3/admin/custom_field_definitions/{id}":get:summary: Show a custom field definition@@ -5419,16 +5189,8 @@ paths:content:application/json:schema:- type: object- properties:- label:- type: string- storefront_visible:- type: boolean- searchable:- type: boolean- sortable:- type: boolean+ "$ref": "#/components/schemas/CustomFieldDefinitionUpdateParams"+ required: truedelete:summary: Delete a custom field definitiontags:@@ -5710,23 +5472,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Wholesale- description:- type: string- example: B2B accounts- nullable: true- customer_ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ+ "$ref": "#/components/schemas/CustomerGroupCreateParams"+ required: true"/api/v3/admin/customer_groups/{id}":parameters:- name: id@@ -5919,21 +5666,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: VIP customers (Q1)- description:- type: string- example: Updated description- nullable: true- customer_ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ+ "$ref": "#/components/schemas/CustomerGroupUpdateParams"+ required: truedelete:summary: Delete a customer grouptags:@@ -6478,6 +6212,59 @@ paths:required:- data- meta+ post:+ summary: Record a data request+ tags:+ - Customers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Records a request a customer made to the merchant directly, to export+ or erase their personal data, and starts answering it. A request of the+ same kind already in progress for the customer is returned instead of a+ second one.+++ **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:+ '202':+ description: data request recorded+ content:+ application/json:+ example:+ id: dsr_UkLWZg9DAJ+ number: DSR1001+ kind: access+ status: pending+ requested_at: '2026-01-15T12:00:00Z'+ completed_at:+ expires_at:+ email: [email protected]+ error_message:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ customer_id: cust_UkLWZg9DAJ+ requested_by_id: adm_UkLWZg9DAJ+ schema:+ "$ref": "#/components/schemas/DataRequest"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DataRequestCreateParams"+ required: true"/api/v3/admin/customers/{customer_id}/addresses":get:summary: List customer addresses@@ -6596,7 +6383,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 11 Lovely Street+ address1: 26 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -6724,36 +6511,8 @@ paths: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+ "$ref": "#/components/schemas/CustomerAddressParams"+ required: true"/api/v3/admin/customers/{customer_id}/addresses/{id}":patch:summary: Update a customer address@@ -6815,7 +6574,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 13 Lovely Street+ address1: 28 Lovely Streetaddress2: Northwestpostal_code: '10118'city: Manhattan@@ -6843,14 +6602,8 @@ paths:content:application/json:schema:- type: object- properties:- city:- type: string- is_default_billing:- type: boolean- is_default_shipping:- type: boolean+ "$ref": "#/components/schemas/CustomerAddressParams"+ required: truedelete:summary: Delete a customer addresstags:@@ -7387,19 +7140,8 @@ paths:content:application/json:schema:- type: object- required:- - amount- - currency- properties:- amount:- type: string- example: '50.00'- currency:- type: string- example: USD- memo:- type: string+ "$ref": "#/components/schemas/CustomerStoreCreditCreateParams"+ required: true"/api/v3/admin/customers/{customer_id}/store_credits/{id}":patch:summary: Update a store credit@@ -7476,13 +7218,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- example: '50.00'- memo:- type: string+ "$ref": "#/components/schemas/CustomerStoreCreditUpdateParams"+ required: truedelete:summary: Delete a store credittags:@@ -7913,29 +7650,8 @@ paths:content:application/json:schema:- type: object- required:- properties:- email:- type: string- example: [email protected]- 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+ "$ref": "#/components/schemas/CustomerCreateParams"+ required: true"/api/v3/admin/customers/{id}":get:summary: Show a customer@@ -8107,26 +7823,8 @@ paths: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+ "$ref": "#/components/schemas/CustomerUpdateParams"+ required: truedelete:summary: Delete a customertags:@@ -8236,24 +7934,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - customer_group_ids- properties:- ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ- - cus_QrLWXg9CAJ- customer_group_ids:- type: array- items:- type: string- example:- - cg_UkLWZg9DAJ+ "$ref": "#/components/schemas/CustomerBulkGroupsParams"+ required: true"/api/v3/admin/customers/bulk_remove_from_groups":post:summary: Bulk-remove customers from groups@@ -8316,23 +7998,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - customer_group_ids- properties:- ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ- customer_group_ids:- type: array- items:- type: string- example:- - cg_UkLWZg9DAJ+ "$ref": "#/components/schemas/CustomerBulkGroupsParams"+ required: true"/api/v3/admin/customers/bulk_add_tags":post:summary: Bulk-add tags to customers@@ -8395,24 +8062,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - tags- properties:- ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ- tags:- type: array- items:- type: string- example:- - vip- - newsletter+ "$ref": "#/components/schemas/BulkTagsParams"+ required: true"/api/v3/admin/customers/bulk_remove_tags":post:summary: Bulk-remove tags from customers@@ -8475,23 +8126,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - tags- properties:- ids:- type: array- items:- type: string- example:- - cus_UkLWZg9DAJ- tags:- type: array- items:- type: string- example:- - vip+ "$ref": "#/components/schemas/BulkTagsParams"+ required: true"/api/v3/admin/email_templates":get:summary: List email templates@@ -9044,25 +8680,8 @@ paths:content:application/json:schema:- type: object- properties:- language:- type: string- example: any- subject:- type: string- example: Your order {{ order.number }} is confirmed- body:- type: string- example: "<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name- }}!</mj-text></mj-column></mj-section>"- lock_version:- type: integer- example: 0- rebase:- type: boolean- description: Marks the draft as based on Spree's current default,- after reviewing what changed in it+ "$ref": "#/components/schemas/EmailTemplateDraftParams"+ required: truedelete:summary: Discard an email template drafttags:@@ -9236,15 +8855,7 @@ paths:content:application/json:schema:- type: object- properties:- language:- type: string- example: any- lock_version:- type: integer- description: The draft's `lock_version` as reviewed; a draft saved- since is refused with 409+ "$ref": "#/components/schemas/EmailTemplateVersionParams""/api/v3/admin/email_templates/{email_template_id}/preview":parameters:- name: email_template_id@@ -9488,52 +9099,8 @@ paths:content:application/json:schema:- type: object- properties:- language:- type: string- example: any- subject:- type: string- example: Your order {{ order.number }} is confirmed- body:- type: string- example: "<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name- }}!</mj-text></mj-column></mj-section>"- record_id:- type: string- example: or_m3Rp9wXz- description: The record to build sample data from- email_key:- type: string- example: spree.order_mailer.confirm_email- description: For the layout or a partial, the email to show it in- branding:- type: object- description: Unsaved colors and font to preview, named like the- store's `email_*` settings- properties:- accent_color:- type: string- example: "#FF5500"- background_color:- type: string- card_color:- type: string- text_color:- type: string- heading_color:- type: string- font:- type: string- enum:- - inter- - system- - helvetica- - georgia- - roboto- - lato- - merriweather+ "$ref": "#/components/schemas/EmailTemplatePreviewParams"+ required: true"/api/v3/admin/email_templates/{email_template_id}/test_email":parameters:- name: email_template_id@@ -9603,19 +9170,8 @@ paths:content:application/json:schema:- type: object- properties:- language:- type: string- example: any- subject:- type: string- body:- type: string- record_id:- type: string- email_key:- type: string+ "$ref": "#/components/schemas/EmailTemplatePreviewParams"+ required: true"/api/v3/admin/email_templates/{email_template_id}/sample_records":parameters:- name: email_template_id@@ -9906,13 +9462,7 @@ paths:content:application/json:schema:- type: object- properties:- language:- type: string- example: any- lock_version:- type: integer+ "$ref": "#/components/schemas/EmailTemplateRestoreParams""/api/v3/admin/exports":get:summary: List exports@@ -10100,46 +9650,8 @@ paths:content:application/json:schema:- type: object- required:- - type- properties:- type:- type: string- enum:- - products- - orders- - customers- - product_translations- - gift_cards- - coupon_codes- - newsletter_subscribers- - price_list_prices- - purchase_orders- example: products- record_selection:- type: string- enum:- - filtered- - all- description: Set to "all" to ignore search_params and export everything- in scope.- example: filtered- search_params:- type: object- description: 'Ransack query hash. Same predicates accepted by the- list endpoint. A `price_list_prices` export requires `price_list_id_eq`- naming a price list of the current store, and refuses `record_selection:- "all"`.'- example:- name_cont: shirt- 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.- example: https://admin.example.com/store_abc/exports+ "$ref": "#/components/schemas/ExportCreateParams"+ required: true"/api/v3/admin/exports/{id}":get:summary: Show an export@@ -10361,7 +9873,7 @@ paths:content:application/json:example:- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--bb0b6973ee0447f02cdcd29af88cf330e909e39c+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7bfilename: products.csvcontent_type: text/csvbyte_size: 48213@@ -10369,7 +9881,7 @@ paths:expires_at: '2026-01-16T12:00:00.000Z'upload:method: PUT- url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJxcmZsMnNod3YwYmR4cWF3ZWFocDZvYjhlYzh5IiwiY29udGVudF90eXBlIjoidGV4dC9jc3YiLCJjb250ZW50X2xlbmd0aCI6NDgyMTMsImNoZWNrc3VtIjoiaGdKTXJSNkRFQjJYTloxelVRVVJWZz09Iiwic2VydmljZV9uYW1lIjoidGVzdCJ9LCJleHAiOiIyMDI2LTAxLTE1VDEyOjA1OjAwLjAwMFoiLCJwdXIiOiJibG9iX3Rva2VuIn19--6232b64223176120a39db5ee65051c450ce2c899+ url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJxcmZsMnNod3YwYmR4cWF3ZWFocDZvYjhlYzh5IiwiY29udGVudF90eXBlIjoidGV4dC9jc3YiLCJjb250ZW50X2xlbmd0aCI6NDgyMTMsImNoZWNrc3VtIjoiaGdKTXJSNkRFQjJYTloxelVRVVJWZz09Iiwic2VydmljZV9uYW1lIjoidGVzdCJ9LCJleHAiOiIyMDI2LTAxLTE1VDEyOjA1OjAwLjAwMFoiLCJwdXIiOiJibG9iX3Rva2VuIn19--ed799f60fadce55611909eaf5b157803a29bebf9headers:Content-Type: text/csvschema:@@ -10394,64 +9906,11 @@ paths:content:application/json:schema:- type: object- properties:- filename:- type: string- example: products.csv- content_type:- type: string- example: text/csv- byte_size:- type: integer- example: 48213- checksum:- type: string- description: Base64-encoded MD5 digest of the file- example: rL0Y20zC+Fzt72VPzMSk2A==- visibility:- type: string- enum:- - public- - private- default: public- file:- type: string- format: binary- description: The bytes, for a multipart upload- required:- - filename- - content_type+ "$ref": "#/components/schemas/FileUploadCreateParams"multipart/form-data:schema:- type: object- properties:- filename:- type: string- example: products.csv- content_type:- type: string- example: text/csv- byte_size:- type: integer- example: 48213- checksum:- type: string- description: Base64-encoded MD5 digest of the file- example: rL0Y20zC+Fzt72VPzMSk2A==- visibility:- type: string- enum:- - public- - private- default: public- file:- type: string- format: binary- description: The bytes, for a multipart upload- required:- - filename- - content_type+ "$ref": "#/components/schemas/FileUploadCreateParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments":get:summary: List fulfillments@@ -10719,62 +10178,8 @@ paths:content:application/json:schema:- type: object- required:- - stock_location_id- properties:- stock_location_id:- type: string- description: Stock location the fulfillment ships from- source_fulfillment_id:- type: string- description: The only fulfillment of this order to move units from,- its exchange and claim replacements included. Omit to take the- customer's bought units from every unshipped fulfillment- tracking:- type: string- example: INPOST-12345- 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- example: '7.42'- 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- example: 1- metadata:- type: object- additionalProperties: true+ "$ref": "#/components/schemas/FulfillmentCreateParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments/{id}":get:summary: Show a shipment@@ -10999,16 +10404,8 @@ paths:content:application/json:schema:- type: object- properties:- tracking:- type: string- example: 1Z999AA10123456784- 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+ "$ref": "#/components/schemas/FulfillmentUpdateParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":patch:summary: Fulfill a fulfillment@@ -11069,8 +10466,8 @@ paths:example:id: ful_UkLWZg9DAJnumber: R1001-F1- tracking: U10000- tracking_url:+ tracking: 1Z999AA10123456784+ tracking_url: https://www.ups.com/track?tracknum=1Z999AA10123456784pickup_point_data:selected_delivery_rate_id: dr_gbHJdmfrXBunpriced: false@@ -11090,12 +10487,12 @@ paths:quantity: 1deliveries:- id: dlv_UkLWZg9DAJ- tracking_number: U10000- carrier:- carrier_name:+ tracking_number: 1Z999AA10123456784+ carrier: ups+ carrier_name: UPSservice:status: pending- tracking_url:+ tracking_url: https://www.ups.com/track?tracknum=1Z999AA10123456784estimated_delivery_at:delivered_at:details:@@ -11112,6 +10509,11 @@ paths:documents: []labels: []provider_generates_labels: false+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/FulfillmentFulfillParams""/api/v3/admin/orders/{order_id}/fulfillments/{id}/mark_delivered":patch:summary: Mark a fulfillment delivered@@ -11231,16 +10633,8 @@ paths: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.+ "$ref": "#/components/schemas/FulfillmentMarkDeliveredParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":patch:summary: Cancel a fulfillment@@ -11449,20 +10843,8 @@ paths:content:application/json:schema:- type: object- required:- - variant_id- - quantity- properties:- variant_id:- type: string- description: Variant ID- quantity:- type: integer- example: 1- stock_location_id:- type: string- description: Target stock location ID+ "$ref": "#/components/schemas/FulfillmentSplitParams"+ required: true"/api/v3/admin/gift_card_batches":get:summary: List gift card batches@@ -11677,32 +11059,8 @@ paths:content:application/json:schema:- type: object- required:- - prefix- - amount- - codes_count- properties:- prefix:- type: string- example: WELCOME- description: Lowercased and prepended to every generated code.- amount:- type: string- example: '25.00'- description: Decimal amount per card, greater than zero.- currency:- type: string- example: USD- description: ISO 4217 currency code. Defaults to the store currency.- codes_count:- type: integer- example: 100- description: Number of cards to generate. Capped at `gift_card_batch_limit`.- expires_at:- type: string- example: '2030-12-31'- nullable: true+ "$ref": "#/components/schemas/GiftCardBatchCreateParams"+ required: true"/api/v3/admin/gift_card_batches/{id}":parameters:- name: id@@ -12121,33 +11479,8 @@ paths:content:application/json:schema:- type: object- required:- - amount- properties:- amount:- type: string- example: '25.00'- description: Decimal amount, greater than zero.- currency:- type: string- example: USD- description: ISO 4217 currency code. Defaults to the store currency.- code:- type: string- example: WELCOME50- description: Optional caller-supplied code. Auto-generated when- omitted.- expires_at:- type: string- example: '2030-12-31'- description: ISO 8601 date.- nullable: true- customer_id:- type: string- example: cus_UkLWZg9DAJ- description: Optional customer prefixed ID.- nullable: true+ "$ref": "#/components/schemas/GiftCardCreateParams"+ required: true"/api/v3/admin/gift_cards/{id}":parameters:- name: id@@ -12304,19 +11637,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- example: '75.00'- expires_at:- type: string- example: '2031-12-31'- nullable: true- customer_id:- type: string- example: cus_UkLWZg9DAJ- nullable: true+ "$ref": "#/components/schemas/GiftCardUpdateParams"+ required: truedelete:summary: Delete a gift cardtags:@@ -13022,44 +12344,8 @@ paths:content:application/json:schema:- type: object- required:- - type- - attachment_signed_id- properties:- type:- type: string- enum:- - products- - customers- - product_translations- - price_list_prices- - purchase_orders- example: products- price_list_id:- type: string- description: 'For `price_list_prices` imports: the price list the- rows are merged into. Must belong to the current store.'- example: pl_86Rf07xd4z- attachment_signed_id:- type: string- description: The `signed_id` returned by POST /api/v3/admin/files.- example: eyJfcmFpbHMiOnsiZGF0YSI6MX0=--signed- delimiter:- type: string- enum:- - ","- - ";"- - "|"- - "\t"- description: CSV column separator. Defaults to a comma.- example: ","- 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.- example: https://admin.example.com/store_abc/settings/imports+ "$ref": "#/components/schemas/ImportCreateParams"+ required: true"/api/v3/admin/imports/template":get:summary: Download an import template@@ -13773,24 +13059,7 @@ paths: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- example: slug- file_column:- type: string- nullable: true- example: Product Handle+ "$ref": "#/components/schemas/ImportCompleteMappingParams""/api/v3/admin/imports/{id}/retry_failed_rows":patch:summary: Retry failed rows@@ -14349,53 +13618,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Europe- currency:- type: string- example: EUR- description: ISO 4217 currency code.- default_locale:- type: string- example: de- 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.- example:- - de- - en- 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.- example:- - DE- - FR- required:- - name- - currency- - default_locale- - country_codes+ "$ref": "#/components/schemas/MarketCreateParams"+ required: true"/api/v3/admin/markets/{id}":parameters:- name: id@@ -14567,28 +13791,8 @@ paths: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+ "$ref": "#/components/schemas/MarketUpdateParams"+ required: truedelete:summary: Delete a markettags:@@ -14873,7 +14077,7 @@ paths:example:data:- id: opt_UkLWZg9DAJ- name: foo-size-6+ name: foo-size-12label: Sizeposition: 1kind: dropdown@@ -15001,36 +14205,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: color- label:- type: string- example: Color- position:- type: integer- example: 1- filterable:- type: boolean- example: true- option_values:- type: array- items:- type: object- properties:- name:- type: string- example: red- label:- type: string- example: Red- position:- type: integer- required:- - name- - label+ "$ref": "#/components/schemas/OptionTypeCreateParams"+ required: true"/api/v3/admin/option_types/{id}":get:summary: Get an option type@@ -15097,7 +14273,7 @@ paths:application/json:example:id: opt_UkLWZg9DAJ- name: foo-size-10+ name: foo-size-16label: Sizeposition: 1kind: dropdown@@ -15171,7 +14347,7 @@ paths:application/json:example:id: opt_UkLWZg9DAJ- name: foo-size-12+ name: foo-size-18label: Updated Labelposition: 1kind: dropdown@@ -15200,36 +14376,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: color- label:- type: string- example: Color- position:- type: integer- example: 1- filterable:- type: boolean- example: true- option_values:- type: array- items:- type: object- properties:- id:- type: string- description: Existing option value ID to update- name:- type: string- example: red- label:- type: string- example: Red- position:- type: integer+ "$ref": "#/components/schemas/OptionTypeUpdateParams"+ required: truedelete:summary: Delete an option typetags:@@ -15569,6 +14717,341 @@ paths:required:- data- meta+ post:+ summary: Create a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Opens a damage or missing-item claim on a completed order. Each item says how it should be made right: money back, a replacement, or both.++ **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: claim opened+ content:+ application/json:+ example:+ id: claim_gbHJdmfrXB+ number: CLM1002+ status: open+ resolution:+ order_id: or_gbHJdmfrXB+ reason_id:+ refund_total: '10.00'+ approved_at:+ resolved_at:+ denied_at:+ canceled_at:+ memo: Arrived cracked+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ created_by_id: adm_UkLWZg9DAJ+ created_by_type: admin_user+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimCreateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/claims/{id}":+ patch:+ summary: Update a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits the reason, memo or metadata of a claim. Its status moves only through the approve, resolve, deny and cancel actions.++ **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+ - name: id+ in: path+ required: true+ description: Claim prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: claim updated+ content:+ application/json:+ example:+ id: claim_UkLWZg9DAJ+ number: CLM1001+ status: open+ resolution:+ order_id: or_UkLWZg9DAJ+ reason_id: clr_UkLWZg9DAJ+ refund_total: '10.00'+ approved_at:+ resolved_at:+ denied_at:+ canceled_at:+ memo: Customer sent photos+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimUpdateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/claims/{id}/resolve":+ patch:+ summary: Resolve a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Settles an approved claim with money back, a replacement shipment, or both.++ **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+ - name: id+ in: path+ required: true+ description: Claim prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: claim resolved+ content:+ application/json:+ example:+ id: claim_UkLWZg9DAJ+ number: CLM1001+ status: resolved+ resolution: refund+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ approved_at: '2026-01-15T12:00:00Z'+ resolved_at: '2026-01-15T12:00:00Z'+ denied_at:+ canceled_at:+ memo: Arrived with a cracked screen+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Claim"+ '422':+ description: unknown resolution+ content:+ application/json:+ example:+ error:+ code: processing_error+ message: Invalid resolution+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimResolveParams"+ required: true+ "/api/v3/admin/orders/{order_id}/claims/{id}/deny":+ patch:+ summary: Deny a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Turns down an open claim, recording why for the customer.++ **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+ - name: id+ in: path+ required: true+ description: Claim prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: claim denied+ content:+ application/json:+ example:+ id: claim_UkLWZg9DAJ+ number: CLM1001+ status: denied+ resolution:+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ approved_at:+ resolved_at:+ denied_at: '2026-01-15T12:00:00Z'+ canceled_at:+ memo: |-+ Arrived with a cracked screen+ Outside warranty+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimDenyParams"+ "/api/v3/admin/orders/{order_id}/claims/{id}/cancel":+ patch:+ summary: Cancel a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Withdraws a claim that has not been resolved.++ **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+ - name: id+ in: path+ required: true+ description: Claim prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: claim canceled+ content:+ application/json:+ example:+ id: claim_UkLWZg9DAJ+ number: CLM1001+ status: canceled+ resolution:+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ approved_at:+ resolved_at:+ denied_at:+ canceled_at: '2026-01-15T12:00:00Z'+ memo: |-+ Arrived with a cracked screen+ Customer found the missing item+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimCancelParams""/api/v3/admin/orders/{order_id}/custom_fields":get:summary: List order custom fields@@ -16075,6 +15558,328 @@ paths:required:- data- meta+ post:+ summary: Create an exchange+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Opens an exchange on a completed order: items coming back, and the variant that goes out in place of each.++ **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: exchange opened+ content:+ application/json:+ example:+ id: exch_gbHJdmfrXB+ number: EX1002+ status: requested+ order_id: or_gbHJdmfrXB+ reason_id:+ price_difference: '9.99'+ approved_at:+ received_at:+ fulfilled_at:+ canceled_at:+ memo: Wrong size+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id: adm_UkLWZg9DAJ+ created_by_type: admin_user+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeCreateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/exchanges/{id}":+ patch:+ summary: Update an exchange+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits the warehouse, reason, memo or metadata of an exchange. Its status moves only through the approve, receive, fulfill and cancel actions.++ **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+ - name: id+ in: path+ required: true+ description: Exchange prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: exchange updated+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: requested+ order_id: or_UkLWZg9DAJ+ reason_id: rar_UkLWZg9DAJ+ price_difference: '9.99'+ approved_at:+ received_at:+ fulfilled_at:+ canceled_at:+ memo: Customer wants a larger size+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeUpdateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/exchanges/{id}/receive":+ patch:+ summary: Receive an exchange+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Records the goods that came back on an approved exchange. Omit `items` to receive everything as requested and resellable.++ **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+ - name: id+ in: path+ required: true+ description: Exchange prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: exchange received+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: received+ order_id: or_UkLWZg9DAJ+ reason_id:+ price_difference: '9.99'+ approved_at: '2026-01-15T12:00:00Z'+ received_at: '2026-01-15T12:00:00Z'+ fulfilled_at:+ canceled_at:+ memo: Wrong size+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeReceiveParams"+ "/api/v3/admin/orders/{order_id}/exchanges/{id}/fulfill":+ patch:+ summary: Fulfill an exchange+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Ships the replacements for a received exchange and settles any price difference.++ **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+ - name: id+ in: path+ required: true+ description: Exchange prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: exchange fulfilled+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: fulfilled+ order_id: or_UkLWZg9DAJ+ reason_id:+ price_difference: '9.99'+ approved_at: '2026-01-14T12:00:00Z'+ received_at: '2026-01-15T12:00:00Z'+ fulfilled_at: '2026-01-15T12:00:00Z'+ canceled_at:+ memo: Wrong size+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeFulfillParams"+ "/api/v3/admin/orders/{order_id}/exchanges/{id}/cancel":+ patch:+ summary: Cancel an exchange+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Withdraws an exchange whose goods have not been received.++ **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+ - name: id+ in: path+ required: true+ description: Exchange prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: exchange canceled+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: canceled+ order_id: or_UkLWZg9DAJ+ reason_id:+ price_difference: '9.99'+ approved_at:+ received_at:+ fulfilled_at:+ canceled_at: '2026-01-15T12:00:00Z'+ memo: |-+ Wrong size+ Customer kept the original+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeCancelParams""/api/v3/admin/orders/{order_id}/tax_lines":get:summary: List tax lines@@ -16385,28 +16190,68 @@ paths:content:application/json:schema:- type: object- properties:- label:- type: string- example: Customer appeasement- value:- type: string- example: '10.00'+ "$ref": "#/components/schemas/DiscountCreateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/discounts/{id}":+ patch:+ summary: Update manual discount+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits the label or amount of a manual discount and re-sums the order totals. Promotion-sourced rows are owned by recalculation and respond 422.++ **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+ - name: id+ in: path+ required: true+ description: Discount prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: discount updated+ content:+ application/json:+ example:+ id: disc_UkLWZg9DAJ+ label: Loyalty reward+ kind: manual+ code:value_type:- type: string- enum:- - flat- - percent- example: flat- line_item_id:- type: string- nullable: true- example: item_abc123- description: Target line item; omit to distribute order-level- required:- - label- - value+ value:+ promotion_id:+ line_item_id: li_UkLWZg9DAJ+ fulfillment_id:+ amount: "-5.00"+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DiscountUpdateParams"+ required: true"/api/v3/admin/orders/{order_id}/fees":get:summary: List fees@@ -16583,35 +16428,66 @@ paths:content:application/json:schema:- type: object- properties:- label:- type: string- example: Gift wrap- amount:- type: string- example: '4.00'- kind:- type: string- enum:- - surcharge- - handling- - gift_wrap- - cod- - payment- - duty- - exchange- example: gift_wrap- description: Defaults to 'surcharge'+ "$ref": "#/components/schemas/FeeCreateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/fees/{id}":+ patch:+ summary: Update fee+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits the label, amount or kind of a fee and re-sums the order totals. Works on completed orders.++ **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+ - name: id+ in: path+ required: true+ description: Fee prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: fee updated+ content:+ application/json:+ example:+ id: fee_UkLWZg9DAJ+ label: Handling+ kind: handlingline_item_id:- type: string- nullable: truefulfillment_id:- type: string- nullable: true- required:- - label- - amount+ amount: '8.00'+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ schema:+ "$ref": "#/components/schemas/Fee"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/FeeUpdateParams"+ required: true"/api/v3/admin/order_groups":get:summary: List order groups@@ -16749,6 +16625,139 @@ paths:required:- data- meta+ "/api/v3/admin/orders/{order_id}/discount_codes":+ post:+ summary: Apply a discount code+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Applies a discount code to a draft order and returns the order. A real code the order does not yet qualify for is kept and applies once it does. Completed orders refuse codes; change their discounts through manual discounts instead.++ **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 code applied+ content:+ application/json:+ example:+ id: or_UkLWZg9DAJ+ market_id: mkt_UkLWZg9DAJ+ withdrawal_period_ends_at:+ within_withdrawal_period: false+ cart_id:+ channel_id: ch_UkLWZg9DAJ+ company_id:+ company_name:+ po_document_filename:+ po_document_byte_size:+ number: R1001+ email: [email protected]+ customer_note:+ po_number:+ currency: USD+ locale: en+ total_quantity: 1+ coupon_code: save5+ fulfillment_status:+ payment_status:+ completed_at:+ item_total: '50.00'+ adjustment_total: "-5.00"+ discount_total: "-5.00"+ tax_total: '0.00'+ included_tax_total: '0.00'+ additional_tax_total: '0.00'+ total: '145.00'+ gift_card_total: '0.00'+ amount_due: '145.00'+ delivery_total: '100.00'+ fee_total: '0.00'+ store_credit_total: '0.00'+ covered_by_store_credit: false+ gift_card:+ market:+ id: mkt_UkLWZg9DAJ+ name: United States+ currency: USD+ default_locale: en+ tax_inclusive: false+ default: true+ country_codes:+ - US+ country_isos:+ - US+ supported_locales:+ - en+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ tax_provider:+ external_references: {}+ status: draft+ last_ip_address:+ considered_risky: false+ confirmation_delivered: false+ store_owner_notification_delivered:+ metadata: {}+ cancel_note:+ canceled_at:+ approved_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ payment_total: '0.00'+ commission_amount_total: '0.00'+ commission_tax_total: '0.00'+ commission_total: '0.00'+ preferred_stock_location_id:+ po_document_url:+ seller_id:+ order_group_id:+ tags: []+ internal_note:+ internal_note_html:+ approver_id:+ approver_type:+ canceler_id:+ canceler_type:+ created_by_id:+ created_by_type:+ cancel_reason_id:+ cancel_reason_name:+ customer_id: cust_UkLWZg9DAJ+ freight_summary:+ '422':+ description: unknown discount code+ content:+ application/json:+ example:+ error:+ code: processing_error+ message: The coupon code you entered doesn't exist. Please try again.+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DiscountCodeApplyParams"+ required: true"/api/v3/admin/orders/{order_id}/gift_cards":post:summary: Apply a gift card to an order@@ -16822,14 +16831,8 @@ paths:content:application/json:schema:- type: object- required:- - code- properties:- code:- type: string- description: Gift card code- example: GIFT-XXXX-YYYY+ "$ref": "#/components/schemas/GiftCardApplyParams"+ required: true"/api/v3/admin/orders/{order_id}/gift_cards/{id}":delete:summary: Remove a gift card from an order@@ -17040,8 +17043,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 569180- slug: product-569180+ name: Product 759180+ slug: product-759180options_text: 'Size: S'price: '10.00'total: '20.00'@@ -17056,11 +17059,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-5+ name: size-11label: Sposition: 1color_code:- option_type_name: foo-size-15+ option_type_name: foo-size-21option_type_label: Sizeimage_url:metadata: {}@@ -17148,8 +17151,8 @@ paths:preorder_ships_at:quantity: 3currency: USD- name: Product 5899- slug: product-5899+ name: Product 7799+ slug: product-7799options_text: 'Size: S'price: '19.99'total: '59.97'@@ -17164,11 +17167,11 @@ paths:option_values:- id: optval_gbHJdmfrXBoption_type_id: opt_gbHJdmfrXB- name: size-7+ name: size-13label: Sposition: 1color_code:- option_type_name: foo-size-17+ option_type_name: foo-size-23option_type_label: Sizeimage_url:metadata: {}@@ -17190,16 +17193,8 @@ paths:content:application/json:schema:- type: object- required:- - variant_id- properties:- variant_id:- type: string- description: Prefixed variant ID- quantity:- type: integer- default: 1+ "$ref": "#/components/schemas/LineItemCreateParams"+ required: true"/api/v3/admin/orders/{order_id}/items/{id}":get:summary: Show an item@@ -17278,8 +17273,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 592714- slug: product-592714+ name: Product 782714+ slug: product-782714options_text: 'Size: S'price: '10.00'total: '20.00'@@ -17294,11 +17289,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-8+ name: size-14label: Sposition: 1color_code:- option_type_name: foo-size-18+ option_type_name: foo-size-24option_type_label: Sizeimage_url:metadata: {}@@ -17381,8 +17376,8 @@ paths:preorder_ships_at:quantity: 5currency: USD- name: Product 609758- slug: product-609758+ name: Product 799758+ slug: product-799758options_text: 'Size: S'price: '19.99'total: '99.95'@@ -17397,11 +17392,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-9+ name: size-15label: Sposition: 1color_code:- option_type_name: foo-size-19+ option_type_name: foo-size-25option_type_label: Sizeimage_url:metadata: {}@@ -17423,10 +17418,8 @@ paths:content:application/json:schema:- type: object- properties:- quantity:- type: integer+ "$ref": "#/components/schemas/LineItemUpdateParams"+ required: truedelete:summary: Remove an itemtags:@@ -17621,12 +17614,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- description: Optional explicit amount; defaults to order outstanding- balance+ "$ref": "#/components/schemas/StoreCreditApplyParams"+ required: truedelete:summary: Remove store credit from an ordertags:@@ -18202,110 +18191,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- example: [email protected]- customer_id:- type: string- description: Customer ID.- 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- example: USD- 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- example: en-US- 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- example: 1- metadata:- type: object- coupon_code:- type: string- description: Optional. Applied non-fatally; invalid codes do not- block creation.+ "$ref": "#/components/schemas/OrderCreateParams"+ required: true"/api/v3/admin/orders/{id}":get:summary: Show an order@@ -18610,75 +18497,8 @@ paths: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- example: 1- metadata:- type: object+ "$ref": "#/components/schemas/OrderUpdateParams"+ required: truedelete:summary: Delete a draft ordertags:@@ -18892,11 +18712,8 @@ paths:content:application/json:schema:- type: object- properties:- notify_customer:- type: boolean- description: Send the order confirmation email after completion.+ "$ref": "#/components/schemas/OrderCompleteParams"+ required: true"/api/v3/admin/orders/{id}/cancel":patch:summary: Cancel an order@@ -19060,28 +18877,8 @@ paths:content:application/json:schema:- type: object- properties:- cancel_reason_id:- type: string- description: Why the order was canceled — the id of one of the store's- cancellation reasons.- cancel_note:- type: string- description: Staff-facing note about the cancellation.- refund_payments:- type: boolean- default: false- description: Whether this order's share of a payment shared across- a split checkout is handed back.- refund_amount:- type: string- description: How much of that share to return. Defaults to all of- it; refused on an order whose payment is not shared.- notify_customer:- type: boolean- default: false- description: Send the order cancellation email after canceling.+ "$ref": "#/components/schemas/OrderCancelParams"+ required: true"/api/v3/admin/orders/{id}/approve":patch:summary: Approve an order@@ -19656,6 +19453,368 @@ paths:required:- data- meta+ post:+ summary: Create a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Opens a return on a completed order for fulfilled units the customer is sending back.++ **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: return opened+ content:+ application/json:+ example:+ id: ret_gbHJdmfrXB+ number: RET1002+ status: requested+ order_id: or_gbHJdmfrXB+ reason_id:+ refund_total: '10.00'+ refund_tax_total: '0.00'+ approved_at:+ received_at:+ refunded_at:+ canceled_at:+ memo: Too small+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id: adm_UkLWZg9DAJ+ created_by_type: admin_user+ refunded_total: '0.00'+ refundable_total: '10.00'+ documents: []+ labels: []+ deliveries: []+ schema:+ "$ref": "#/components/schemas/Return"+ '422':+ description: more returned than was fulfilled+ content:+ application/json:+ example:+ error:+ code: processing_error+ message: Only 1 of Product 1742493 can be returned+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnCreateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/returns/{id}":+ patch:+ summary: Update a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits the warehouse, reason, memo or metadata of a return. Its status moves only through the approve, receive, refund and cancel actions.++ **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+ - name: id+ in: path+ required: true+ description: Return prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: return updated+ content:+ application/json:+ example:+ id: ret_UkLWZg9DAJ+ number: RET1001+ status: requested+ order_id: or_UkLWZg9DAJ+ reason_id: rar_UkLWZg9DAJ+ refund_total: '10.00'+ refund_tax_total: '0.00'+ approved_at:+ received_at:+ refunded_at:+ canceled_at:+ memo: Customer shipped it back with a tracking number+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ refunded_total: '0.00'+ refundable_total: '10.00'+ documents: []+ labels: []+ deliveries: []+ schema:+ "$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnUpdateParams"+ required: true+ "/api/v3/admin/orders/{order_id}/returns/{id}/receive":+ patch:+ summary: Receive a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Records what arrived on an approved return. Omit `items` to receive everything as requested and resellable; send rows for a partial or damaged receipt.++ **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+ - name: id+ in: path+ required: true+ description: Return prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: return received+ content:+ application/json:+ example:+ id: ret_UkLWZg9DAJ+ number: RET1001+ status: received+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ refund_tax_total: '0.00'+ approved_at: '2026-01-15T12:00:00Z'+ received_at: '2026-01-15T12:00:00Z'+ refunded_at:+ canceled_at:+ memo: Item did not fit+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ refunded_total: '0.00'+ refundable_total: '10.00'+ documents: []+ labels: []+ deliveries: []+ schema:+ "$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnReceiveParams"+ "/api/v3/admin/orders/{order_id}/returns/{id}/refund":+ patch:+ summary: Refund a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Pays the customer back for a received return, to store credit or through the original payment.++ **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+ - name: id+ in: path+ required: true+ description: Return prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: return refunded+ content:+ application/json:+ example:+ id: ret_UkLWZg9DAJ+ number: RET1001+ status: refunded+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ refund_tax_total: '0.00'+ approved_at: '2026-01-14T12:00:00Z'+ received_at: '2026-01-15T12:00:00Z'+ refunded_at: '2026-01-15T12:00:00Z'+ canceled_at:+ memo: Item did not fit+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ refunded_total: '10.00'+ refundable_total: '0.00'+ documents: []+ labels: []+ deliveries: []+ schema:+ "$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnRefundParams"+ "/api/v3/admin/orders/{order_id}/returns/{id}/cancel":+ patch:+ summary: Cancel a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Withdraws a return whose goods have not been received.++ **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+ - name: id+ in: path+ required: true+ description: Return prefixed ID+ schema:+ type: string+ responses:+ '200':+ description: return canceled+ content:+ application/json:+ example:+ id: ret_UkLWZg9DAJ+ number: RET1001+ status: canceled+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '10.00'+ refund_tax_total: '0.00'+ approved_at:+ received_at:+ refunded_at:+ canceled_at: '2026-01-15T12:00:00Z'+ memo: |-+ Item did not fit+ Customer changed their mind+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_id: sloc_UkLWZg9DAJ+ created_by_id:+ created_by_type:+ refunded_total: '0.00'+ refundable_total: '10.00'+ documents: []+ labels: []+ deliveries: []+ schema:+ "$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnCancelParams""/api/v3/admin/orders/{order_id}/returns/{return_id}/labels":get:summary: List return labels@@ -19922,6 +20081,72 @@ paths:in: 1previous:next:+ post:+ summary: Create a payment method+ tags:+ - Payment Methods+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Adds a payment method to the store. `type` is a shorthand from the+ payment method types endpoint, and `preferences` takes the values its+ preference schema declares (gateway credentials among them).+++ **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: payment method created+ content:+ application/json:+ example:+ id: pm_gbHJdmfrXB+ name: Bank transfer+ description: Pay by bank transfer within 14 days.+ type: check+ session_required: false+ source_required: false+ metadata: {}+ active: true+ auto_capture:+ capture_method: manual+ resolved_capture_method: manual+ storefront_visible: true+ position: 2+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ preferences: {}+ logo_url:+ docs_url:+ third_party: false+ '422':+ description: unknown payment method type+ content:+ application/json:+ example:+ error:+ code: unknown_payment_method_type+ message: Unknown type+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/PaymentMethodCreateParams"+ required: true"/api/v3/admin/payment_methods/types":get:summary: List available payment provider types@@ -20083,7 +20308,7 @@ paths:application/json:example:id: pm_UkLWZg9DAJ- name: Check 4+ name: Check 6description:type: checksession_required: false@@ -20101,6 +20326,64 @@ paths:logo_url:docs_url:third_party: false+ patch:+ summary: Update a payment method+ tags:+ - Payment Methods+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Updates a payment method. Its `type` is fixed once created.++ **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: payment method updated+ content:+ application/json:+ example:+ id: pm_UkLWZg9DAJ+ name: Cheque+ description:+ type: check+ session_required: false+ source_required: false+ metadata: {}+ active: true+ auto_capture:+ capture_method:+ resolved_capture_method: checkout+ storefront_visible: false+ position: 2+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ preferences: {}+ logo_url:+ docs_url:+ third_party: false+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/PaymentMethodUpdateParams"+ required: true"/api/v3/admin/orders/{order_id}/payments":get:summary: List payments@@ -20348,19 +20631,8 @@ paths:content:application/json:schema:- type: object- required:- - payment_method_id- properties:- payment_method_id:- type: string- description: Payment method ID- amount:- type: string- example: '99.99'- source_id:- type: string- description: Payment source ID+ "$ref": "#/components/schemas/PaymentCreateParams"+ required: true"/api/v3/admin/orders/{order_id}/payments/{id}":get:summary: Show a payment@@ -20471,7 +20743,7 @@ paths:- api_key: []bearer_auth: []description: |-- Captures a pending payment.+ Captures a pending payment, in full or for part of the authorized amount.**Required scope:** `write_payments` (for API-key authentication).x-codeSamples:@@ -20560,6 +20832,11 @@ paths:message: 'Bogus Gateway: Forced failure'schema:"$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/PaymentCaptureParams""/api/v3/admin/orders/{order_id}/payments/{id}/void":patch:summary: Void a payment@@ -20937,76 +21214,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: EU wholesale- description:- type: string- nullable: true- starts_at:- type: string- nullable: true- example: '2026-06-01T00:00:00Z'- ends_at:- type: string- nullable: true- example: '2026-09-01T00:00:00Z'- match_policy:- type: string- enum:- - all- - any- example: all- position:- type: integer- example: 1- 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- example: volume_rule- 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- example: variant_xY9- currency:- type: string- example: USD- amount:- type: string- nullable: true- example: '19.99'- compare_at_amount:- type: string- nullable: true- example: '24.99'+ "$ref": "#/components/schemas/PriceListCreateParams"+ required: true"/api/v3/admin/price_lists/{id}":parameters:- name: id@@ -21162,73 +21371,8 @@ paths: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- example: volume_rule- 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- example: price_aBc123- variant_id:- type: string- example: variant_xY9- currency:- type: string- example: USD- amount:- type: string- nullable: true- example: '12.50'- compare_at_amount:- type: string- nullable: true- example: '15.00'+ "$ref": "#/components/schemas/PriceListUpdateParams"+ required: truedelete:summary: Delete a price listtags:@@ -21662,29 +21806,8 @@ paths:content:application/json:schema:- type: object- required:- - variant_id- - currency- properties:- variant_id:- type: string- example: variant_xY9- currency:- type: string- example: USD- amount:- type: string- nullable: true- example: '19.99'- compare_at_amount:- type: string- nullable: true- example: '24.99'- price_list_id:- type: string- nullable: true- example: pl_aBc123+ "$ref": "#/components/schemas/PriceCreateParams"+ required: true"/api/v3/admin/prices/{id}":parameters:- name: id@@ -21810,14 +21933,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- nullable: true- compare_at_amount:- type: string- nullable: true+ "$ref": "#/components/schemas/PriceUpdateParams"+ required: truedelete:summary: Delete a pricetags:@@ -21947,40 +22064,8 @@ paths: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- example: price_aBc123- variant_id:- type: string- example: variant_xY9- currency:- type: string- example: USD- price_list_id:- type: string- nullable: true- example: pl_aBc123- amount:- type: string- nullable: true- example: '19.99'- compare_at_amount:- type: string- nullable: true- example: '24.99'+ "$ref": "#/components/schemas/PriceBulkUpsertParams"+ required: true"/api/v3/admin/prices/bulk_destroy":delete:summary: Bulk-delete prices@@ -22037,14 +22122,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- properties:- ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/PriceBulkDestroyParams"+ required: true"/api/v3/admin/products/{product_id}/custom_fields":get:summary: List product custom fields@@ -22235,16 +22314,8 @@ paths: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`+ "$ref": "#/components/schemas/CustomFieldCreateParams"+ required: true"/api/v3/admin/products/{product_id}/custom_fields/{id}":get:summary: Show a product custom field@@ -22387,12 +22458,8 @@ paths:content:application/json:schema:- type: object- required:- - value- properties:- value:- description: New value+ "$ref": "#/components/schemas/CustomFieldUpdateParams"+ required: truedelete:summary: Delete a product custom fieldtags:@@ -22531,7 +22598,7 @@ paths:updated_at: '2026-01-15T12:00:00.000Z'provider_type:provider_name: File- download_url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJ0Z252N2l0MG55YnkwbHhkczg5Y2hteTd6aXlvIiwiZGlzcG9zaXRpb24iOiJhdHRhY2htZW50OyBmaWxlbmFtZT1cInRoaW5raW5nLWNhdC5qcGdcIjsgZmlsZW5hbWUqPVVURi04Jyd0aGlua2luZy1jYXQuanBnIiwiY29udGVudF90eXBlIjoiaW1hZ2UvanBlZyIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl9rZXkifX0=--b47efdca6924cbe4605e0d19700f1da4ed928526/thinking-cat.jpg+ download_url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJ0Z252N2l0MG55YnkwbHhkczg5Y2hteTd6aXlvIiwiZGlzcG9zaXRpb24iOiJhdHRhY2htZW50OyBmaWxlbmFtZT1cInRoaW5raW5nLWNhdC5qcGdcIjsgZmlsZW5hbWUqPVVURi04Jyd0aGlua2luZy1jYXQuanBnIiwiY29udGVudF90eXBlIjoiaW1hZ2UvanBlZyIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl9rZXkifX0=--352235efd85b85bba5cf04e988ae24349846ed4f/thinking-cat.jpgeffective_authorized_clicks: 5effective_authorized_days: 7meta:@@ -22556,6 +22623,132 @@ paths:required:- data- meta+ post:+ summary: Create a product digital asset+ tags:+ - Products+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Attaches a downloadable file to one of the product's variants (the+ default variant when `variant_id` is omitted). Upload the file first+ through `POST /api/v3/admin/files` with `visibility: 'private'`, then+ send its `signed_id` here. A provider-backed asset sends+ `provider_type` and `provider_settings` instead of a file.+++ **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: digital asset created+ content:+ application/json:+ example:+ id: dig_gbHJdmfrXB+ variant_id: variant_UkLWZg9DAJ+ filename: manual.pdf+ content_type: image/jpeg+ authorized_clicks: 5+ authorized_days: 30+ byte_size: 18090+ provider_settings: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ provider_type:+ provider_name: File+ download_url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiJhOXR0cGNpbmxxbThvbmtlNHM1NmI2Y3gxMWVzIiwiZGlzcG9zaXRpb24iOiJhdHRhY2htZW50OyBmaWxlbmFtZT1cIm1hbnVhbC5wZGZcIjsgZmlsZW5hbWUqPVVURi04JydtYW51YWwucGRmIiwiY29udGVudF90eXBlIjoiaW1hZ2UvanBlZyIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl9rZXkifX0=--ac71db74194331b00c948b2d61f4ea5e004d7c20/manual.pdf+ effective_authorized_clicks: 5+ effective_authorized_days: 30+ schema:+ "$ref": "#/components/schemas/DigitalAsset"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DigitalAssetCreateParams"+ required: true+ "/api/v3/admin/products/{product_id}/digital_assets/{id}":+ parameters:+ - name: product_id+ in: path+ required: true+ description: Product ID+ schema:+ type: string+ - name: id+ in: path+ required: true+ description: Digital asset ID+ schema:+ type: string+ patch:+ summary: Update a product digital asset+ tags:+ - Products+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Changes an asset's download limits, or replaces its file with a new+ private `signed_id`. Links customers already received keep working and+ serve the new file.+++ **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: digital asset updated+ content:+ application/json:+ example:+ id: dig_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJ+ filename: thinking-cat.jpg+ content_type: image/jpeg+ authorized_clicks: 10+ authorized_days:+ byte_size: 18090+ provider_settings: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ provider_type:+ provider_name: File+ download_url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiIwZXp6d3IzMzE3ajRoem9kc3Awc2czN3EzMnhzIiwiZGlzcG9zaXRpb24iOiJhdHRhY2htZW50OyBmaWxlbmFtZT1cInRoaW5raW5nLWNhdC5qcGdcIjsgZmlsZW5hbWUqPVVURi04Jyd0aGlua2luZy1jYXQuanBnIiwiY29udGVudF90eXBlIjoiaW1hZ2UvanBlZyIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl9rZXkifX0=--1a9348912c04da80a0ca47276bc51bd62e61ed12/thinking-cat.jpg+ effective_authorized_clicks: 10+ effective_authorized_days: 7+ schema:+ "$ref": "#/components/schemas/DigitalAsset"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DigitalAssetUpdateParams"+ required: true"/api/v3/admin/products/{product_id}/translations":get:summary: List product translations@@ -22897,8 +23090,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 1066550- slug: product-1066550+ name: Product 1276550+ slug: product-1276550meta_title:meta_description:meta_keywords:@@ -23106,122 +23299,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Premium T-Shirt- 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- example:- - eco- - sale- 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- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: size- value:- type: string- example: Small- prices:- type: array- description: Per-currency prices. Upserted by currency.- items:- type: object- required:- - currency- - amount- properties:- currency:- type: string- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: 50- backorderable:- type: boolean- required:- - name+ "$ref": "#/components/schemas/ProductCreateParams"+ required: true"/api/v3/admin/products/{id}":get:summary: Get a product@@ -23290,8 +23369,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 1102061- slug: product-1102061+ name: Product 1312061+ slug: product-1312061meta_title:meta_description:meta_keywords:@@ -23401,7 +23480,7 @@ paths:example:id: prod_UkLWZg9DAJname: Updated Name- slug: product-1125339+ slug: product-1335339meta_title:meta_description:meta_keywords:@@ -23474,120 +23553,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Premium T-Shirt- 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- example:- - eco- - sale- 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- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: size- value:- type: string- example: Small- prices:- type: array- description: Per-currency prices. Upserted by currency.- items:- type: object- required:- - currency- - amount- properties:- currency:- type: string- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: 50- backorderable:- type: boolean+ "$ref": "#/components/schemas/ProductUpdateParams"+ required: truedelete:summary: Delete a producttags:@@ -23722,24 +23689,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - status- properties:- ids:- type: array- items:- type: string- example:- - prod_UkLWZg9DAJ- status:- type: string- enum:- - draft- - active- - archived- example: archived+ "$ref": "#/components/schemas/ProductBulkStatusParams"+ required: true"/api/v3/admin/products/bulk_add_to_categories":post:summary: Bulk-add products to categories@@ -23802,19 +23753,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - category_ids- properties:- ids:- type: array- items:- type: string- category_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkCategoriesParams"+ required: true"/api/v3/admin/products/bulk_remove_from_categories":post:summary: Bulk-remove products from categories@@ -23868,19 +23808,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - category_ids- properties:- ids:- type: array- items:- type: string- category_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkCategoriesParams"+ required: true"/api/v3/admin/products/bulk_add_to_collections":post:summary: Bulk-add products to collections@@ -23925,19 +23854,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - collection_ids- properties:- ids:- type: array- items:- type: string- collection_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkCollectionsParams"+ required: true"/api/v3/admin/products/bulk_remove_from_collections":post:summary: Bulk-remove products from collections@@ -23973,19 +23891,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - collection_ids- properties:- ids:- type: array- items:- type: string- collection_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkCollectionsParams"+ required: true"/api/v3/admin/products/bulk_add_to_channels":post:summary: Bulk-add products to channels@@ -24049,19 +23956,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - channel_ids- properties:- ids:- type: array- items:- type: string- channel_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkChannelsParams"+ required: true"/api/v3/admin/products/bulk_remove_from_channels":post:summary: Bulk-remove products from channels@@ -24125,19 +24021,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - channel_ids- properties:- ids:- type: array- items:- type: string- channel_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkChannelsParams"+ required: true"/api/v3/admin/products/bulk_add_tags":post:summary: Bulk-add tags to products@@ -24198,22 +24083,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - tags- properties:- ids:- type: array- items:- type: string- tags:- type: array- items:- type: string- example:- - summer- - sale+ "$ref": "#/components/schemas/BulkTagsParams"+ required: true"/api/v3/admin/products/bulk_remove_tags":post:summary: Bulk-remove tags from products@@ -24267,19 +24138,8 @@ paths:content:application/json:schema:- type: object- required:- - ids- - tags- properties:- ids:- type: array- items:- type: string- tags:- type: array- items:- type: string+ "$ref": "#/components/schemas/BulkTagsParams"+ required: true"/api/v3/admin/products/bulk_destroy":delete:summary: Bulk-delete products@@ -24336,14 +24196,112 @@ paths:content:application/json:schema:- type: object- required:- - ids- properties:- ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/ProductBulkDestroyParams"+ required: true+ "/api/v3/admin/products/{id}/reject":+ parameters:+ - name: id+ in: path+ required: true+ description: Product ID+ schema:+ type: string+ patch:+ summary: Reject a submitted product+ tags:+ - Products+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Turns down a product a seller submitted for review. The `reason` is+ sent back to the seller, who can fix the product and submit it again.+++ **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: product rejected+ content:+ application/json:+ example:+ id: prod_gbHJdmfrXB+ name: Product 1514387+ slug: product-1514387+ meta_title:+ meta_description:+ meta_keywords:+ variant_count: 1+ available_on:+ preorder_ships_at:+ purchasable: true+ preorder: false+ in_stock: false+ backorderable: true+ available: false+ description: Iste blanditiis quos vero ipsam reprehenderit quae. Culpa+ recusandae ut quisquam facilis enim dolorum eius. Sapiente explicabo+ animi necessitatibus perspiciatis doloribus aspernatur nobis. Labore+ similique ipsa debitis voluptate a. Nemo occaecati magnam quos voluptatibus+ amet. Facilis quis aperiam corporis corrupti enim. Voluptate dignissimos+ alias exercitationem repudiandae eligendi rerum hic. Facilis sed+ doloremque dicta porro saepe. Ipsam alias et ipsum voluptatum aperiam+ molestiae aliquam tempora. Quod ipsa quas eos hic corrupti dignissimos+ dolorum occaecati. Commodi quis animi at possimus laborum beatae.+ Aliquam vero suscipit reiciendis dolor placeat. Deleniti corporis+ tempora accusamus quae nesciunt animi. Numquam occaecati sapiente+ accusantium amet illum. Vero odio reprehenderit ipsa esse aliquid+ autem ad.+ description_html: |-+ Iste blanditiis quos vero ipsam reprehenderit quae. Culpa recusandae ut quisquam facilis enim dolorum eius. Sapiente explicabo animi necessitatibus perspiciatis doloribus aspernatur nobis. Labore similique ipsa debitis voluptate a.+ Nemo occaecati magnam quos voluptatibus amet. Facilis quis aperiam corporis corrupti enim. Voluptate dignissimos alias exercitationem repudiandae eligendi rerum hic.+ Facilis sed doloremque dicta porro saepe. Ipsam alias et ipsum voluptatum aperiam molestiae aliquam tempora. Quod ipsa quas eos hic corrupti dignissimos dolorum occaecati. Commodi quis animi at possimus laborum beatae.+ Aliquam vero suscipit reiciendis dolor placeat. Deleniti corporis tempora accusamus quae nesciunt animi. Numquam occaecati sapiente accusantium amet illum. Vero odio reprehenderit ipsa esse aliquid autem ad.+ default_variant_id: variant_gbHJdmfrXB+ buy_box_variant_id: variant_gbHJdmfrXB+ thumbnail_url:+ tags: []+ price:+ id: price_gbHJdmfrXB+ currency: USD+ amount: '19.99'+ compare_at_amount:+ price_list_id:+ min_quantity: 1+ variant_id: variant_gbHJdmfrXB+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ original_price:+ seller_id:+ external_references: {}+ status: rejected+ 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"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ProductRejectParams"+ required: true"/api/v3/admin/translations":get:summary: Translation coverage for a resource type@@ -24692,19 +24650,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Wholesale Policy- slug:- type: string- example: wholesale-policy- body:- type: string- example: "<p>Trade orders ship within five working days.</p>"- required:- - name+ "$ref": "#/components/schemas/PolicyCreateParams"+ required: true"/api/v3/admin/policies/{id}":parameters:- name: id@@ -24837,14 +24784,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- slug:- type: string- body:- type: string+ "$ref": "#/components/schemas/PolicyUpdateParams"+ required: truedelete:summary: Delete a policytags:@@ -25087,18 +25028,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Arrived damaged- active:- type: boolean- example: true- description: Inactive reasons are hidden from the pickers on new- records.+ "$ref": "#/components/schemas/ReasonCreateParams"+ required: true"/api/v3/admin/claim_reasons/{id}":parameters:- name: id@@ -25225,12 +25156,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- active:- type: boolean+ "$ref": "#/components/schemas/ReasonUpdateParams"+ required: truedelete:summary: Delete a claim reasontags:@@ -25474,18 +25401,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Out of stock- active:- type: boolean- example: true- description: Inactive reasons are hidden from the pickers on new- records.+ "$ref": "#/components/schemas/ReasonCreateParams"+ required: true"/api/v3/admin/order_cancellation_reasons/{id}":parameters:- name: id@@ -25612,12 +25529,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- active:- type: boolean+ "$ref": "#/components/schemas/ReasonUpdateParams"+ required: truedelete:summary: Delete a order cancellation reasontags:@@ -25861,18 +25774,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Goodwill gesture- active:- type: boolean- example: true- description: Inactive reasons are hidden from the pickers on new- records.+ "$ref": "#/components/schemas/ReasonCreateParams"+ required: true"/api/v3/admin/refund_reasons/{id}":parameters:- name: id@@ -25999,12 +25902,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- active:- type: boolean+ "$ref": "#/components/schemas/ReasonUpdateParams"+ required: truedelete:summary: Delete a refund reasontags:@@ -26248,18 +26147,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Damaged in transit- active:- type: boolean- example: true- description: Inactive reasons are hidden from the pickers on new- records.+ "$ref": "#/components/schemas/ReasonCreateParams"+ required: true"/api/v3/admin/return_reasons/{id}":parameters:- name: id@@ -26386,12 +26275,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- active:- type: boolean+ "$ref": "#/components/schemas/ReasonUpdateParams"+ required: truedelete:summary: Delete a return reasontags:@@ -26718,16 +26603,8 @@ paths:content:application/json:schema:- type: object- properties:- type:- type: string- example: free_shipping- preferences:- type: object- additionalProperties: true- required:- - type+ "$ref": "#/components/schemas/PromotionActionCreateParams"+ required: true"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":parameters:- name: promotion_id@@ -26740,6 +26617,56 @@ paths:required: trueschema:type: string+ patch:+ summary: Update an action on a promotion+ tags:+ - Promotions+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Changes an action's settings. For adjustment actions, `calculator`+ sets the calculator and its preferences; sending a different+ calculator `type` swaps it. The action's own `type` is fixed once+ created.+++ **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: action updated+ content:+ application/json:+ example:+ id: pact_UkLWZg9DAJ+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: create_item_adjustments+ promotion_id: promo_UkLWZg9DAJ+ preferences: {}+ calculator:+ type: percent_on_line_item+ preferences:+ percent: '15.0'+ apply_only_on_full_priced_items: false+ line_items:+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/PromotionActionUpdateParams"+ required: truedelete:summary: Delete an action from a promotiontags:@@ -26944,16 +26871,8 @@ paths:content:application/json:schema:- type: object- properties:- type:- type: string- example: currency- preferences:- type: object- additionalProperties: true- required:- - type+ "$ref": "#/components/schemas/PromotionRuleCreateParams"+ required: true"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":parameters:- name: promotion_id@@ -27024,11 +26943,8 @@ paths:content:application/json:schema:- type: object- properties:- preferences:- type: object- additionalProperties: true+ "$ref": "#/components/schemas/PromotionRuleUpdateParams"+ required: truedelete:summary: Delete a rule from a promotiontags:@@ -27334,97 +27250,8 @@ paths: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- example: currency- 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- example: free_shipping- preferences:- type: object- additionalProperties: true- calculator:- type: object- properties:- type:- type: string- example: flat_percent_item_total- preferences:- type: object- additionalProperties: true- required:- - type- required:- - name+ "$ref": "#/components/schemas/PromotionCreateParams"+ required: true"/api/v3/admin/promotions/{id}":get:summary: Show a promotion@@ -27603,95 +27430,8 @@ paths: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- example: currency- 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- example: free_shipping- preferences:- type: object- additionalProperties: true- calculator:- type: object- properties:- type:- type: string- example: flat_percent_item_total- preferences:- type: object- additionalProperties: true- required:- - type+ "$ref": "#/components/schemas/PromotionUpdateParams"+ required: truedelete:summary: Delete a promotiontags:@@ -28211,20 +27951,8 @@ paths:content:application/json:schema:- type: object- required:- - payment_id- - amount- properties:- payment_id:- type: string- description: Payment ID- amount:- type: string- example: '10.00'- refund_reason_id:- type: string- description: Refund reason ID+ "$ref": "#/components/schemas/RefundCreateParams"+ required: true"/api/v3/admin/locales":get:summary: List supported locales@@ -28953,23 +28681,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: My Store- admin_locale:- type: string- example: en- timezone:- type: string- example: UTC- weight_unit:- type: string- example: kg- unit_system:- type: string- example: metric+ "$ref": "#/components/schemas/StoreUpdateParams"+ required: true"/api/v3/admin/tags":get:summary: List tags@@ -29152,6 +28865,114 @@ paths:required:- data- meta+ post:+ summary: Create a tax category+ tags:+ - Settings+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Creates a tax category. `tax_code` is the code a tax provider uses to classify the goods in it.++ **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 category created+ content:+ application/json:+ example:+ id: taxcat_gbHJdmfrXB+ name: Food+ tax_code: PF050000+ description: Groceries and prepared food+ is_default: false+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ schema:+ "$ref": "#/components/schemas/TaxCategory"+ '422':+ description: validation failed+ content:+ application/json:+ example:+ error:+ code: validation_error+ message: Name can't be blank+ details:+ name:+ - code: blank+ message: can't be blank+ specific: false+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/TaxCategoryCreateParams"+ required: true+ "/api/v3/admin/tax_categories/{id}":+ parameters:+ - name: id+ in: path+ description: Tax category ID+ required: true+ schema:+ type: string+ patch:+ summary: Update a tax category+ 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 category updated+ content:+ application/json:+ example:+ id: taxcat_UkLWZg9DAJ+ name: Apparel+ tax_code:+ description: Illo sapiente voluptatibus dignissimos autem.+ is_default: true+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ schema:+ "$ref": "#/components/schemas/TaxCategory"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/TaxCategoryUpdateParams"+ required: true"/api/v3/admin/tax_rates":get:summary: List tax rates@@ -29379,32 +29200,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- description: Customer-facing rate name, e.g. "VAT"- rate:- type: string- description: Rate as a decimal string, e.g. "0.19"- rate_percent:- type: string- description: Rate as a percentage string, 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+ "$ref": "#/components/schemas/TaxRateParams"required: true"/api/v3/admin/tax_rates/{id}":parameters:@@ -29502,24 +29298,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- rate:- type: string- rate_percent:- type: string- included_in_price:- type: boolean- show_rate_in_label:- type: boolean- tax_category_id:- type: string- country_code:- type: string- state_code:- type: string+ "$ref": "#/components/schemas/TaxRateParams"required: truedelete:summary: Delete a tax rate@@ -29730,31 +29509,8 @@ paths: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+ "$ref": "#/components/schemas/TranslationBatchParams"+ required: true"/api/v3/admin/admin_users":get:summary: List staff@@ -30004,18 +29760,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: Ada- last_name:- type: string- example: Lovelace- role_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/AdminUserUpdateParams"+ required: truedelete:summary: Remove a staff member from this storetags:@@ -30221,17 +29967,8 @@ paths:content:application/json:schema:- type: object- required:- - role_id- properties:- email:- type: string- example: [email protected]- role_id:- type: string- example: role_xxx+ "$ref": "#/components/schemas/InvitationCreateParams"+ required: true"/api/v3/admin/invitations/{id}":delete:summary: Revoke an invitation@@ -31066,24 +30803,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: order_manager- description:- type: string- nullable: true- example: Handles daily orders- permissions:- type: array- items:- type: string- example:- - write_orders- - read_customers- required:- - name+ "$ref": "#/components/schemas/RoleCreateParams"+ required: true"/api/v3/admin/roles/{id}":parameters:- name: id@@ -31150,17 +30871,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- description:- type: string- nullable: true- permissions:- type: array- items:- type: string+ "$ref": "#/components/schemas/RoleUpdateParams"+ required: truedelete:summary: Delete a roletags:@@ -31521,82 +31233,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Brooklyn warehouse- admin_name:- type: string- nullable: true- description: Internal name shown only in the admin- active:- type: boolean- example: true- default:- type: boolean- description: Setting to true demotes the previous default.- kind:- type: string- enum:- - warehouse- - store- - fulfillment_center- description: Categorizes the location.- example: warehouse- 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+ "$ref": "#/components/schemas/StockLocationCreateParams"+ required: true"/api/v3/admin/stock_locations/{id}":parameters:- name: id@@ -31800,68 +31438,8 @@ paths: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+ "$ref": "#/components/schemas/StockLocationUpdateParams"+ required: truedelete:summary: Delete a stock locationtags:@@ -32643,7 +32221,7 @@ paths:data:- id: variant_UkLWZg9DAJproduct_id: prod_UkLWZg9DAJ- sku: SKU-234+ sku: SKU-278options_text: ''track_inventory: truemedia_count: 0@@ -32698,11 +32276,11 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1746804+ product_name: Product 2096804delivery_profile_id: fp_UkLWZg9DAJ- id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJ- sku: SKU-235+ sku: SKU-279options_text: 'Size: S'track_inventory: truemedia_count: 0@@ -32737,11 +32315,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-59+ name: size-68label: Sposition: 1color_code:- option_type_name: foo-size-69+ option_type_name: foo-size-78option_type_label: Sizeimage_url:metadata: {}@@ -32769,7 +32347,7 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1746804+ product_name: Product 2096804delivery_profile_id: fp_UkLWZg9DAJmeta:page: 1@@ -32915,7 +32493,7 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1751771+ product_name: Product 2101771delivery_profile_id: fp_UkLWZg9DAJ'422':description: validation error@@ -32927,7 +32505,7 @@ paths:message: SKU has already been takendetails:sku:- - value: SKU-239+ - value: SKU-283code: takenmessage: has already been takenspecific: false@@ -32937,90 +32515,8 @@ paths:content:application/json:schema:- type: object- properties:- sku:- type: string- example: SKU-001- cost_price:- type: string- example: '10.00'- cost_currency:- type: string- example: USD- 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- example: size- value:- type: string- example: Small- 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- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: 50- backorderable:- type: boolean+ "$ref": "#/components/schemas/VariantCreateParams"+ required: true"/api/v3/admin/products/{product_id}/variants/{id}":get:summary: Get a variant@@ -33097,7 +32593,7 @@ paths:example:id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJ- sku: SKU-241+ sku: SKU-285options_text: 'Size: S'track_inventory: truemedia_count: 0@@ -33132,11 +32628,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-62+ name: size-71label: Sposition: 1color_code:- option_type_name: foo-size-72+ option_type_name: foo-size-81option_type_label: Sizeimage_url:metadata: {}@@ -33164,7 +32660,7 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1774025+ product_name: Product 2124025delivery_profile_id: fp_UkLWZg9DAJ'404':description: variant not found@@ -33272,11 +32768,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-64+ name: size-73label: Sposition: 1color_code:- option_type_name: foo-size-74+ option_type_name: foo-size-83option_type_label: Sizeimage_url:metadata: {}@@ -33304,96 +32800,14 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1795672+ product_name: Product 2145672delivery_profile_id: fp_UkLWZg9DAJrequestBody:content:application/json:schema:- type: object- properties:- sku:- type: string- example: SKU-001- cost_price:- type: string- example: '10.00'- cost_currency:- type: string- example: USD- 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- example: size- value:- type: string- example: Small- 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- example: USD- amount:- type: string- example: '29.99'- compare_at_amount:- type: string- nullable: true- example: '39.99'- 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- example: 50- backorderable:- type: boolean+ "$ref": "#/components/schemas/VariantUpdateParams"+ required: truedelete:summary: Delete a varianttags:@@ -33613,7 +33027,7 @@ paths:data:- id: variant_UkLWZg9DAJproduct_id: prod_UkLWZg9DAJ- sku: SKU-248+ sku: SKU-292options_text: ''track_inventory: truemedia_count: 0@@ -33668,11 +33082,11 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1813647+ product_name: Product 2163647delivery_profile_id: fp_UkLWZg9DAJ- id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJ- sku: SKU-249+ sku: SKU-293options_text: 'Size: S'track_inventory: truemedia_count: 0@@ -33707,11 +33121,11 @@ paths:option_values:- id: optval_UkLWZg9DAJoption_type_id: opt_UkLWZg9DAJ- name: size-66+ name: size-75label: Sposition: 1color_code:- option_type_name: foo-size-76+ option_type_name: foo-size-85option_type_label: Sizeimage_url:metadata: {}@@ -33739,7 +33153,7 @@ paths:available_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1813647+ product_name: Product 2163647delivery_profile_id: fp_UkLWZg9DAJmeta:page: 1@@ -34372,26 +33786,8 @@ paths:content:application/json:schema:- type: object- required:- - url- properties:- name:- type: string- example: Order pipeline- url:- type: string- example: https://example.com/webhooks/orders- active:- type: boolean- example: true- subscriptions:- type: array- items:- type: string- example:- - order.placed- - order.canceled+ "$ref": "#/components/schemas/WebhookEndpointCreateParams"+ required: true"/api/v3/admin/webhook_endpoints/{id}":parameters:- name: id@@ -34569,18 +33965,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- url:- type: string- active:- type: boolean- subscriptions:- type: array- items:- type: string+ "$ref": "#/components/schemas/WebhookEndpointUpdateParams"+ required: truedelete:summary: Delete a webhook endpointtags:@@ -34855,11 +34241,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- example: Investigating elevated 5xx rate+ "$ref": "#/components/schemas/WebhookEndpointDisableParams"+ required: true"/api/v3/admin/webhook_events":get:summary: List webhook events@@ -36598,32 +35981,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: VIP Assortment- active:- type: boolean- example: true- price_list:- type: object- nullable: true- description: The price list this catalog owns, written inline. Omit- for assortment-only (base prices); send null to remove the pricing,- which deletes the list. A catalog with an empty assortment prices- without restricting visibility; import or curate products to make- it restrictive.- properties:- price_adjustment_percentage:- type: string- nullable: true- example: "-15.0"- adjust_compare_at:- type: boolean- example: false- required:- - name+ "$ref": "#/components/schemas/CatalogParams"+ required: true"/api/v3/admin/catalogs/{id}/assign":post:summary: Assign a catalog to an audience@@ -36687,20 +36046,8 @@ paths:content:application/json:schema:- type: object- properties:- assignable_type:- type: string- enum:- - customer_group- - company- example: company- assignable_id:- type: string- example: comp_86Rf07xd4z- required:- - assignable_type- - assignable_id+ "$ref": "#/components/schemas/CatalogAssignParams"+ required: true"/api/v3/admin/catalogs/{catalog_id}/products":get:summary: List catalog products@@ -36999,16 +36346,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: truedelete:summary: Remove products from a catalogtags:@@ -37047,16 +36386,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: true"/api/v3/admin/catalogs/{catalog_id}/order_minimums":get:summary: List catalog order minimums@@ -37193,17 +36524,8 @@ paths:content:application/json:schema:- type: object- properties:- currency:- type: string- example: USD- amount:- type: string- example: '500.00'- required:- - currency- - amount+ "$ref": "#/components/schemas/CatalogOrderMinimumParams"+ required: true"/api/v3/admin/catalogs/{catalog_id}/order_minimums/{id}":patch:summary: Update a catalog order minimum@@ -37252,11 +36574,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- example: '750.00'+ "$ref": "#/components/schemas/CatalogOrderMinimumParams"+ required: truedelete:summary: Delete a catalog order minimumtags:@@ -37327,23 +36646,8 @@ paths:content:application/json:schema:- type: object- properties:- terms:- type: object- additionalProperties:- type: object- properties:- minimum_order_quantity:- type: integer- nullable: true- example: 48- order_multiple:- type: integer- nullable: true- example: 24- required:- - terms+ "$ref": "#/components/schemas/CatalogProductTermsParams"+ required: true"/api/v3/admin/catalogs/{id}/activate":parameters:- name: id@@ -37688,54 +36992,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: On Sale- automatic:- type: boolean- example: true- rules_match_policy:- type: string- enum:- - all- - any- example: all- sort_order:- type: string- example: manual- 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- example: crule_abc123- type:- type: string- example: tag- value:- type: string- example: summer- match_policy:- type: string- example: contains- required:- - name+ "$ref": "#/components/schemas/CollectionCreateParams"+ required: true"/api/v3/admin/collections/{id}":get:summary: Get a collection@@ -37868,47 +37126,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Winter Sale- 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+ "$ref": "#/components/schemas/CollectionUpdateParams"+ required: truedelete:summary: Delete a collectiontags:@@ -38215,16 +37434,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: truedelete:summary: Remove products from a collectiontags:@@ -38265,16 +37476,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: true"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":patch:summary: Reposition a collection product@@ -38318,13 +37521,8 @@ paths:content:application/json:schema:- type: object- properties:- new_position:- type: integer- description: 0-based index among the collection's products- required:- - new_position+ "$ref": "#/components/schemas/ProductMembershipRepositionParams"+ required: true"/api/v3/admin/collection_rules/types":get:summary: List available collection rule types@@ -38924,109 +38122,8 @@ paths:content:application/json:schema:- type: object- required:- - name- - kind- - value- properties:- name:- type: string- example: Audio sellers- code:- type: string- example: audio- nullable: true- description: Your own identifier for this rate; unique per store.- enabled:- type: boolean- example: true- position:- type: integer- example: 1- 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- example: percentage- value:- type: string- example: '12.5'- description: A percentage (10 = 10%) or a flat amount, per `kind`.- amounts:- type: object- additionalProperties:- type: string- example:- USD: '2.50'- EUR: '2.00'- 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- example: false- 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- example: false- 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- example:- USD:- min_amount: '1.0'- max_amount: '50.0'- 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- example: '0.21'- 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- example: seller_rule- description: A kind from /commission_rates/rule_types.- preferences:- type: object- example:- seller_ids:- - sel_a1b2c3- description: Configuration for the kind, per its type's `schema`.- product_ids:- type: array- items:- type: string- description: For kinds that name products, which are kept- outside preferences.+ "$ref": "#/components/schemas/CommissionRateCreateParams"+ required: true"/api/v3/admin/commission_rates/rule_types":get:summary: List the commission rule kinds@@ -39312,39 +38409,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Standard- enabled:- type: boolean- example: true- position:- type: integer- example: 1- value:- type: string- example: '15.0'- rules:- type: array- items:- type: object- properties:- id:- type: string- type:- type: string- example: category_rule- preferences:- type: object- example:- category_ids:- - ctg_a1b2c3- product_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/CommissionRateUpdateParams"+ required: truedelete:summary: Delete a commission ratetags:@@ -39472,7 +38538,7 @@ paths:first_name:last_name:full_name: ''- address1: 9 Lovely Street+ address1: 23 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -39518,6 +38584,76 @@ paths:required:- data- meta+ post:+ summary: Create a company address+ tags:+ - Companies+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Adds an address to the business. Pass `default_billing: true` or `default_shipping: true` to make it the default of that kind.++ **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: company_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '201':+ description: address created+ content:+ application/json:+ example:+ id: addr_gbHJdmfrXB+ label: Warehouse+ first_name:+ last_name:+ full_name: ''+ address1: 350 Fifth Avenue+ address2:+ postal_code: '10118'+ city: New York+ phone: "+12125551234"+ company: Acme Wholesale+ country_name: United States+ country_code: US+ state_text: NY+ state_code: NY+ quick_checkout: false+ is_default_billing: false+ is_default_shipping: true+ state_abbr: NY+ country_iso: US+ state_name: New York+ metadata: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ latitude:+ longitude:+ customer_id:+ owner_id: comp_UkLWZg9DAJ+ owner_type: company+ schema:+ "$ref": "#/components/schemas/Address"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/CompanyAddressParams"+ required: true"/api/v3/admin/companies/{company_id}/invitations":get:summary: List company invitations@@ -39761,13 +38897,8 @@ paths:content:application/json:schema:- type: object- properties:- customer_email:- type: string- example: [email protected]- required:- - customer_email+ "$ref": "#/components/schemas/CompanyMembershipCreateParams"+ required: true"/api/v3/admin/companies/{company_id}/tax_exemption_certificates":parameters:- name: x-spree-api-key@@ -39977,38 +39108,8 @@ paths:content:application/json:schema:- type: object- properties:- certificate_number:- type: string- example: DE-RESALE-7- reason_code:- type: string- description: Becomes the tax provider's entity use code.- example: resale- country_code:- type: string- nullable: true- example: DE- state_code:- type: string- nullable: true- example: BE- expires_at:- type: string- format: date-time- nullable: true- issuing_authority:- type: string- nullable: true- example: Finanzamt Berlin- document_signed_id:- type: string- description: The `signed_id` returned by POST /api/v3/admin/files.- example: eyJfcmFpbHMiOnsiZGF0YSI6MX0=--signed- required:- - certificate_number- - reason_code+ "$ref": "#/components/schemas/TaxExemptionCertificateParams"+ required: true"/api/v3/admin/companies/{company_id}/tax_exemption_certificates/{id}/verify":parameters:- name: x-spree-api-key@@ -40398,18 +39499,8 @@ paths:content:application/json:schema:- type: object- properties:- kind:- type: string- description: The regime the number belongs to.- example: gb_vat- value:- type: string- example: GB123456789- required:- - kind- - value+ "$ref": "#/components/schemas/TaxIdentifierParams"+ required: true"/api/v3/admin/companies/{company_id}/tax_identifiers/{id}/validate":parameters:- name: x-spree-api-key@@ -40681,44 +39772,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Globex Corporation- kind:- type: string- enum:- - company- - division- description: company = legal entity (may hold tax registrations),- division = organizational unit. Roots must be company.- example: company- parent_id:- type: string- nullable: true- description: The parent node. Omit for a root.- example: comp_86Rf07xd4z- 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- example: erp- external_id:- type: string- example: GLBX-42- required:- - system- - external_id- required:- - name+ "$ref": "#/components/schemas/CompanyParams"+ required: true"/api/v3/admin/custom_field_definitions/resource_types":get:summary: List what custom fields can be attached to@@ -41264,24 +40319,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Oversized- kind:- type: string- example: shipping- description: Registered profile kind; defaults to shipping.- default:- type: boolean- stock_location_ids:- type: array- items:- type: string- description: Empty means every store location.- required:- - name+ "$ref": "#/components/schemas/DeliveryProfileParams"+ required: true"/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":parameters:- name: delivery_profile_id@@ -41452,20 +40491,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- nullable: true- example: EU warehouse- position:- type: integer- nullable: true- stock_location_ids:- type: array- items:- type: string- description: Empty means every store location.+ "$ref": "#/components/schemas/DeliveryOriginGroupParams"+ required: true"/api/v3/admin/delivery_profiles/{id}":parameters:- name: id@@ -41541,16 +40568,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- default:- type: boolean- stock_location_ids:- type: array- items:- type: string+ "$ref": "#/components/schemas/DeliveryProfileParams"+ required: truedelete:summary: Delete a delivery profiletags:@@ -41691,7 +40710,7 @@ paths:data:- id: dm_UkLWZg9DAJname: UPS Ground- code: UPS_GROUND_3+ code: UPS_GROUND_10estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -41820,57 +40839,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Express- admin_name:- type: string- nullable: true- code:- type: string- nullable: true- fulfillment_provider:- type: string- nullable: true- example: manual- delivery_profile_id:- type: string- nullable: true- example: fp_86Rf07xd4z- storefront_visible:- type: boolean- example: true- tracking_url:- type: string- nullable: true- estimated_transit_business_days_min:- type: integer- nullable: true- estimated_transit_business_days_max:- type: integer- nullable: true- tax_category_id:- type: string- nullable: true- calculator:- type: object- description: 'How the method is priced: a type from `/delivery_methods/calculators`- and its preferences, per that type''s `schema`.'- properties:- type:- type: string- example: flat_rate- preferences:- type: object- example:- amount: '12.5'- delivery_zone_id:- type: string- nullable: true- required:- - name+ "$ref": "#/components/schemas/DeliveryMethodParams"+ required: true"/api/v3/admin/delivery_methods/calculators":get:summary: List delivery calculators@@ -42235,45 +41205,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: US North-East- 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- example: US- 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+ "$ref": "#/components/schemas/DeliveryZoneParams"+ required: true"/api/v3/admin/delivery_methods/{delivery_method_id}/rules":get:summary: List delivery method rules@@ -42369,6 +41302,125 @@ paths:required:- data- meta+ post:+ summary: Create a delivery method rule+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Adds a condition to a delivery method. `type` is a rule kind from the+ delivery method rule types endpoint, and `preferences` takes the+ values its schema declares.+++ **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: delivery_method_id+ in: path+ required: true+ schema:+ type: string+ responses:+ '201':+ description: rule created+ content:+ application/json:+ example:+ id: dmrule_UkLWZg9DAJ+ active: true+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: item_total_rule+ preferences:+ minimum_amount: '50'+ maximum_amount:+ product_ids: []+ schema:+ "$ref": "#/components/schemas/DeliveryMethodRule"+ '422':+ description: unknown rule type+ content:+ application/json:+ example:+ error:+ code: validation_error+ message: is not a registered delivery method rule+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DeliveryMethodRuleCreateParams"+ required: true+ "/api/v3/admin/delivery_methods/{delivery_method_id}/rules/{id}":+ patch:+ summary: Update a delivery method rule+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Changes a rule's settings or turns it off. Its `type` is fixed once created.++ **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: delivery_method_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: rule updated+ content:+ application/json:+ example:+ id: dmrule_UkLWZg9DAJ+ active: false+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: item_total_rule+ preferences:+ minimum_amount: '40'+ maximum_amount: '500'+ product_ids: []+ schema:+ "$ref": "#/components/schemas/DeliveryMethodRule"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DeliveryMethodRuleUpdateParams"+ required: true"/api/v3/admin/integrations":get:summary: List integrations@@ -42523,22 +41575,8 @@ paths:content:application/json:schema:- type: object- properties:- type:- type: string- example: carrier- description: Wire shorthand from GET /integrations/types- active:- type: boolean- example: false- preferences:- type: object- example:- api_key: sk-secret- account_number: '42'- required:- - type+ "$ref": "#/components/schemas/IntegrationCreateParams"+ required: true"/api/v3/admin/integrations/types":get:summary: List integration types@@ -42603,6 +41641,56 @@ paths:- string- 'null'additionalProperties: false+ "/api/v3/admin/integrations/{id}":+ patch:+ summary: Update integration+ tags:+ - Integrations+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Changes an integration's credentials or turns it on or off. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.++ **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: integration updated+ content:+ application/json:+ example:+ id: int_UkLWZg9DAJ+ name: Carrier+ active: true+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: carrier+ group: shipping+ preferences:+ api_key: "•••••cret"+ account_number: demo-0001+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/IntegrationUpdateParams"+ required: true"/api/v3/admin/integrations/{id}/test":post:summary: Test integration connection@@ -42760,20 +41848,20 @@ paths:position: 1alt: Front viewmedia_type: image+ external_video_url:focal_point_x:focal_point_y:- external_video_url:video_provider:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--442343dfe070937dea6e93cdcd43a359693380b5/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f44f3ea1d1a5ff569a5f638dcc1145a780497006/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b56d7c8dd01d809c7daf6d19b80d6ae606467fae/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1b6c9cbee354d1e94401da9990867da1975ef253/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--7dab3bb82bf4e749a1e26fd97e49e2a7a5922177/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--01255a15bd06c290c3fb787ae920d7d19723cc10/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -42781,10 +41869,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a6c0fa8c4cf89e4d1fc0aa429a080d07fc3392e7/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--bb0b6973ee0447f02cdcd29af88cf330e909e39c+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7bviewable_id: prod_UkLWZg9DAJ- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: productmeta:@@ -42848,20 +41936,20 @@ paths:position: 1alt: Folded on a tablemedia_type: image+ external_video_url:focal_point_x:focal_point_y:- external_video_url:video_provider:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/library-upload.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--442343dfe070937dea6e93cdcd43a359693380b5/library-upload.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f44f3ea1d1a5ff569a5f638dcc1145a780497006/library-upload.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b56d7c8dd01d809c7daf6d19b80d6ae606467fae/library-upload.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1b6c9cbee354d1e94401da9990867da1975ef253/library-upload.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--7dab3bb82bf4e749a1e26fd97e49e2a7a5922177/library-upload.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--01255a15bd06c290c3fb787ae920d7d19723cc10/library-upload.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/library-upload.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/library-upload.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/library-upload.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/library-upload.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/library-upload.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/library-upload.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/library-upload.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -42869,10 +41957,10 @@ paths:filename: library-upload.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a6c0fa8c4cf89e4d1fc0aa429a080d07fc3392e7/library-upload.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MiwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--9df67009f2b4fc89684f00759178a9bb404511be+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/library-upload.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MiwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--60a2844bec918dd2db4179f276ca349db3eca18eviewable_id:- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/library-upload.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/library-upload.jpg?disposition=attachmentmetadata: {}viewable_type:schema:@@ -42881,24 +41969,86 @@ paths:content:application/json:schema:- type: object- properties:- signed_id:- type: string- description: The `signed_id` returned by POST /api/v3/admin/files.- alt:- type: string- example: Folded on a table- media_type:- type: string- enum:- - image- - video- - external_video- example: image+ "$ref": "#/components/schemas/MediaLibraryCreateParams"+ required: true+ "/api/v3/admin/media/{id}":+ parameters:+ - name: id+ in: path+ description: Media ID+ required: true+ schema:+ type: string+ patch:+ summary: Update a library file+ tags:+ - Media+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits a file in the library, such as its alt text.++ **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:+ '200':+ description: file updated+ content:+ application/json:+ example:+ id: media_UkLWZg9DAJ+ product_id: prod_UkLWZg9DAJ+ variant_ids: []+ position: 1+ alt: Folded on a table+ media_type: imageexternal_video_url:- type: string- description: YouTube or Vimeo link, for an external video.+ focal_point_x:+ focal_point_y:+ video_provider:+ video_embed_url:+ video_url:+ poster_url:+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpg+ external_references: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ attached: true+ filename: thinking-cat.jpg+ content_type: image/jpeg+ byte_size: 18090+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7b+ viewable_id: prod_UkLWZg9DAJ+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg?disposition=attachment+ metadata: {}+ viewable_type: product+ schema:+ "$ref": "#/components/schemas/Media"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/MediaLibraryUpdateParams"+ required: true"/api/v3/admin/media/{id}/usage":parameters:- name: id@@ -42946,7 +42096,7 @@ paths:example:data:- kind: media- name: Product 253397+ name: Product 393397owner_type: productowner_id: prod_UkLWZg9DAJfield: attachment@@ -43084,20 +42234,20 @@ paths:position: 1alt: Front viewmedia_type: image+ external_video_url:focal_point_x:focal_point_y:- external_video_url:video_provider:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--442343dfe070937dea6e93cdcd43a359693380b5/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f44f3ea1d1a5ff569a5f638dcc1145a780497006/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b56d7c8dd01d809c7daf6d19b80d6ae606467fae/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1b6c9cbee354d1e94401da9990867da1975ef253/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--7dab3bb82bf4e749a1e26fd97e49e2a7a5922177/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--01255a15bd06c290c3fb787ae920d7d19723cc10/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -43105,10 +42255,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a6c0fa8c4cf89e4d1fc0aa429a080d07fc3392e7/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--bb0b6973ee0447f02cdcd29af88cf330e909e39c+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7bviewable_id: prod_UkLWZg9DAJ- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: productmeta:@@ -43172,20 +42322,20 @@ paths:position: 1alt: Front viewmedia_type: image+ external_video_url:focal_point_x:focal_point_y:- external_video_url:video_provider:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--442343dfe070937dea6e93cdcd43a359693380b5/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f44f3ea1d1a5ff569a5f638dcc1145a780497006/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b56d7c8dd01d809c7daf6d19b80d6ae606467fae/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1b6c9cbee354d1e94401da9990867da1975ef253/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--7dab3bb82bf4e749a1e26fd97e49e2a7a5922177/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--01255a15bd06c290c3fb787ae920d7d19723cc10/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -43193,10 +42343,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a6c0fa8c4cf89e4d1fc0aa429a080d07fc3392e7/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--bb0b6973ee0447f02cdcd29af88cf330e909e39c+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7bviewable_id: prod_gbHJdmfrXB- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--75c79f2e42d5b1d5a50e62b48c3d6ec05583ea85/thinking-cat.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: productschema:@@ -43205,19 +42355,95 @@ paths:content:application/json:schema:- type: object- properties:- source_media_id:- type: string- description: A media record already in the library.- alt:- type: string- example: Front view- position:- type: integer- example: 1- required:- - source_media_id+ "$ref": "#/components/schemas/MediaCreateParams"+ required: true+ "/api/v3/admin/products/{product_id}/media/{id}":+ parameters:+ - name: product_id+ in: path+ description: Product ID+ required: true+ schema:+ type: string+ - name: id+ in: path+ description: Media ID+ required: true+ schema:+ type: string+ patch:+ summary: Update product media+ tags:+ - Media+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits a file placed on a product: its alt text, position and focal+ point, and which of the product's variants it shows for+ (`variant_ids`).+++ **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: media updated+ content:+ application/json:+ example:+ id: media_UkLWZg9DAJ+ product_id: prod_UkLWZg9DAJ+ variant_ids: []+ position: 1+ alt: Side view+ media_type: image+ external_video_url:+ focal_point_x:+ focal_point_y:+ video_provider:+ video_embed_url:+ video_url:+ poster_url:+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpg+ external_references: {}+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ attached: true+ filename: thinking-cat.jpg+ content_type: image/jpeg+ byte_size: 18090+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7b+ viewable_id: prod_UkLWZg9DAJ+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoiYmxvYl9pZCJ9fQ==--8b02ae3650d28a4664b74443f8eb556729cc79d3/thinking-cat.jpg?disposition=attachment+ metadata: {}+ viewable_type: product+ schema:+ "$ref": "#/components/schemas/Media"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/MediaUpdateParams"+ required: true"/api/v3/admin/products/{product_id}/variants/{variant_id}/media":parameters:- name: product_id@@ -43334,20 +42560,20 @@ paths:position: 1alt: Variant viewmedia_type: image+ external_video_url:focal_point_x:focal_point_y:- external_video_url:video_provider:video_embed_url:video_url:poster_url:- original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/thinking-cat.jpg- mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--442343dfe070937dea6e93cdcd43a359693380b5/thinking-cat.jpg- small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--f44f3ea1d1a5ff569a5f638dcc1145a780497006/thinking-cat.jpg- medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--b56d7c8dd01d809c7daf6d19b80d6ae606467fae/thinking-cat.jpg- large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1b6c9cbee354d1e94401da9990867da1975ef253/thinking-cat.jpg- xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--7dab3bb82bf4e749a1e26fd97e49e2a7a5922177/thinking-cat.jpg- og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--01255a15bd06c290c3fb787ae920d7d19723cc10/thinking-cat.jpg+ original_url: http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/thinking-cat.jpg+ mini_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjgsMTI4XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--7208d85f278353397a92d820f2cf61d71d5972f3/thinking-cat.jpg+ small_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyNTYsMjU2XSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--271b2d465670478ffad5cab27899cafbcd46ceda/thinking-cat.jpg+ medium_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls0MDAsNDAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--994565d0531a971be082f31a14a5d3ac04588c4f/thinking-cat.jpg+ large_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOls3MjAsNzIwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--1bbd4771d368fec57250558de7a1b0d14bf941ca/thinking-cat.jpg+ xlarge_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsyMDAwLDIwMDBdLCJzYXZlciI6eyJzdHJpcCI6dHJ1ZSwicXVhbGl0eSI6NzUsImxvc3NsZXNzIjpmYWxzZSwiYWxwaGFfcSI6ODUsInJlZHVjdGlvbl9lZmZvcnQiOjYsInNtYXJ0X3N1YnNhbXBsZSI6dHJ1ZX19LCJwdXIiOiJ2YXJpYXRpb24ifX0=--756b94f1ee98632f7657cfa4d0dee2abbead66cf/thinking-cat.jpg+ og_image_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2ZpbGwiOlsxMjAwLDYzMF0sInNhdmVyIjp7InN0cmlwIjp0cnVlLCJxdWFsaXR5Ijo3NSwibG9zc2xlc3MiOmZhbHNlLCJhbHBoYV9xIjo4NSwicmVkdWN0aW9uX2VmZm9ydCI6Niwic21hcnRfc3Vic2FtcGxlIjp0cnVlfX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--885dff96200fae6dc56a71f34f38e5313b191a2a/thinking-cat.jpgexternal_references: {}created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'@@ -43355,10 +42581,10 @@ paths:filename: thinking-cat.jpgcontent_type: image/jpegbyte_size: 18090- embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a6c0fa8c4cf89e4d1fc0aa429a080d07fc3392e7/thinking-cat.jpg- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MiwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--9df67009f2b4fc89684f00759178a9bb404511be+ embed_url: http://localhost:3000/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbMTIwMCwxMjAwXSwic2F2ZXIiOnsic3RyaXAiOnRydWUsInF1YWxpdHkiOjc1LCJsb3NzbGVzcyI6ZmFsc2UsImFscGhhX3EiOjg1LCJyZWR1Y3Rpb25fZWZmb3J0Ijo2LCJzbWFydF9zdWJzYW1wbGUiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--97c6ebfac8774fd76b1984f84e8ee489782743b7/thinking-cat.jpg+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MiwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--60a2844bec918dd2db4179f276ca349db3eca18eviewable_id: variant_gbHJdmfrXB- download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--b8a5821c31708931dc058b1d7c96177aaef86b0c/thinking-cat.jpg?disposition=attachment+ download_url: http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MiwicHVyIjoiYmxvYl9pZCJ9fQ==--c9fc0b8739b46fc7f9aaa1c66513b4fabfcef57a/thinking-cat.jpg?disposition=attachmentmetadata: {}viewable_type: variantmeta:@@ -43598,23 +42824,7 @@ paths:content:application/json:schema:- type: object- required:- - tracking_number- properties:- tracking_number:- type: string- description: Carrier tracking number, freight PRO number, or a full- tracking link- carrier:- type: string- description: Free-text carrier; detected from the number when omitted- service:- type: string- description: Carrier service- tracking_url:- type: string- description: Tracking page for this consignment+ "$ref": "#/components/schemas/DeliveryCreateParams"required: true"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}":patch:@@ -43681,16 +42891,7 @@ paths:content:application/json:schema:- type: object- properties:- tracking_number:- type: string- carrier:- type: string- service:- type: string- tracking_url:- type: string+ "$ref": "#/components/schemas/DeliveryUpdateParams"required: truedelete:summary: Delete a delivery@@ -43823,16 +43024,8 @@ paths:content:application/json:schema:- type: object- properties:- delivered_at:- type: string- format: date-time- description: When it arrived. Defaults to now.- notify_customer:- type: boolean- description: Whether the customer gets a delivery notification when- the parcel completes.+ "$ref": "#/components/schemas/DeliveryMarkDeliveredParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels":get:summary: List shipping labels@@ -44056,37 +43249,8 @@ paths:content:application/json:schema:- type: object- properties:- file:- type: string- description: Signed blob id of an uploaded label file; its presence- records rather than buys- tracking_number:- type: string- description: Number printed on an uploaded label- carrier:- type: string- description: Free-text carrier; detected from the number when omitted- service:- type: string- description: Carrier service the label was bought at- cost:- type: string- description: What the merchant paid the carrier- currency:- type: string- description: Currency of the cost- file_format:- type: string- enum:- - png- - zpl- description: Label file format; taken from the file when omitted- tracking_url:- type: string- description: Tracking page for the consignment+ "$ref": "#/components/schemas/ShippingLabelCreateParams"+ required: true"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels/{id}":get:summary: Get a shipping label@@ -44574,57 +43738,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Euro pallet- kind:- type: string- enum:- - box- - envelope- - carton- - pallet- - container- example: pallet- length:- type: number- example: 120- width:- type: number- example: 80- height:- type: number- example: 15- dimensions_unit:- type: string- enum:- - mm- - cm- - in- - ft- example: cm- weight:- type: number- example: 25- max_weight:- type: number- example: 1500- weight_unit:- type: string- enum:- - g- - kg- - lb- - oz- example: kg- default:- type: boolean- example: false- required:- - name- - kind+ "$ref": "#/components/schemas/PackageTypeCreateParams"+ required: true"/api/v3/admin/package_types/{id}":parameters:- name: id@@ -44775,54 +43890,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Euro pallet- kind:- type: string- enum:- - box- - envelope- - carton- - pallet- - container- example: pallet- length:- type: number- example: 120- width:- type: number- example: 80- height:- type: number- example: 15- dimensions_unit:- type: string- enum:- - mm- - cm- - in- - ft- example: cm- weight:- type: number- example: 25- max_weight:- type: number- example: 1500- weight_unit:- type: string- enum:- - g- - kg- - lb- - oz- example: kg- default:- type: boolean- example: false+ "$ref": "#/components/schemas/PackageTypeUpdateParams"+ required: truedelete:summary: Delete a package typetags:@@ -45088,12 +44157,12 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 873365+ name: Product 1063365thumbnail_url:price_list_variants:- id: variant_UkLWZg9DAJlabel:- sku: SKU-98+ sku: SKU-123currency: USDsource: basebreak_count: 1@@ -45161,16 +44230,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: truedelete:summary: Remove products from a price listtags:@@ -45209,16 +44270,8 @@ paths:content:application/json:schema:- type: object- properties:- product_ids:- type: array- items:- type: string- example:- - prod_abc123- required:- - product_ids+ "$ref": "#/components/schemas/ProductMembershipParams"+ required: true"/api/v3/admin/product_types":get:summary: List product types@@ -45420,42 +44473,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Hoodie- delivery_profile_id:- type: string- nullable: true- example: fp_86Rf07xd4z- description: Fulfillment profile stamped onto products created with- this type. Null leaves new products on the store default profile.- option_type_ids:- type: array- 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+ "$ref": "#/components/schemas/ProductTypeCreateParams"+ required: true"/api/v3/admin/product_types/{id}":parameters:- name: id@@ -45562,33 +44581,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Premium T-Shirt- 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+ "$ref": "#/components/schemas/ProductTypeUpdateParams"+ required: truedelete:summary: Delete a product typetags:@@ -45992,53 +44986,7 @@ paths:content:application/json:schema:- type: object- properties:- supplier_id:- type: string- example: sup_1234567890- destination_location_id:- type: string- example: sloc_1234567890- currency:- type: string- nullable: true- example: USD- expected_at:- type: string- format: date- nullable: true- example: '2026-10-01'- reference:- type: string- nullable: true- description: The supplier's own order number- notes:- type: string- nullable: true- items:- type: array- items:- type: object- properties:- variant_id:- type: string- example: variant_1234567890- quantity_ordered:- type: integer- example: 100- unit_cost:- type: string- example: '12.50'- required:- - variant_id- - quantity_ordered- metadata:- type: object- nullable: true- required:- - supplier_id- - destination_location_id+ "$ref": "#/components/schemas/PurchaseOrderCreateParams"required: true"/api/v3/admin/purchase_orders/{id}":parameters:@@ -46119,8 +45067,8 @@ paths:purchase_order_id: po_UkLWZg9DAJvariant_id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJ- variant_name: Product 1359018- variant_sku: SKU-162+ variant_name: Product 1589018+ variant_sku: SKU-191options_text: 'Size: S'thumbnail_url:supplier:@@ -46155,6 +45103,70 @@ paths:message: Purchase order not foundschema:"$ref": "#/components/schemas/ErrorResponse"+ patch:+ summary: Update a purchase order+ tags:+ - Purchase Orders+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits a draft: its supplier, destination, dates, reference, notes and+ lines. Sending `items` replaces every line the order holds. Status+ moves through the order's own actions, never through this endpoint.+++ **Required scope:** `write_purchasing` (for API-key authentication).+ parameters:+ - name: x-spree-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: purchase order updated+ content:+ application/json:+ example:+ id: po_UkLWZg9DAJ+ number: PO1001+ status: draft+ currency: USD+ reference: ACME-4471+ notes:+ metadata: {}+ close_reason:+ items_count: 1+ quantity_received_total: 0+ quantity_rejected_total: 0+ ordered_at:+ received_at:+ closed_short_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ expected_at: '2026-10-15'+ cancel_by:+ closed_short: false+ quantity_ordered_total: 120+ editable: true+ subtotal: '1410.00'+ supplier_id: sup_UkLWZg9DAJ+ destination_location_id: sloc_UkLWZg9DAJ+ schema:+ "$ref": "#/components/schemas/PurchaseOrder"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/PurchaseOrderUpdateParams"+ required: true"/api/v3/admin/purchase_orders/{id}/mark_ordered":parameters:- name: id@@ -46450,44 +45462,8 @@ paths:content:application/json:schema:- type: object- properties:- reference:- type: string- nullable: true- example: DN-4471- description: The supplier's delivery note or packing slip- received_at:- type: string- format: date-time- nullable: true- description: Defaults to now- notes:- type: string- nullable: true- items:- type: array- items:- type: object- properties:- id:- type: string- example: poi_1234567890- quantity_accepted:- type: integer- example: 58- quantity_rejected:- type: integer- example: 2- rejection_reason:- type: string- nullable: true- example: damaged- notes:- type: string- nullable: true- required:- - id+ "$ref": "#/components/schemas/StockReceiptCreateParams"+ required: true"/api/v3/admin/purchase_orders/{id}/mark_draft":parameters:- name: id@@ -46657,12 +45633,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- nullable: true- example: Supplier out of stock+ "$ref": "#/components/schemas/ReceivableCloseParams"+ required: true"/api/v3/admin/purchase_orders/{id}/cancel":parameters:- name: id@@ -46735,11 +45707,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- example: Supplier went under+ "$ref": "#/components/schemas/PurchaseOrderCancelParams"+ required: true"/api/v3/admin/reporting/saved_reports":get:summary: List saved reports@@ -46845,6 +45814,271 @@ paths:required:- data- meta+ post:+ summary: Create a saved report+ tags:+ - Reports+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Saves a reporting query under a name so staff can run it again. The query is validated against the reporting registry.++ **Required scope:** `write_reports` (for API-key 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: saved report created+ content:+ application/json:+ example:+ id: sq_gbHJdmfrXB+ name: Orders by channel+ description: Weekly review+ query:+ metrics:+ - total_sales+ - orders+ dimensions:+ - channel+ seeded: false+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ user_id: adm_UkLWZg9DAJ+ author_name: Renae Rath+ schema:+ "$ref": "#/components/schemas/SavedReport"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SavedReportCreateParams"+ required: true+ "/api/v3/admin/reporting/saved_reports/{id}":+ parameters:+ - name: id+ in: path+ description: Saved report ID+ required: true+ schema:+ type: string+ patch:+ summary: Update a saved report+ tags:+ - Reports+ security:+ - api_key: []+ bearer_auth: []+ description: "**Required scope:** `write_reports` (for API-key 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: saved report updated+ content:+ application/json:+ example:+ id: sq_UkLWZg9DAJ+ name: Sales by channel (monthly)+ description: For the board pack+ query:+ metrics:+ - total_sales+ - orders+ dimensions:+ - channel+ seeded: false+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ user_id:+ author_name:+ schema:+ "$ref": "#/components/schemas/SavedReport"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SavedReportUpdateParams"+ required: true+ "/api/v3/admin/reporting/query":+ post:+ summary: Run a reporting query+ tags:+ - Reports+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Runs a query against the store's registered metrics and dimensions, in+ the store's time zone. A metric or dimension the registry does not know+ is refused with the names that are valid, and an API key needs the read+ scope of every resource the query touches.+++ **Required scope:** `read_reports` (for API-key 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: query results+ content:+ application/json:+ example:+ meta:+ currency: USD+ time_range:+ since: '2026-01-08T00:00:00Z'+ until: '2026-01-15T23:59:59Z'+ previous_time_range:+ since: '2025-12-31T00:00:00Z'+ until: '2026-01-07T23:59:59Z'+ metrics:+ - total_sales+ - orders+ dimensions:+ - name: completed_at+ grain: day+ totals:+ total_sales:+ value: '110.00'+ previous: '0.00'+ growth:+ display: "$110.00"+ orders:+ value: 1+ previous: 0+ growth:+ rows:+ - dimensions:+ completed_at: '2026-01-08'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-09'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-10'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-11'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-12'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-13'+ metrics:+ total_sales:+ value: '110.00'+ previous: '0.00'+ growth:+ display: "$110.00"+ orders:+ value: 1+ previous: 0+ growth:+ - dimensions:+ completed_at: '2026-01-14'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ - dimensions:+ completed_at: '2026-01-15'+ metrics:+ total_sales:+ value: '0.00'+ previous: '0.00'+ growth: '0'+ display: "$0.00"+ orders:+ value: 0+ previous: 0+ growth: '0'+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReportingQueryParams"+ required: true"/api/v3/admin/seller_requirements":get:summary: List seller requirements@@ -47081,41 +46315,8 @@ paths:content:application/json:schema:- type: object- required:- - type- properties:- type:- type: string- example: document- description: The kind, from `GET /seller_requirements/types`.- name:- type: string- example: Business registration- 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- example: A copy of your certificate of incorporation.- description: Instructions shown to the seller.- required:- type: boolean- example: true- description: Whether this blocks approval. Off means recommended.- active:- type: boolean- example: true- position:- type: integer- example: 1- description: Place in the checklist.- preferences:- type: object- example:- accepted_content_types:- - application/pdf- description: Configuration for this kind, per its type's `schema`.+ "$ref": "#/components/schemas/SellerRequirementCreateParams"+ required: true"/api/v3/admin/seller_requirements/types":get:summary: List seller requirement kinds@@ -47512,27 +46713,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Proof of business registration- description:- type: string- example: A copy of your certificate of incorporation.- required:- type: boolean- example: false- active:- type: boolean- example: true- position:- type: integer- example: 2- preferences:- type: object- example:- minimum_count: 3+ "$ref": "#/components/schemas/SellerRequirementUpdateParams"+ required: truedelete:summary: Delete a seller requirementtags:@@ -47860,48 +47042,8 @@ paths:content:application/json:schema:- type: object- required:- - name- properties:- name:- type: string- example: Northwind Books- slug:- type: string- example: northwind-books- description: Derived from the name when omitted.- contact_email:- type: string- example: [email protected]- nullable: true- billing_email:- type: string- example: [email protected]- nullable: true- about:- type: string- example: "<p>Independent bookshop.</p>"- nullable: true- tax_remittance:- type: string- enum:- - seller- - platform- example: seller- payouts_schedule_interval:- type: string- enum:- - daily- - weekly- - biweekly- - monthly- - manual- nullable: true- minimum_payout_amount:- type: string- example: '25.0'- nullable: true+ "$ref": "#/components/schemas/SellerCreateParams"+ required: true"/api/v3/admin/sellers/{id}":parameters:- name: id@@ -48128,128 +47270,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Sparks Audio Ltd- billing_email:- type: string- example: [email protected]- nullable: true- payouts_schedule_interval:- type: string- enum:- - daily- - weekly- - biweekly- - monthly- - manual- nullable: true- minimum_payout_amount:- type: string- example: '25.0'- nullable: true- holiday_mode_until:- type: string- format: date-time- nullable: true- logo_signed_id:- type: string- nullable: true- description: The `signed_id` returned by POST /api/v3/admin/files.- Send `null` to remove the image, or omit the key to leave it alone.- Same for `square_logo_signed_id` and `cover_photo_signed_id`.- square_logo_signed_id:- type: string- nullable: true- cover_photo_signed_id:- 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- example: Ada- last_name:- type: string- example: Lovelace- company:- type: string- example: Sparks Audio Ltd- address1:- type: string- example: 1 Seller Way- address2:- type: string- example: Unit 4- city:- type: string- example: London- postal_code:- type: string- example: EC1A 1BB- phone:- type: string- example: "+44 20 7946 0000"- country_code:- type: string- example: GB- state_code:- type: string- example: NY- state_name:- type: string- example: New York- label:- type: string- example: Head office- 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- example: Ada- last_name:- type: string- example: Lovelace- company:- type: string- example: Sparks Audio Ltd- address1:- type: string- example: 1 Seller Way- address2:- type: string- example: Unit 4- city:- type: string- example: London- postal_code:- type: string- example: EC1A 1BB- phone:- type: string- example: "+44 20 7946 0000"- country_code:- type: string- example: GB- state_code:- type: string- example: NY- state_name:- type: string- example: New York- label:- type: string- example: Head office+ "$ref": "#/components/schemas/SellerUpdateParams"+ required: truedelete:summary: Delete a sellertags:@@ -48393,17 +47415,8 @@ paths:content:application/json:schema:- type: object- required:- properties:- email:- type: string- example: [email protected]- role_id:- type: string- example: role_UkLWZg9DAJ- nullable: true+ "$ref": "#/components/schemas/SellerInviteParams"+ required: true"/api/v3/admin/sellers/{id}/approve":parameters:- name: id@@ -48502,6 +47515,89 @@ paths:message: Already approvedschema:"$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SellerApproveParams"+ required: true+ "/api/v3/admin/sellers/{id}/reopen_onboarding":+ parameters:+ - name: id+ in: path+ required: true+ description: Seller prefixed ID+ schema:+ type: string+ patch:+ summary: Send a seller back to onboarding+ tags:+ - Sellers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Returns a seller waiting for review to onboarding, with a `note`+ saying what they have to fix. Unlike `reject`, this expects them back.+++ **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: onboarding reopened+ content:+ application/json:+ example:+ id: sel_UkLWZg9DAJ+ name: Sparks Audio+ slug: sparks-audio+ about: ''+ about_html: ''+ logo_url:+ square_logo_url:+ cover_photo_url:+ status: onboarding+ contact_email: [email protected]+ billing_email:+ tax_remittance: seller+ payouts_schedule_interval:+ metadata:+ onboarding_reopened_note: Returns address is a PO box+ holiday_mode_until:+ terms_accepted_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ deleted_at:+ minimum_payout_amount:+ on_holiday: false+ sellable: false+ products_count: 0+ users_count: 0+ onboarding_progress:+ done: 0+ total: 0+ onboarding_complete: true+ legal_name:+ registration_number:+ schema:+ "$ref": "#/components/schemas/Seller"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SellerReopenOnboardingParams"+ required: true"/api/v3/admin/sellers/{id}/suspend":parameters:- name: id@@ -48598,11 +47694,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- example: Counterfeit goods+ "$ref": "#/components/schemas/SellerSuspendParams"+ required: true"/api/v3/admin/sellers/{id}/reject":parameters:- name: id@@ -48697,11 +47790,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- example: Incomplete paperwork+ "$ref": "#/components/schemas/SellerRejectParams"+ required: true"/api/v3/admin/sellers/{seller_id}/balances":parameters:- name: seller_id@@ -48986,6 +48076,187 @@ paths:required:- data- meta+ post:+ summary: Waive a requirement for a seller+ tags:+ - Sellers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Excuses this one seller from a requirement the marketplace asks of+ everyone, recorded as a `waived` submission. The operator never+ submits on the seller's behalf: this endpoint only waives.+++ **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: requirement waived+ content:+ application/json:+ example:+ id: selsub_UkLWZg9DAJ+ status: waived+ note:+ review_note: Verified offline+ reference:+ metadata: {}+ reviewed_at: '2026-01-15T12:00:00.000Z'+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ seller_id: sel_UkLWZg9DAJ+ requirement_id: selreq_UkLWZg9DAJ+ requirement_name: VAT number check+ file_url:+ file_name:+ schema:+ "$ref": "#/components/schemas/SellerRequirementSubmission"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SellerRequirementWaiveParams"+ required: true+ "/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/accept":+ parameters:+ - name: seller_id+ in: path+ required: true+ description: Seller prefixed ID+ schema:+ type: string+ - name: id+ in: path+ required: true+ description: Requirement submission ID+ schema:+ type: string+ patch:+ summary: Accept a seller's submission+ tags:+ - Sellers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Marks what the seller submitted as meeting the requirement.++ **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: submission accepted+ content:+ application/json:+ example:+ id: selsub_UkLWZg9DAJ+ status: accepted+ note:+ review_note: VAT number verified+ reference:+ metadata: {}+ reviewed_at: '2026-01-15T12:00:00.000Z'+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ seller_id: sel_UkLWZg9DAJ+ requirement_id: selreq_UkLWZg9DAJ+ requirement_name: VAT number check+ file_url:+ file_name:+ schema:+ "$ref": "#/components/schemas/SellerRequirementSubmission"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SellerRequirementReviewParams"+ "/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/reject":+ parameters:+ - name: seller_id+ in: path+ required: true+ description: Seller prefixed ID+ schema:+ type: string+ - name: id+ in: path+ required: true+ description: Requirement submission ID+ schema:+ type: string+ patch:+ summary: Reject a seller's submission+ tags:+ - Sellers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Turns down what the seller submitted. `review_note` is the reason sent+ back to the seller, who can then submit again.+++ **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: submission rejected+ content:+ application/json:+ example:+ id: selsub_UkLWZg9DAJ+ status: rejected+ note:+ review_note: The VAT number does not match the company name+ reference:+ metadata: {}+ reviewed_at: '2026-01-15T12:00:00.000Z'+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ seller_id: sel_UkLWZg9DAJ+ requirement_id: selreq_UkLWZg9DAJ+ requirement_name: VAT number check+ file_url:+ file_name:+ schema:+ "$ref": "#/components/schemas/SellerRequirementSubmission"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/SellerRequirementReviewParams""/api/v3/admin/seller_transfers":get:summary: List seller transfers@@ -49358,13 +48629,8 @@ paths:content:application/json:schema:- type: object- properties:- reference:- type: string- description: The provider's own id for the settlement, when one- made it- example: TRF-8842+ "$ref": "#/components/schemas/SellerPayoutCompleteParams"+ required: true"/api/v3/admin/stock_levels":get:summary: List stock levels@@ -49520,8 +48786,8 @@ paths:reserved_count: 0incoming_count: 0purchasable_count: 0- variant_name: Product 1505410- variant_sku: SKU-186+ variant_name: Product 1835410+ variant_sku: SKU-226created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'stock_location_name: Jong Schamberger@@ -49540,8 +48806,8 @@ paths:reserved_count: 0incoming_count: 0purchasable_count: 0- variant_name: Product 1505410- variant_sku: SKU-187+ variant_name: Product 1835410+ variant_sku: SKU-227created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'stock_location_name: Jong Schamberger@@ -49560,8 +48826,8 @@ paths:reserved_count: 2incoming_count: 20purchasable_count: 35- variant_name: Product 1505410- variant_sku: SKU-187+ variant_name: Product 1835410+ variant_sku: SKU-227created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'stock_location_name: Pilar Stokes@@ -49675,35 +48941,74 @@ paths: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- example: variant_xY9- stock_location_id:- type: string- example: sloc_aBc- count_on_hand:- type: integer- nullable: true- example: 42- adjustment:- type: integer- nullable: true- example: -3- backorderable:- type: boolean- nullable: true+ "$ref": "#/components/schemas/StockLevelBulkUpsertParams"+ required: true+ "/api/v3/admin/stock_levels/{id}":+ patch:+ summary: Update a stock level+ tags:+ - Stock+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Corrects one shelf. Send `count_on_hand` for the count the shelf should+ end at, or `adjustment` for a signed change; either is recorded as a+ stock movement labelled with `reason`.+++ **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+ - name: id+ in: path+ required: true+ description: Stock level ID+ schema:+ type: string+ responses:+ '200':+ description: stock level updated+ content:+ application/json:+ example:+ id: sl_EfhxLZ9ck8+ count_on_hand: 25+ backorderable: false+ stock_location_id: sloc_gbHJdmfrXB+ variant_id: variant_gbHJdmfrXB+ external_references: {}+ metadata: {}+ reserved_count: 0+ incoming_count: 0+ purchasable_count: 25+ variant_name: Product 1869378+ variant_sku: SKU-233+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ stock_location_name: Gilbert Marquardt+ product_id: prod_UkLWZg9DAJ+ options_text: 'Size: S'+ thumbnail_url:+ allocated_count: 0+ available_count: 25+ schema:+ "$ref": "#/components/schemas/StockLevel"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/StockLevelUpdateParams"+ required: true"/api/v3/admin/stock_movements":get:summary: List stock movements@@ -49865,8 +49170,8 @@ paths:stock_location_id: sloc_UkLWZg9DAJstock_location_name: Mona Hegmannvariant_id: variant_gbHJdmfrXB- variant_name: Product 1538513- variant_sku: SKU-192+ variant_name: Product 1878513+ variant_sku: SKU-234order_id:fulfillment_id:return_id:@@ -49980,8 +49285,8 @@ paths:stock_location_id: sloc_UkLWZg9DAJstock_location_name: Chrystal Sauervariant_id: variant_gbHJdmfrXB- variant_name: Product 1552954- variant_sku: SKU-196+ variant_name: Product 1892954+ variant_sku: SKU-238order_id:fulfillment_id:return_id:@@ -50443,41 +49748,7 @@ paths:content:application/json:schema:- type: object- properties:- source_location_id:- type: string- example: sloc_1234567890- destination_location_id:- type: string- example: sloc_0987654321- reference:- type: string- nullable: true- description: The merchant's own label for the trip- notes:- type: string- nullable: true- items:- type: array- items:- type: object- properties:- variant_id:- type: string- example: variant_1234567890- quantity_shipped:- type: integer- example: 10- required:- - variant_id- - quantity_shipped- metadata:- type: object- nullable: true- required:- - source_location_id- - destination_location_id+ "$ref": "#/components/schemas/StockTransferCreateParams"required: true"/api/v3/admin/stock_transfers/{id}":parameters:@@ -50553,8 +49824,8 @@ paths:stock_transfer_id: st_UkLWZg9DAJvariant_id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJ- variant_name: Product 1622176- variant_sku: SKU-209+ variant_name: Product 1962176+ variant_sku: SKU-251options_text: 'Size: S'thumbnail_url:source_location:@@ -50629,6 +49900,67 @@ paths:message: Stock transfer not foundschema:"$ref": "#/components/schemas/ErrorResponse"+ patch:+ summary: Update a stock transfer+ tags:+ - Stock Transfers+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Edits a draft: its reference, notes, either end, and its lines.+ Sending `items` replaces every line the draft holds. Status moves+ through the transfer's own actions, never through this endpoint.+++ **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 transfer updated+ content:+ application/json:+ example:+ id: st_UkLWZg9DAJ+ number: T1001+ reference: Weekend restock+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ source_location_id: sloc_UkLWZg9DAJ+ destination_location_id: sloc_gbHJdmfrXB+ status: draft+ notes: Two cartons, fragile+ metadata: {}+ close_reason:+ items_count: 1+ quantity_received_total: 0+ quantity_rejected_total: 0+ shipped_at:+ received_at:+ closed_short_at:+ deleted_at:+ closed_short: false+ quantity_shipped_total: 12+ editable: true+ schema:+ "$ref": "#/components/schemas/StockTransfer"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/StockTransferUpdateParams"+ required: truedelete:summary: Delete a stock transfertags:@@ -50806,11 +50138,8 @@ paths:content:application/json:schema:- type: object- properties:- force:- type: boolean- description: Ship even if it drives the source below zero+ "$ref": "#/components/schemas/StockTransferMarkInTransitParams"+ required: true"/api/v3/admin/stock_transfers/{stock_transfer_id}/stock_receipts":parameters:- name: stock_transfer_id@@ -51037,43 +50366,8 @@ paths:content:application/json:schema:- type: object- properties:- reference:- type: string- nullable: true- example: Van 3, morning run- received_at:- type: string- format: date-time- nullable: true- description: Defaults to now- notes:- type: string- nullable: true- items:- type: array- items:- type: object- properties:- id:- type: string- example: sti_1234567890- quantity_accepted:- type: integer- example: 8- quantity_rejected:- type: integer- example: 2- rejection_reason:- type: string- nullable: true- example: damaged- notes:- type: string- nullable: true- required:- - id+ "$ref": "#/components/schemas/StockReceiptCreateParams"+ required: true"/api/v3/admin/stock_transfers/{id}/mark_draft":parameters:- name: id@@ -51237,12 +50531,8 @@ paths:content:application/json:schema:- type: object- properties:- reason:- type: string- nullable: true- example: Two fell off the van+ "$ref": "#/components/schemas/ReceivableCloseParams"+ required: true"/api/v3/admin/stock_transfers/{id}/cancel":parameters:- name: id@@ -51327,18 +50617,8 @@ paths:content:application/json:schema:- type: object- properties:- on_in_transit:- type: string- enum:- - restock- - write_off- description: Required once the units have left the source- reason:- type: string- nullable: true- description: Recorded against the written-off lines+ "$ref": "#/components/schemas/StockTransferCancelParams"+ required: true"/api/v3/admin/suppliers":get:summary: List suppliers@@ -51456,7 +50736,7 @@ paths:- id: sup_UkLWZg9DAJname: Acme Wholesalecontact_name: Dana Okafor- email: [email protected]+ email: [email protected]phone: 555-0100notes:address1: 1 Warehouse Way@@ -51598,57 +50878,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Northwind Trading- contact_name:- type: string- nullable: true- example: Dana Okafor- email:- type: string- nullable: true- example: [email protected]- phone:- type: string- nullable: true- example: 555-0100- notes:- type: string- nullable: true- address1:- type: string- nullable: true- example: 1 Warehouse Way- address2:- type: string- nullable: true- city:- type: string- nullable: true- example: Brooklyn- state_code:- type: string- nullable: true- example: NY- state_name:- type: string- nullable: true- country_code:- type: string- nullable: true- example: US- postal_code:- type: string- nullable: true- example: '11201'- metadata:- type: object- nullable: true- required:- - name+ "$ref": "#/components/schemas/SupplierCreateParams"required: true"/api/v3/admin/suppliers/{id}":parameters:@@ -51687,7 +50917,7 @@ paths:id: sup_UkLWZg9DAJname: Acme Wholesalecontact_name: Dana Okafor- email: [email protected]+ email: [email protected]phone: 555-0100notes:address1: 1 Warehouse Way@@ -51744,7 +50974,7 @@ paths:id: sup_UkLWZg9DAJname: Acme Wholesalecontact_name: Sam Reyes- email: [email protected]+ email: [email protected]phone: 555-0100notes:address1: 1 Warehouse Way@@ -51766,19 +50996,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- contact_name:- type: string- nullable: true- email:- type: string- nullable: true- phone:- type: string- nullable: true+ "$ref": "#/components/schemas/SupplierUpdateParams"required: truedelete:summary: Delete a supplier@@ -56125,15 +55343,15 @@ components:- image- video- external_video+ external_video_url:+ type: string+ nullable: truefocal_point_x:type: numbernullable: truefocal_point_y:type: numbernullable: true- external_video_url:- type: string- nullable: truevideo_provider:type: stringnullable: true@@ -56208,9 +55426,9 @@ components:- position- alt- media_type+ - external_video_url- focal_point_x- focal_point_y- - external_video_url- video_provider- video_embed_url- video_url@@ -56673,6 +55891,7 @@ components:type: booleanstore_owner_notification_delivered:type: boolean+ nullable: truemetadata:type: objectcancel_note:@@ -59957,6 +59176,9 @@ components:- ozunit_system:type: string+ enum:+ - metric+ - imperialstorefront_access:type: stringenum:@@ -61803,6 +61025,6753 @@ components:required:- type- preferences+ AddressInputParams:+ type: object+ properties:+ first_name:+ type: string+ last_name:+ type: string+ firstname:+ type: string+ description: Legacy spelling of `first_name` / `last_name`; send only one+ of the two.+ lastname:+ type: string+ description: Legacy spelling of `first_name` / `last_name`; send only one+ of the two.+ address1:+ type: string+ address2:+ type: string+ city:+ type: string+ postal_code:+ type: string+ zipcode:+ type: string+ description: Legacy spelling of `postal_code`; send only one of the two.+ country_code:+ type: string+ example: US+ state_code:+ type: string+ example: NY+ state_name:+ type: string+ description: For countries without states in the database.+ phone:+ type: string+ alternative_phone:+ type: string+ company:+ type: string+ label:+ type: string+ AdminUserUpdateParams:+ type: object+ properties:+ first_name:+ type: string+ last_name:+ type: string+ role_ids:+ type: array+ items:+ type: string+ description: Role IDs of the current store the user should hold. Replaces+ the user's roles on this store; an empty list removes them all.+ AllowedOriginCreateParams:+ type: object+ properties:+ origin:+ type: string+ description: 'Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]`+ (no path, query or fragment) using `http` or `https`.'+ example: https://admin.example.com+ required:+ - origin+ AllowedOriginUpdateParams:+ type: object+ properties:+ origin:+ type: string+ description: 'Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]`+ (no path, query or fragment) using `http` or `https`.'+ example: https://admin.example.com+ ApiKeyCreateParams:+ type: object+ properties:+ name:+ type: string+ key_type:+ type: string+ enum:+ - publishable+ - secret+ scopes:+ type: array+ items:+ type: string+ description: 'Required for secret keys. You can only grant scopes you hold+ yourself. Fixed once created: to change them, create a new key and revoke+ the old one.'+ example:+ - read_orders+ - write_products+ channel_id:+ type: string+ description: Binds a publishable key to one channel of the store (`ch_...`),+ so it rejects requests for other channels. Fixed once created; omit it+ for a store-wide key.+ required:+ - name+ - key_type+ ApiKeyUpdateParams:+ type: object+ properties:+ name:+ type: string+ required:+ - name+ BulkTagsParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ description: The records to change. Records the caller cannot update are+ skipped; an empty list changes nothing.+ tags:+ type: array+ items:+ type: string+ example:+ - vip+ - wholesale+ required:+ - ids+ - tags+ CatalogAssignParams:+ type: object+ properties:+ assignable_type:+ type: string+ enum:+ - customer_group+ - company+ description: Buyer audiences only. A company assignment covers its subtree.+ example: company+ assignable_id:+ type: string+ example: comp_86Rf07xd4z+ required:+ - assignable_type+ - assignable_id+ CatalogAssignmentParams:+ type: object+ properties:+ assignable_type:+ type: string+ enum:+ - customer_group+ - company+ description: Buyer audiences only. A company assignment covers its subtree.+ example: company+ assignable_id:+ type: string+ example: comp_86Rf07xd4z+ required:+ - assignable_type+ - assignable_id+ CatalogOrderMinimumParams:+ type: object+ properties:+ currency:+ type: string+ description: ISO 4217 code. Required on create; one minimum per currency.+ example: USD+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '500.00'+ CatalogParams:+ type: object+ properties:+ name:+ type: string+ example: VIP Assortment+ description:+ type: string+ description: Internal note on what the agreement is, never shown to shoppers.+ nullable: true+ active:+ type: boolean+ example: true+ position:+ type: integer+ minimum_order_quantity:+ type: integer+ description: The catalog-wide quantity terms, between a variant's own rule+ and a per-variant override. Null leaves the field to the variant's own+ rule.+ nullable: true+ order_multiple:+ type: integer+ description: The catalog-wide quantity terms, between a variant's own rule+ and a per-variant override. Null leaves the field to the variant's own+ rule.+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ assignments:+ type: array+ items:+ "$ref": "#/components/schemas/CatalogAssignmentParams"+ description: The whole audience. An entry left out is withdrawn; omitting+ the key leaves the audience alone.+ order_minimums:+ type: array+ items:+ "$ref": "#/components/schemas/CatalogOrderMinimumParams"+ description: The whole order-minimum set. A currency left out has its minimum+ lifted; omitting the key leaves them alone.+ price_list:+ allOf:+ - "$ref": "#/components/schemas/CatalogPriceListParams"+ description: 'The price list this catalog prices through, written inline:+ an object creates the owned list or updates it. Null deletes the list+ (a soft delete). Omit the key, or send `{}`, to leave the pricing alone.+ A catalog with an empty assortment prices without hiding anything; curate+ or import products to make it restrictive.'+ nullable: true+ CatalogPriceListParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ status:+ type: string+ match_policy:+ type: string+ starts_at:+ type: string+ format: date-time+ nullable: true+ ends_at:+ type: string+ format: date-time+ nullable: true+ price_adjustment_percentage:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Signed: negative discounts off base prices, positive marks+ up.'+ example: "-15.0"+ nullable: true+ adjust_compare_at:+ type: boolean+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListRuleParams"+ description: Contextual rules, in practice a `volume_rule`. Audience rules+ are left as they are, and an empty list clears the contextual rules.+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListPriceOverrideParams"+ description: Explicit per-variant amounts. An empty list clears them, which+ is what switching to a percentage sends.+ price_adjustment_tiers:+ type: array+ items:+ "$ref": "#/components/schemas/PriceAdjustmentTierParams"+ description: Quantity bands on the percentage. The payload is the whole+ ladder, so an empty list clears it.+ CatalogProductTermsParams:+ type: object+ properties:+ terms:+ type: object+ additionalProperties: true+ description: 'Quantity terms keyed by product: `{ minimum_order_quantity,+ order_multiple }`, each a whole number or null. A product whose pair is+ both null has its terms cleared; a product not yet in the assortment is+ added.'+ example:+ prod_abc123:+ minimum_order_quantity: 48+ order_multiple: 24+ required:+ - terms+ CategoryCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Shirts+ parent_id:+ type: string+ description: 'The parent category. Omitted or null, a new category goes+ to the top level and an existing one keeps its parent: moving one to the+ top level is the reposition endpoint.'+ example: ctg_abc123+ nullable: true+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ permalink:+ type: string+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the landscape image,+ or null to remove it.+ nullable: true+ square_image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the square image, or+ null to remove it.+ nullable: true+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ required:+ - name+ CategoryRepositionParams:+ type: object+ properties:+ new_parent_id:+ type: string+ description: The new parent. Omit or null to move the category to the top+ level.+ nullable: true+ new_position:+ type: integer+ description: 0-based index among the new parent's children.+ example: 0+ required:+ - new_position+ CategoryUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Shirts+ parent_id:+ type: string+ description: 'The parent category. Omitted or null, a new category goes+ to the top level and an existing one keeps its parent: moving one to the+ top level is the reposition endpoint.'+ example: ctg_abc123+ nullable: true+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ permalink:+ type: string+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the landscape image,+ or null to remove it.+ nullable: true+ square_image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the square image, or+ null to remove it.+ nullable: true+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ ChannelAddProductsParams:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ published_at:+ type: string+ format: date-time+ description: When the publications go live. Null means immediately.+ nullable: true+ unpublished_at:+ type: string+ format: date-time+ description: When the publications come down. Null means never.+ nullable: true+ required:+ - product_ids+ ChannelCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Point of Sale+ code:+ type: string+ description: URL-safe slug, derived from `name` when blank (`Point of Sale`+ becomes `point-of-sale`).+ example: pos+ active:+ type: boolean+ default:+ type: boolean+ order_routing_strategy:+ type: string+ description: 'Order routing strategy shorthand (built-in: `rules`). Null+ inherits the store setting.'+ nullable: true+ storefront_access:+ type: string+ enum:+ - public+ - prices_hidden+ - login_required+ description: What anonymous visitors can see. Null inherits the store setting.+ nullable: true+ guest_checkout:+ type: boolean+ description: Whether guests can check out without an account. Null inherits+ the store setting.+ nullable: true+ default_catalog_id:+ type: string+ description: Catalog (`cat_...`) shown to shoppers no company or customer+ group catalog covers. Null means every product published on the channel.+ nullable: true+ stock_location_ids:+ type: array+ items:+ type: string+ description: Stock locations (`sloc_...`) that fulfill this channel. Replaces+ the whole set; an empty list means every location of the store.+ required:+ - name+ ChannelRemoveProductsParams:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ required:+ - product_ids+ ChannelUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Point of Sale+ code:+ type: string+ description: URL-safe slug, derived from `name` when blank (`Point of Sale`+ becomes `point-of-sale`).+ example: pos+ active:+ type: boolean+ default:+ type: boolean+ order_routing_strategy:+ type: string+ description: 'Order routing strategy shorthand (built-in: `rules`). Null+ inherits the store setting.'+ nullable: true+ storefront_access:+ type: string+ enum:+ - public+ - prices_hidden+ - login_required+ description: What anonymous visitors can see. Null inherits the store setting.+ nullable: true+ guest_checkout:+ type: boolean+ description: Whether guests can check out without an account. Null inherits+ the store setting.+ nullable: true+ default_catalog_id:+ type: string+ description: Catalog (`cat_...`) shown to shoppers no company or customer+ group catalog covers. Null means every product published on the channel.+ nullable: true+ stock_location_ids:+ type: array+ items:+ type: string+ description: Stock locations (`sloc_...`) that fulfill this channel. Replaces+ the whole set; an empty list means every location of the store.+ ClaimCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the claim was canceled.+ ClaimCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ line_item_id:+ type: string+ quantity:+ type: integer+ description:+ type: string+ send_replacement:+ type: boolean+ replacement_variant_id:+ type: string+ description: Defaults to the variant that was bought.+ refund_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ required:+ - line_item_id+ - quantity+ description: Affected items, and how each should be made right.+ reason_id:+ type: string+ description: One of the store's claim reasons.+ memo:+ type: string+ required:+ - items+ ClaimDenyParams:+ type: object+ properties:+ reason:+ type: string+ description: Recorded on the claim for the customer.+ ClaimResolveParams:+ type: object+ properties:+ resolution:+ type: string+ enum:+ - refund+ - replacement+ - refund_and_replacement+ description: Money back, a replacement shipment, or both.+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: Defaults to `store_credit`.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the claim total.+ replacement_line_item_ids:+ type: array+ items:+ type: string+ description: Which claim lines to send a replacement for. Omit to keep what+ the claim was opened with.+ required:+ - resolution+ ClaimUpdateParams:+ type: object+ properties:+ reason_id:+ type: string+ description: One of the store's claim reasons.+ memo:+ type: string+ metadata:+ type: object+ additionalProperties: true+ CollectionCreateParams:+ type: object+ properties:+ name:+ type: string+ example: On Sale+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ permalink:+ type: string+ position:+ type: integer+ description: 1-based position among the store's collections; the server+ shifts its siblings. The nested products reposition endpoints, unlike+ this, take 0-based indexes.+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the landscape image,+ or null to remove it.+ nullable: true+ square_image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the square image, or+ null to remove it.+ nullable: true+ automatic:+ type: boolean+ description: When true, membership is materialized from `rules` instead+ of curated by hand.+ rules_match_policy:+ type: string+ enum:+ - all+ - any+ description: Whether a product must match all rules or any of them. Defaults+ to `all`.+ sort_order:+ type: string+ enum:+ - manual+ - best_selling+ - price asc+ - price desc+ - available_on desc+ - available_on asc+ - name asc+ - name desc+ description: Default product sort for the storefront listing; a shopper's+ own sort wins. Defaults to `manual`.+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/CollectionRuleParams"+ description: The complete desired rule set. Entries with an `id` update,+ entries without one are created, and existing rules left out are removed.+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ required:+ - name+ CollectionRuleParams:+ type: object+ properties:+ id:+ type: string+ description: Omit to create a new rule.+ example: crule_abc123+ type:+ type: string+ description: Wire shorthand for the rule kind, from the collection rule+ types endpoint.+ example: tag+ value:+ type: string+ example: summer+ match_policy:+ type: string+ enum:+ - is_equal_to+ - is_not_equal_to+ - contains+ - does_not_contain+ example: contains+ CollectionUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: On Sale+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ permalink:+ type: string+ position:+ type: integer+ description: 1-based position among the store's collections; the server+ shifts its siblings. The nested products reposition endpoints, unlike+ this, take 0-based indexes.+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the landscape image,+ or null to remove it.+ nullable: true+ square_image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the square image, or+ null to remove it.+ nullable: true+ automatic:+ type: boolean+ description: When true, membership is materialized from `rules` instead+ of curated by hand.+ rules_match_policy:+ type: string+ enum:+ - all+ - any+ description: Whether a product must match all rules or any of them. Defaults+ to `all`.+ sort_order:+ type: string+ enum:+ - manual+ - best_selling+ - price asc+ - price desc+ - available_on desc+ - available_on asc+ - name asc+ - name desc+ description: Default product sort for the storefront listing; a shopper's+ own sort wins. Defaults to `manual`.+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/CollectionRuleParams"+ description: The complete desired rule set. Entries with an `id` update,+ entries without one are created, and existing rules left out are removed.+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ CommissionRateCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Audio sellers+ code:+ type: string+ description: Your own identifier for this rate; unique per store.+ example: audio+ nullable: true+ enabled:+ type: boolean+ position:+ type: integer+ description: Place in the list. Rates resolve top-down and the first whose+ rules match wins, so 1 is tried first. New rates are created at the top;+ send this to move one. A rate with no rules matches every sale, so the+ marketplace default belongs at the bottom.+ example: 1+ kind:+ type: string+ enum:+ - percentage+ - fixed+ description: "`percentage` charges a share of the sale; `fixed` charges+ a flat fee."+ example: percentage+ value:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: A percentage (10 = 10%) or a flat amount, per `kind`.+ example: '12.5'+ 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. Percentage+ rates only.+ commission_tax_rate:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: VAT on the commission itself, as a fraction rather than a percentage.+ Null lets the store's tax engine answer for the seller's jurisdiction.+ example: '0.21'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ amounts:+ type: object+ additionalProperties: true+ description: What a flat fee charges, keyed by currency, as decimal strings.+ A sale in a currency with no amount falls to the next matching rate. Replaces+ the whole set.+ example:+ USD: '2.50'+ EUR: '2.00'+ bounds:+ type: object+ additionalProperties: true+ description: 'The floor and cap a percentage charges within, keyed by currency:+ `{ min_amount, max_amount }` decimal strings. A sale in a currency with+ no bounds is charged unbounded. Replaces the whole set.'+ example:+ USD:+ min_amount: '1.00'+ max_amount: '50.00'+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/CommissionRuleDraftParams"+ description: The full targeting; what you send replaces what the rate holds.+ required:+ - name+ - kind+ - value+ CommissionRateUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Audio sellers+ code:+ type: string+ description: Your own identifier for this rate; unique per store.+ example: audio+ nullable: true+ enabled:+ type: boolean+ position:+ type: integer+ description: Place in the list. Rates resolve top-down and the first whose+ rules match wins, so 1 is tried first. New rates are created at the top;+ send this to move one. A rate with no rules matches every sale, so the+ marketplace default belongs at the bottom.+ example: 1+ kind:+ type: string+ enum:+ - percentage+ - fixed+ description: "`percentage` charges a share of the sale; `fixed` charges+ a flat fee."+ example: percentage+ value:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: A percentage (10 = 10%) or a flat amount, per `kind`.+ example: '12.5'+ 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. Percentage+ rates only.+ commission_tax_rate:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: VAT on the commission itself, as a fraction rather than a percentage.+ Null lets the store's tax engine answer for the seller's jurisdiction.+ example: '0.21'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ amounts:+ type: object+ additionalProperties: true+ description: What a flat fee charges, keyed by currency, as decimal strings.+ A sale in a currency with no amount falls to the next matching rate. Replaces+ the whole set.+ example:+ USD: '2.50'+ EUR: '2.00'+ bounds:+ type: object+ additionalProperties: true+ description: 'The floor and cap a percentage charges within, keyed by currency:+ `{ min_amount, max_amount }` decimal strings. A sale in a currency with+ no bounds is charged unbounded. Replaces the whole set.'+ example:+ USD:+ min_amount: '1.00'+ max_amount: '50.00'+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/CommissionRuleDraftParams"+ description: The full targeting; what you send replaces what the rate holds.+ CommissionRuleDraftParams:+ type: object+ properties:+ id:+ type: string+ description: Present for an existing rule; omit to create one.+ nullable: true+ type:+ type: string+ description: A kind from `GET /commission_rates/rule_types`.+ example: seller_rule+ preferences:+ type: object+ additionalProperties: true+ description: Configuration for the kind, per its type's `schema`.+ example:+ seller_ids:+ - sel_a1b2c3+ product_ids:+ type: array+ items:+ type: string+ description: For kinds that name products, which are kept outside preferences.+ required:+ - type+ CompanyAddressParams:+ type: object+ 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+ zipcode:+ type: string+ phone:+ type: string+ state_name:+ type: string+ label:+ type: string+ country_code:+ type: string+ description: ISO 3166-1 alpha-2 code, such as `US`.+ state_code:+ type: string+ description: The state or province abbreviation, such as `NY`.+ default_billing:+ type: boolean+ description: True makes this the default address of that kind, false gives+ the slot up, and leaving it out keeps the current default.+ default_shipping:+ type: boolean+ description: True makes this the default address of that kind, false gives+ the slot up, and leaving it out keeps the current default.+ CompanyMembershipCreateParams:+ type: object+ properties:+ customer_email:+ type: string+ description: An existing customer becomes a member immediately; an unknown+ email becomes an invitation, and the response is an invitation instead+ of a membership.+ example: [email protected]+ metadata:+ type: object+ additionalProperties: true+ required:+ - customer_email+ CompanyParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ description: Required when creating.+ example: Globex Corporation+ kind:+ type: string+ enum:+ - company+ - division+ description: "`company` is a legal entity (may hold tax registrations),+ `division` an organizational unit. Roots must be `company`."+ example: company+ parent_id:+ type: string+ description: The parent node. Omit or null for a root.+ example: comp_86Rf07xd4z+ nullable: true+ po_number_required:+ type: boolean+ description: 'Whether this buyer''s own procurement process demands a PO+ reference on every order: checkout asks for one and refuses to complete+ without it.'+ metadata:+ type: object+ additionalProperties: true+ CustomFieldCreateParams:+ type: object+ properties:+ custom_field_definition_id:+ type: string+ example: cfdef_abc123+ value:+ description: 'A value matching the definition''s `field_type`: a scalar+ for text, number and boolean fields; a list or a hash for JSON fields.'+ required:+ - custom_field_definition_id+ - value+ CustomFieldDefinitionCreateParams:+ type: object+ properties:+ namespace:+ type: string+ description: Defaults to `custom`.+ key:+ type: string+ label:+ type: string+ description: Human-readable name; defaults to the titleized `key`.+ field_type:+ type: string+ description: Custom field type token (`short_text`, `long_text`, `rich_text`,+ `number`, …). An extension type that has no token is named by its registered+ class instead.+ example: short_text+ resource_type:+ type: string+ description: Shorthand of the resource the field attaches to, from the resource+ types endpoint.+ example: product+ storefront_visible:+ type: boolean+ description: When false, the definition is admin-only and never exposed+ in the Store API.+ searchable:+ type: boolean+ description: Include values in storefront product text search. Supported+ for `short_text`, `long_text` and `number` fields; other types are refused.+ sortable:+ type: boolean+ description: Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`).+ Supported for `short_text` and `number` fields; other types are refused.+ required:+ - key+ - field_type+ - resource_type+ CustomFieldDefinitionUpdateParams:+ type: object+ properties:+ namespace:+ type: string+ description: Defaults to `custom`.+ key:+ type: string+ label:+ type: string+ description: Human-readable name; defaults to the titleized `key`.+ field_type:+ type: string+ description: Custom field type token (`short_text`, `long_text`, `rich_text`,+ `number`, …). An extension type that has no token is named by its registered+ class instead.+ example: short_text+ resource_type:+ type: string+ description: Shorthand of the resource the field attaches to, from the resource+ types endpoint.+ example: product+ storefront_visible:+ type: boolean+ description: When false, the definition is admin-only and never exposed+ in the Store API.+ searchable:+ type: boolean+ description: Include values in storefront product text search. Supported+ for `short_text`, `long_text` and `number` fields; other types are refused.+ sortable:+ type: boolean+ description: Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`).+ Supported for `short_text` and `number` fields; other types are refused.+ CustomFieldUpdateParams:+ type: object+ properties:+ value:+ description: 'A value matching the definition''s `field_type`: a scalar+ for text, number and boolean fields; a list or a hash for JSON fields.'+ required:+ - value+ CustomFieldValueParams:+ type: object+ properties:+ id:+ type: string+ custom_field_definition_id:+ type: string+ value:+ description: A scalar for text, number and boolean fields; a list or a hash+ for JSON fields.+ CustomerAddressParams:+ type: object+ 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+ zipcode:+ type: string+ phone:+ type: string+ state_name:+ type: string+ label:+ type: string+ country_code:+ type: string+ description: ISO 3166-1 alpha-2 code, such as `US`.+ state_code:+ type: string+ description: The state or province abbreviation, such as `NY`.+ firstname:+ type: string+ description: Older spellings of `first_name` and `last_name`.+ lastname:+ type: string+ description: Older spellings of `first_name` and `last_name`.+ alternative_phone:+ type: string+ quick_checkout:+ type: boolean+ is_default_billing:+ type: boolean+ description: Makes this the customer's default address of that kind.+ is_default_shipping:+ type: boolean+ description: Makes this the customer's default address of that kind.+ CustomerBulkGroupsParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ example:+ - cus_UkLWZg9DAJ+ - cus_QrLWXg9CAJ+ customer_group_ids:+ type: array+ items:+ type: string+ description: Groups from other stores are ignored.+ example:+ - cg_UkLWZg9DAJ+ required:+ - ids+ - customer_group_ids+ CustomerCreateParams:+ type: object+ properties:+ email:+ type: string+ example: [email protected]+ first_name:+ type: string+ last_name:+ type: string+ phone:+ type: string+ password:+ type: string+ description: 'Optional: a customer created without one claims the account+ through a password reset.'+ password_confirmation:+ type: string+ description: 'Optional: a customer created without one claims the account+ through a password reset.'+ selected_locale:+ type: string+ avatar_signed_id:+ type: string+ description: A `signed_id` from `files.upload()`.+ accepts_email_marketing:+ type: boolean+ internal_note:+ type: string+ description: Rich text HTML. Reads come back as this plus `internal_note_html`.+ metadata:+ type: object+ additionalProperties: true+ tags:+ type: array+ items:+ type: string+ customer_group_ids:+ type: array+ items:+ type: string+ description: Replaces the customer's group membership.+ required:+ CustomerGroupCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Wholesale+ description:+ type: string+ example: B2B accounts+ nullable: true+ customer_ids:+ type: array+ items:+ type: string+ description: Replaces the group's members.+ example:+ - cus_UkLWZg9DAJ+ required:+ - name+ CustomerGroupUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Wholesale+ description:+ type: string+ example: B2B accounts+ nullable: true+ customer_ids:+ type: array+ items:+ type: string+ description: Replaces the group's members.+ example:+ - cus_UkLWZg9DAJ+ CustomerStoreCreditCreateParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '50.00'+ currency:+ type: string+ example: USD+ memo:+ type: string+ required:+ - amount+ - currency+ CustomerStoreCreditUpdateParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '50.00'+ memo:+ type: string+ CustomerUpdateParams:+ type: object+ properties:+ email:+ type: string+ example: [email protected]+ first_name:+ type: string+ last_name:+ type: string+ phone:+ type: string+ password:+ type: string+ description: 'Optional: a customer created without one claims the account+ through a password reset.'+ password_confirmation:+ type: string+ description: 'Optional: a customer created without one claims the account+ through a password reset.'+ selected_locale:+ type: string+ avatar_signed_id:+ type: string+ description: A `signed_id` from `files.upload()`.+ accepts_email_marketing:+ type: boolean+ internal_note:+ type: string+ description: Rich text HTML. Reads come back as this plus `internal_note_html`.+ metadata:+ type: object+ additionalProperties: true+ tags:+ type: array+ items:+ type: string+ customer_group_ids:+ type: array+ items:+ type: string+ description: Replaces the customer's group membership.+ DataRequestCreateParams:+ type: object+ properties:+ customer_id:+ type: string+ kind:+ type: string+ enum:+ - access+ - erasure+ description: "`access` asks for a copy of the customer's personal data;+ `erasure` asks for it to be erased."+ required:+ - customer_id+ - kind+ DeliveryCreateParams:+ type: object+ properties:+ tracking_number:+ type: string+ description: A carrier tracking number, a freight PRO or container number,+ or a full tracking link. A corrected number resets the carrier status+ to `pending`.+ carrier:+ type: string+ description: Free text; detected from the number's format when omitted.+ service:+ type: string+ tracking_url:+ type: string+ required:+ - tracking_number+ DeliveryMarkDeliveredParams:+ type: object+ properties:+ delivered_at:+ type: string+ format: date-time+ description: When it arrived. Defaults to now.+ notify_customer:+ type: boolean+ description: Whether the customer gets a delivery notification once the+ parcel completes. Defaults to true.+ DeliveryMethodParams:+ type: object+ properties:+ name:+ type: string+ example: Express+ admin_name:+ type: string+ nullable: true+ code:+ type: string+ nullable: true+ fulfillment_provider:+ type: string+ description: Fulfillment provider shorthand (see the fulfillment providers+ endpoint), e.g. `manual`.+ example: manual+ pickup_point_provider:+ type: string+ nullable: true+ rate_provider:+ type: string+ description: Rate provider shorthand (see the rate providers endpoint),+ e.g. `easy_post`. Omit or send null for the built-in provider, which prices+ through the method's calculator.+ nullable: true+ storefront_visible:+ type: boolean+ available_to_sellers:+ type: boolean+ description: 'Marketplace only: whether a seller''s packages may be quoted+ by this method. Off by default, and refused on a method that belongs to+ a seller.'+ 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+ description: Prefixed tax category ID (`taxcat_...`), or null to clear.+ nullable: true+ markup_flat:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Method-level flat handling fee added on top of provider-quoted+ rates.+ nullable: true+ markup_percent:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Method-level percentage handling fee added on top of provider-quoted+ rates. Ignored for calculator-priced methods.+ nullable: true+ delivery_profile_id:+ type: string+ description: Delivery profile this method belongs to (`fp_...`); defaults+ to the store default profile.+ example: fp_86Rf07xd4z+ delivery_origin_group_id:+ type: string+ description: Origin group offering this method (`og_...`); defaults to the+ zone's group, else the profile's default group.+ delivery_zone_id:+ type: string+ description: Delivery zone narrowing destinations (`dz_...`), or null for+ no restriction. Must belong to the method's profile.+ nullable: true+ stock_location_ids:+ type: array+ items:+ type: string+ description: Pickup locations (`sloc_...`); replaces the full set.+ calculator:+ type: object+ properties:+ type:+ type: string+ example: flat_rate+ preferences:+ type: object+ additionalProperties: true+ example:+ amount: '12.5'+ description: 'How the method prices a shipment: a type from the calculators+ endpoint and its preferences, matching that type''s `schema`.'+ rules:+ type: array+ items:+ type: object+ properties:+ id:+ type: string+ type:+ type: string+ description: A rule kind from the delivery method rule types endpoint.+ active:+ type: boolean+ preferences:+ type: object+ additionalProperties: true+ product_ids:+ type: array+ items:+ type: string+ description: Products an association-backed rule (`excluded_products_rule`)+ applies to.+ description: 'Eligibility rules. Replaces the full set: omitted rules are+ removed.'+ services:+ type: array+ items:+ "$ref": "#/components/schemas/DeliveryMethodServiceParams"+ description: 'Carrier service rows: which provider services this method+ offers. Replaces the full set: omitted rows are removed; no rows means+ every service the provider returns is offered.'+ DeliveryMethodRuleCreateParams:+ type: object+ properties:+ type:+ type: string+ description: A rule kind from the delivery method rule types endpoint.+ example: excluded_products_rule+ active:+ type: boolean+ description: Defaults to true on create.+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's preference schema.+ product_ids:+ type: array+ items:+ type: string+ description: Products an association-backed rule (`excluded_products_rule`)+ applies to. An empty list clears them.+ required:+ - type+ DeliveryMethodRuleUpdateParams:+ type: object+ properties:+ active:+ type: boolean+ description: Defaults to true on create.+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's preference schema.+ product_ids:+ type: array+ items:+ type: string+ description: Products an association-backed rule (`excluded_products_rule`)+ applies to. An empty list clears them.+ DeliveryMethodServiceParams:+ type: object+ properties:+ id:+ type: string+ description: Prefixed row ID (`dms_...`) when updating an existing row.+ carrier:+ type: string+ description: Carrier identifier as the provider's API knows it.+ example: UPS+ service:+ type: string+ description: Service identifier as the provider's API knows it.+ example: Ground+ label:+ type: string+ description: Display label shown to customers instead of the carrier-derived+ name.+ nullable: true+ markup_flat:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Overrides the method-level flat markup for this service.+ nullable: true+ markup_percent:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Overrides the method-level percentage markup for this service.+ nullable: true+ position:+ type: integer+ required:+ - carrier+ - service+ DeliveryOriginGroupParams:+ type: object+ properties:+ name:+ type: string+ example: EU warehouse+ nullable: true+ position:+ type: integer+ stock_location_ids:+ type: array+ items:+ type: string+ description: Prefixed stock location IDs (`sloc_...`); replaces the full+ set. Empty means every store location.+ DeliveryProfileParams:+ type: object+ properties:+ name:+ type: string+ example: Oversized+ kind:+ type: string+ description: Registered profile kind (`shipping`, `digital`, extension kinds)+ from the kinds endpoint. Read on create only; defaults to shipping.+ example: shipping+ default:+ type: boolean+ description: Promotes this profile to the store default; the previous default+ is demoted.+ position:+ type: integer+ stock_location_ids:+ type: array+ items:+ type: string+ description: Prefixed stock location IDs (`sloc_...`); replaces the full+ set. Empty means every store location.+ DeliveryUpdateParams:+ type: object+ properties:+ tracking_number:+ type: string+ description: A carrier tracking number, a freight PRO or container number,+ or a full tracking link. A corrected number resets the carrier status+ to `pending`.+ carrier:+ type: string+ description: Free text; detected from the number's format when omitted.+ service:+ type: string+ tracking_url:+ type: string+ DeliveryZoneMemberParams:+ type: object+ properties:+ member_type:+ type: string+ enum:+ - country+ - state+ - postal_code+ country_code:+ type: string+ example: US+ state_code:+ type: string+ description: A subdivision code or name. Without `country_code` the country+ is inferred when only one country matches.+ postal_code_prefix:+ type: string+ postal_code_from:+ type: string+ postal_code_to:+ type: string+ required:+ - member_type+ DeliveryZoneParams:+ type: object+ properties:+ name:+ type: string+ example: US North-East+ description:+ type: string+ nullable: true+ delivery_profile_id:+ type: string+ description: Delivery profile this zone belongs to (`fp_...`); defaults+ to the store default profile.+ delivery_origin_group_id:+ type: string+ description: Origin group this zone belongs to (`og_...`).+ members:+ type: array+ items:+ "$ref": "#/components/schemas/DeliveryZoneMemberParams"+ description: Replaces the zone's full member set atomically.+ DigitalAssetCreateParams:+ type: object+ properties:+ signed_id:+ type: string+ description: 'A `signed_id` from `files.upload()` with `visibility: ''private''`.+ Required for an uploaded file, omitted for a provider-backed asset. On+ update it replaces the file for everyone who already bought it.'+ variant_id:+ type: string+ description: Defaults to the product's default variant when omitted.+ provider_type:+ type: string+ description: A provider shorthand from the providers endpoint. Omit for+ an uploaded file.+ provider_settings:+ type: object+ additionalProperties: true+ description: Values for the provider's settings schema, keyed by field name.+ authorized_clicks:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ authorized_days:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ DigitalAssetUpdateParams:+ type: object+ properties:+ signed_id:+ type: string+ description: 'A `signed_id` from `files.upload()` with `visibility: ''private''`.+ Required for an uploaded file, omitted for a provider-backed asset. On+ update it replaces the file for everyone who already bought it.'+ variant_id:+ type: string+ description: Defaults to the product's default variant when omitted.+ provider_type:+ type: string+ description: A provider shorthand from the providers endpoint. Omit for+ an uploaded file.+ provider_settings:+ type: object+ additionalProperties: true+ description: Values for the provider's settings schema, keyed by field name.+ authorized_clicks:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ authorized_days:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ DiscountCodeApplyParams:+ type: object+ properties:+ code:+ type: string+ required:+ - code+ DiscountCreateParams:+ type: object+ properties:+ label:+ type: string+ example: Customer appeasement+ value:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: An amount in the order currency for a `flat` discount, or a+ percentage for a `percent` one.+ example: '10.00'+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: On create, an older spelling of `value`, read when `value`+ is absent. On update, the new amount of the row.+ value_type:+ type: string+ enum:+ - flat+ - percent+ description: Defaults to `flat`.+ line_item_id:+ type: string+ description: The line item the discount applies to. Omitted, the value is+ distributed across the line items.+ nullable: true+ required:+ - label+ DiscountUpdateParams:+ type: object+ properties:+ label:+ type: string+ example: Customer appeasement+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: On create, an older spelling of `value`, read when `value`+ is absent. On update, the new amount of the row.+ EmailTemplateDraftParams:+ type: object+ properties:+ language:+ type: string+ description: A language code, or `any` (the default) for the version every+ language uses.+ example: any+ subject:+ type: string+ example: Your order {{ order.number }} is confirmed+ nullable: true+ body:+ type: string+ example: "<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name+ }}!</mj-text></mj-column></mj-section>"+ lock_version:+ type: integer+ description: The `lock_version` the draft was loaded with, or null when+ there was no draft; a save from an older copy is refused with 409. Omit+ it to save without checking.+ example: 0+ nullable: true+ rebase:+ type: boolean+ description: Marks the draft as based on Spree's current default, after+ reviewing what changed in it.+ EmailTemplatePreviewParams:+ type: object+ properties:+ language:+ type: string+ description: A language code, or `any` (the default) for the version every+ language uses.+ example: any+ subject:+ type: string+ description: An unsaved subject, in place of the current one.+ example: Your order {{ order.number }} is confirmed+ nullable: true+ body:+ type: string+ description: An unsaved body, in place of the current one.+ example: "<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name+ }}!</mj-text></mj-column></mj-section>"+ record_id:+ type: string+ description: The record to build sample data from; the store's latest matching+ record otherwise.+ example: or_m3Rp9wXz+ email_key:+ type: string+ description: For the layout or a partial, the email to show it in.+ example: spree.order_mailer.confirm_email+ branding:+ type: object+ properties:+ accent_color:+ type: string+ nullable: true+ background_color:+ type: string+ nullable: true+ card_color:+ type: string+ nullable: true+ text_color:+ type: string+ nullable: true+ heading_color:+ type: string+ nullable: true+ font:+ type: string+ enum:+ - inter+ - system+ - helvetica+ - georgia+ - roboto+ - lato+ - merriweather+ nullable: true+ description: Unsaved colors and font to preview, named like the store's+ `email_*` settings.+ EmailTemplateRestoreParams:+ type: object+ properties:+ language:+ type: string+ description: A language code, or `any` (the default) for the version every+ language uses.+ example: any+ lock_version:+ type: integer+ description: The open draft's `lock_version`, or null when there is none;+ checked as when saving.+ nullable: true+ EmailTemplateVersionParams:+ type: object+ properties:+ language:+ type: string+ description: A language code, or `any` (the default) for the version every+ language uses.+ example: any+ lock_version:+ type: integer+ description: The draft's `lock_version` as reviewed. A draft saved since+ is refused with 409.+ ExchangeCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the exchange was canceled.+ ExchangeCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ fulfillment_item_id:+ type: string+ new_variant_id:+ type: string+ quantity:+ type: integer+ required:+ - fulfillment_item_id+ - new_variant_id+ - quantity+ description: Items coming back, and what goes out in their place.+ stock_location_id:+ type: string+ description: Where the goods come back to.+ reason_id:+ type: string+ description: One of the store's return reasons.+ memo:+ type: string+ required:+ - items+ ExchangeFulfillParams:+ type: object+ properties:+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: How a credit is returned when the replacements cost less than+ what came back. Defaults to `store_credit`. A balance the customer owes+ is left for the merchant to collect.+ ExchangeReceiveParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ exchange_line_item_id:+ type: string+ quantity:+ type: integer+ resellable:+ type: boolean+ description: Goods that cannot be resold are received but never restocked.+ Defaults to true.+ required:+ - exchange_line_item_id+ - quantity+ description: What actually arrived. Omit to receive everything as requested+ and resellable.+ ExchangeUpdateParams:+ type: object+ properties:+ stock_location_id:+ type: string+ description: Where the goods come back to.+ reason_id:+ type: string+ description: One of the store's return reasons.+ memo:+ type: string+ metadata:+ type: object+ additionalProperties: true+ ExportCreateParams:+ type: object+ properties:+ type:+ type: string+ description: 'Which dataset to export, as its shorthand: `products`, `orders`,+ `customers`, `product_translations`, `gift_cards`, `coupon_codes`, `newsletter_subscribers`,+ `price_list_prices`, `purchase_orders`, or a type an extension registers.'+ example: products+ record_selection:+ type: string+ enum:+ - filtered+ - all+ description: "`filtered` (the default) keeps `search_params`; `all` ignores+ them and exports every record in scope."+ example: filtered+ 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 allowed origins.+ example: https://admin.example.com/store_abc/exports+ search_params:+ type: object+ additionalProperties: true+ description: 'A Ransack query, with the predicates the list endpoint accepts.+ A `price_list_prices` export requires `price_list_id_eq` naming a price+ list of the current store, and refuses `record_selection: "all"`.'+ example:+ name_cont: shirt+ required:+ - type+ FeeCreateParams:+ type: object+ properties:+ label:+ type: string+ example: Gift wrap+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '4.00'+ kind:+ type: string+ enum:+ - surcharge+ - handling+ - gift_wrap+ - cod+ - payment+ - duty+ - exchange+ description: Defaults to `surcharge`.+ example: gift_wrap+ line_item_id:+ type: string+ description: The line item or fulfillment the fee belongs to. Omitted, the+ fee is order-level.+ nullable: true+ fulfillment_id:+ type: string+ description: The line item or fulfillment the fee belongs to. Omitted, the+ fee is order-level.+ nullable: true+ required:+ - label+ - amount+ FeeUpdateParams:+ type: object+ properties:+ label:+ type: string+ example: Gift wrap+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '4.00'+ kind:+ type: string+ enum:+ - surcharge+ - handling+ - gift_wrap+ - cod+ - payment+ - duty+ - exchange+ description: Defaults to `surcharge`.+ example: gift_wrap+ FileUploadCreateParams:+ type: object+ properties:+ filename:+ type: string+ example: products.csv+ content_type:+ type: string+ example: text/csv+ byte_size:+ type: integer+ example: 48213+ checksum:+ type: string+ description: Base64-encoded MD5 digest of the file; the storage service+ checks the bytes against it.+ example: rL0Y20zC+Fzt72VPzMSk2A==+ visibility:+ type: string+ enum:+ - public+ - private+ description: "`public` (the default) for images and videos customers see,+ `private` for anything else."+ file:+ type: string+ format: binary+ description: The bytes, for a multipart upload.+ required:+ - filename+ - content_type+ FulfillmentCreateParams:+ type: object+ properties:+ stock_location_id:+ type: string+ description: The location the fulfillment ships from. On update, moving+ it re-prices the fulfillment against that location's rates.+ source_fulfillment_id:+ type: string+ description: 'The only fulfillment of this order to move units from, its+ exchange and claim replacements included: how a canceled replacement is+ sent again. Omitted, the customer''s bought units are taken from every+ unshipped fulfillment.'+ tracking:+ type: string+ description: Carrier tracking number, or a full `https://` tracking link,+ which is served back as `tracking_url` unchanged.+ delivery_method_id:+ type: string+ description: Delivery method attached as the selected rate. Defaults to+ the delivery method of the fully drained source fulfillments.+ cost:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Explicit shipping cost, such as the 3PL price. Defaults to+ the summed cost of the fully drained source fulfillments, which keeps+ the order total unchanged. Persists only with `status: shipped`; pending+ fulfillments are re-priced by the rate engine.'+ example: '7.42'+ status:+ type: string+ enum:+ - shipped+ description: Pass `shipped` to register an already-shipped external fulfillment.+ metadata:+ type: object+ additionalProperties: true+ items:+ type: array+ items:+ type: object+ properties:+ item_id:+ type: string+ quantity:+ type: integer+ required:+ - item_id+ - quantity+ description: Line item quantities to fulfill. Omit to fulfill every unit+ not yet shipped.+ required:+ - stock_location_id+ FulfillmentFulfillParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ item_id:+ type: string+ quantity:+ type: integer+ required:+ - item_id+ - quantity+ description: Line item quantities to ship. Omit to ship everything the fulfillment+ holds; a subset is split onto a new fulfillment, which is the one that+ ships.+ tracking:+ type: string+ description: Carrier tracking number or a full `https://` tracking link,+ stored on the fulfillment that ships.+ tracking_carrier:+ type: string+ description: Which carrier the number belongs to; detected from the number+ when omitted.+ notify_customer:+ type: boolean+ description: Whether the customer gets the shipment email. Defaults to true;+ pass false to suppress it for this dispatch only.+ force:+ type: boolean+ description: Hand the goods over even though the order is unpaid or holds+ backordered units.+ FulfillmentMarkDeliveredParams:+ type: object+ properties:+ delivered_at:+ type: string+ format: date-time+ description: When it arrived. Defaults to now; return windows run from this+ time.+ notify_customer:+ type: boolean+ description: Whether the customer gets a delivery notification. Defaults+ to true.+ FulfillmentSplitParams:+ type: object+ properties:+ variant_id:+ type: string+ description: The variant being moved out.+ quantity:+ type: integer+ stock_location_id:+ type: string+ description: Origin of the new fulfillment. Defaults to the source fulfillment's+ location.+ required:+ - variant_id+ - quantity+ FulfillmentUpdateParams:+ type: object+ properties:+ stock_location_id:+ type: string+ description: The location the fulfillment ships from. On update, moving+ it re-prices the fulfillment against that location's rates.+ tracking:+ type: string+ description: Carrier tracking number, or a full `https://` tracking link,+ which is served back as `tracking_url` unchanged.+ tracking_carrier:+ type: string+ description: 'Which carrier the tracking number belongs to: a slug from+ the tracking carriers endpoint. Left blank, it is detected from the number''s+ format where possible.'+ selected_delivery_rate_id:+ type: string+ GiftCardApplyParams:+ type: object+ properties:+ code:+ type: string+ description: The gift card code; matched case-insensitively.+ required:+ - code+ GiftCardBatchCreateParams:+ type: object+ properties:+ prefix:+ type: string+ description: Lowercased and prepended to every generated code.+ example: WELCOME+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: The amount of each card, greater than zero.+ example: '25.00'+ codes_count:+ type: integer+ description: How many cards to generate. Capped at `gift_card_batch_limit`;+ batches over `gift_card_batch_web_limit` generate in the background.+ example: 100+ currency:+ type: string+ description: ISO 4217 currency code. Defaults to the store currency.+ example: USD+ expires_at:+ type: string+ format: date+ example: '2030-12-31'+ nullable: true+ required:+ - prefix+ - amount+ - codes_count+ GiftCardCreateParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Greater than zero.+ example: '25.00'+ currency:+ type: string+ description: ISO 4217 currency code. Defaults to the store currency.+ example: USD+ code:+ type: string+ description: Generated when omitted.+ example: WELCOME50+ expires_at:+ type: string+ format: date+ example: '2030-12-31'+ nullable: true+ customer_id:+ type: string+ description: The customer the card belongs to. Needs the `read_customers`+ permission; null detaches it.+ example: cus_UkLWZg9DAJ+ nullable: true+ required:+ - amount+ GiftCardUpdateParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Greater than zero.+ example: '25.00'+ currency:+ type: string+ description: ISO 4217 currency code. Defaults to the store currency.+ example: USD+ code:+ type: string+ description: Generated when omitted.+ example: WELCOME50+ expires_at:+ type: string+ format: date+ example: '2030-12-31'+ nullable: true+ customer_id:+ type: string+ description: The customer the card belongs to. Needs the `read_customers`+ permission; null detaches it.+ example: cus_UkLWZg9DAJ+ nullable: true+ ImportCompleteMappingParams:+ type: object+ properties:+ mappings:+ type: array+ items:+ type: object+ properties:+ schema_field:+ type: string+ description: A schema field name from the import's `schema_fields`.+ example: slug+ file_column:+ type: string+ description: The CSV header to read the field from; null unmaps the+ field.+ example: Product Handle+ nullable: true+ required:+ - schema_field+ description: Column assignments to apply before processing starts. Omit+ to accept the ones assigned on create.+ ImportCreateParams:+ type: object+ properties:+ type:+ type: string+ description: 'Which dataset to import, as its shorthand: `products`, `customers`,+ `product_translations`, `price_list_prices`, `purchase_orders`, or a type+ an extension registers.'+ example: products+ attachment_signed_id:+ type: string+ description: 'The `signed_id` of the uploaded CSV, from `files.upload()`+ with `visibility: "private"`.'+ delimiter:+ type: string+ enum:+ - ","+ - ";"+ - "|"+ - "\t"+ description: CSV column separator. Defaults to a comma.+ example: ","+ 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 allowed origins.+ example: https://admin.example.com/store_abc/settings/imports+ price_list_id:+ type: string+ description: 'For `price_list_prices` imports: the price list the rows are+ merged into. Must belong to the current store; other types ignore it.'+ required:+ - type+ - attachment_signed_id+ IntegrationCreateParams:+ type: object+ properties:+ type:+ type: string+ description: Wire shorthand from the integration types endpoint.+ example: carrier+ active:+ type: boolean+ description: Activating runs the connection check, and a failed check is+ a 422.+ preferences:+ type: object+ additionalProperties: true+ description: Credential values. Secret preferences come back masked, and+ sending a masked value back keeps the stored secret.+ required:+ - type+ IntegrationUpdateParams:+ type: object+ properties:+ active:+ type: boolean+ description: Activating runs the connection check, and a failed check is+ a 422.+ preferences:+ type: object+ additionalProperties: true+ description: Credential values. Secret preferences come back masked, and+ sending a masked value back keeps the stored secret.+ InvitationAcceptParams:+ type: object+ properties:+ password:+ type: string+ description: 'Required when the invitee has no account yet: it creates one.+ An existing account signs in without it.'+ password_confirmation:+ type: string+ first_name:+ type: string+ last_name:+ type: string+ InvitationCreateParams:+ type: object+ properties:+ email:+ type: string+ role_id:+ type: string+ description: The role (`role_...`) the invitee gets on accepting.+ required:+ - role_id+ LineItemCreateParams:+ type: object+ properties:+ variant_id:+ type: string+ quantity:+ type: integer+ description: Defaults to 1 when adding an item.+ example: 1+ price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Negotiated unit price. Stamps the line `price_source: ''manual''`,+ so quantity changes and recalculation never re-price it; an explicit null+ reverts the line to catalog pricing. Omit to leave pricing alone. Draft+ (incomplete) orders only.'+ nullable: true+ options:+ type: object+ additionalProperties: true+ required:+ - variant_id+ LineItemUpdateParams:+ type: object+ properties:+ quantity:+ type: integer+ description: Defaults to 1 when adding an item.+ example: 1+ price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Negotiated unit price. Stamps the line `price_source: ''manual''`,+ so quantity changes and recalculation never re-price it; an explicit null+ reverts the line to catalog pricing. Omit to leave pricing alone. Draft+ (incomplete) orders only.'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ MarketCreateParams:+ type: object+ properties:+ name:+ type: string+ description: Display name, unique within the store.+ example: Europe+ currency:+ type: string+ description: ISO 4217 currency code.+ example: EUR+ default_locale:+ type: string+ description: Locale used as the market default. Always part of `supported_locales`.+ example: de+ tax_inclusive:+ type: boolean+ description: Display prices with tax included.+ tax_provider:+ type: string+ description: Shorthand of the tax engine that prices this market, from the+ tax providers endpoint. Null uses the installation default.+ example: internal+ nullable: true+ default:+ type: boolean+ description: Setting true demotes the previous default market of the store.+ position:+ type: integer+ description: Sort order within the store; lower comes first.+ supported_locales:+ type: array+ items:+ type: string+ description: Locales available in this market. The default locale is always+ included.+ example:+ - de+ - en+ country_codes:+ type: array+ items:+ type: string+ description: ISO 3166-1 alpha-2 codes of the countries in this market. At+ least one is required.+ example:+ - DE+ - FR+ required:+ - name+ - currency+ - default_locale+ - country_codes+ MarketUpdateParams:+ type: object+ properties:+ name:+ type: string+ description: Display name, unique within the store.+ example: Europe+ currency:+ type: string+ description: ISO 4217 currency code.+ example: EUR+ default_locale:+ type: string+ description: Locale used as the market default. Always part of `supported_locales`.+ example: de+ tax_inclusive:+ type: boolean+ description: Display prices with tax included.+ tax_provider:+ type: string+ description: Shorthand of the tax engine that prices this market, from the+ tax providers endpoint. Null uses the installation default.+ example: internal+ nullable: true+ default:+ type: boolean+ description: Setting true demotes the previous default market of the store.+ position:+ type: integer+ description: Sort order within the store; lower comes first.+ supported_locales:+ type: array+ items:+ type: string+ description: Locales available in this market. The default locale is always+ included.+ example:+ - de+ - en+ country_codes:+ type: array+ items:+ type: string+ description: ISO 3166-1 alpha-2 codes of the countries in this market. At+ least one is required.+ example:+ - DE+ - FR+ MeUpdateParams:+ type: object+ properties:+ selected_locale:+ type: string+ description: The dashboard display language.+ example: de+ first_name:+ type: string+ last_name:+ type: string+ avatar_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` to set the avatar, or null+ to remove it. Omit it to keep the current photo.+ nullable: true+ MediaCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ alt:+ type: string+ example: Front view+ nullable: true+ position:+ type: integer+ example: 1+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ description: Defaults to `image`. `video` needs a `signed_id`; `external_video`+ needs an `external_video_url`.+ example: image+ external_video_url:+ type: string+ description: YouTube or Vimeo link. Required when `media_type` is `external_video`.+ nullable: true+ poster_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for a video's poster frame.+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ attachment:+ type: string+ description: The file itself, sent as multipart form data. JSON clients+ upload first and send `signed_id`.+ url:+ type: string+ description: 'Fetch an image from this URL, in the background. Images only:+ an external video uses `external_video_url`.'+ signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the media file itself.+ source_media_id:+ type: string+ description: Place a file that is already in the library. The new row shares+ the source file rather than copying it, and takes its own alt, position+ and variant links from here.+ variant_ids:+ type: array+ items:+ type: string+ description: Variants to link this product-level media to. Variants of other+ products are dropped.+ MediaLibraryCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ alt:+ type: string+ example: Front view+ nullable: true+ position:+ type: integer+ example: 1+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ description: Defaults to `image`. `video` needs a `signed_id`; `external_video`+ needs an `external_video_url`.+ example: image+ external_video_url:+ type: string+ description: YouTube or Vimeo link. Required when `media_type` is `external_video`.+ nullable: true+ poster_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for a video's poster frame.+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ attachment:+ type: string+ description: The file itself, sent as multipart form data. JSON clients+ upload first and send `signed_id`.+ url:+ type: string+ description: 'Fetch an image from this URL, in the background. Images only:+ an external video uses `external_video_url`.'+ signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the media file itself.+ source_media_id:+ type: string+ description: Place a file that is already in the library. The new row shares+ the source file rather than copying it, and takes its own alt, position+ and variant links from here.+ variant_ids:+ type: array+ items:+ type: string+ description: Variants to link this product-level media to. Variants of other+ products are dropped.+ MediaLibraryUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ alt:+ type: string+ example: Front view+ nullable: true+ position:+ type: integer+ example: 1+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ description: Defaults to `image`. `video` needs a `signed_id`; `external_video`+ needs an `external_video_url`.+ example: image+ external_video_url:+ type: string+ description: YouTube or Vimeo link. Required when `media_type` is `external_video`.+ nullable: true+ poster_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for a video's poster frame.+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ attachment:+ type: string+ description: The file itself, sent as multipart form data. JSON clients+ upload first and send `signed_id`.+ url:+ type: string+ description: 'Fetch an image from this URL, in the background. Images only:+ an external video uses `external_video_url`.'+ signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the media file itself.+ source_media_id:+ type: string+ description: Place a file that is already in the library. The new row shares+ the source file rather than copying it, and takes its own alt, position+ and variant links from here.+ variant_ids:+ type: array+ items:+ type: string+ description: Variants to link this product-level media to. Variants of other+ products are dropped.+ MediaUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ alt:+ type: string+ example: Front view+ nullable: true+ position:+ type: integer+ example: 1+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ description: Defaults to `image`. `video` needs a `signed_id`; `external_video`+ needs an `external_video_url`.+ example: image+ external_video_url:+ type: string+ description: YouTube or Vimeo link. Required when `media_type` is `external_video`.+ nullable: true+ poster_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for a video's poster frame.+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ attachment:+ type: string+ description: The file itself, sent as multipart form data. JSON clients+ upload first and send `signed_id`.+ url:+ type: string+ description: 'Fetch an image from this URL, in the background. Images only:+ an external video uses `external_video_url`.'+ signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the media file itself.+ source_media_id:+ type: string+ description: Place a file that is already in the library. The new row shares+ the source file rather than copying it, and takes its own alt, position+ and variant links from here.+ variant_ids:+ type: array+ items:+ type: string+ description: Variants to link this product-level media to. Variants of other+ products are dropped.+ OptionTypeCreateParams:+ type: object+ properties:+ name:+ type: string+ example: color+ label:+ type: string+ example: Color+ position:+ type: integer+ filterable:+ type: boolean+ kind:+ type: string+ enum:+ - dropdown+ - color_swatch+ - buttons+ option_values:+ type: array+ items:+ "$ref": "#/components/schemas/OptionValueParams"+ description: Inline option values. Values left out of the list on update+ are destroyed, so send the full set every time.+ required:+ - name+ - label+ OptionTypeUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: color+ label:+ type: string+ example: Color+ position:+ type: integer+ filterable:+ type: boolean+ kind:+ type: string+ enum:+ - dropdown+ - color_swatch+ - buttons+ option_values:+ type: array+ items:+ "$ref": "#/components/schemas/OptionValueParams"+ description: Inline option values. Values left out of the list on update+ are destroyed, so send the full set every time.+ OptionValueParams:+ type: object+ properties:+ id:+ type: string+ description: Present for existing values. Omit to create a new one.+ name:+ type: string+ example: red+ label:+ type: string+ example: Red+ position:+ type: integer+ color_code:+ type: string+ description: Hex color. Only meaningful when the option type's `kind` is+ `color_swatch`.+ example: "#FF0000"+ nullable: true+ image_signed_id:+ type: string+ description: A `signed_id` from `files.upload()`, or null to remove the+ image.+ nullable: true+ OrderCancelParams:+ type: object+ properties:+ cancel_reason_id:+ type: string+ description: 'Why the order was canceled: the id of one of the store''s+ cancellation reasons.'+ cancel_note:+ type: string+ description: Staff-facing note about the cancellation.+ refund_payments:+ type: boolean+ description: Whether this order's share of a payment shared across a split+ checkout is handed back.+ refund_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: How much of that share to return. Defaults to all of it; refused+ on an order whose payment is not shared.+ notify_customer:+ type: boolean+ description: Send the order cancellation email after canceling.+ OrderCompleteParams:+ type: object+ properties:+ payment_pending:+ type: boolean+ notify_customer:+ type: boolean+ description: Send the order confirmation email after completion.+ OrderCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ email:+ type: string+ example: [email protected]+ customer_id:+ type: string+ use_customer_default_address:+ type: boolean+ description: With `customer_id`, copies the customer's saved billing and+ shipping addresses onto the order.+ currency:+ type: string+ example: USD+ market_id:+ type: string+ channel_id:+ type: string+ description: Defaults to the store primary channel when omitted.+ locale:+ type: string+ example: en-US+ customer_note:+ type: string+ description: Public, customer-visible note.+ internal_note:+ type: string+ description: Staff-only note. Rich text HTML; reads come back as this plus+ `internal_note_html`.+ po_number:+ type: string+ description: The buyer's own purchase-order reference. Searchable alongside+ the order number, and rendered on every order-facing document.+ po_document_signed_id:+ type: string+ description: 'The `signed_id` of the buyer''s purchase order, from `files.upload()`+ with `visibility: ''private''`. Null removes the document the order carries.'+ nullable: true+ shipping_address_id:+ type: string+ description: An existing address of the customer.+ billing_address_id:+ type: string+ description: An existing address of the customer.+ preferred_stock_location_id:+ type: string+ description: Stock location to prefer for fulfillment. Order Routing's built-in+ preferred-location rule ranks it first; routing falls back to the next+ rule when the location can't cover the cart.+ company_id:+ type: string+ description: Makes the order a company purchase, with that company's catalog+ prices and tax treatment. Null makes a draft a plain customer order again.+ nullable: true+ coupon_code:+ type: string+ description: 'Applied non-fatally: an invalid code does not block creation.'+ metadata:+ type: object+ additionalProperties: true+ tags:+ type: array+ items:+ type: string+ shipping_address:+ "$ref": "#/components/schemas/AddressInputParams"+ billing_address:+ "$ref": "#/components/schemas/AddressInputParams"+ items:+ type: array+ items:+ type: object+ properties:+ variant_id:+ type: string+ quantity:+ type: integer+ example: 1+ price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Negotiated unit price; stamps `price_source: ''manual''`.+ Null reverts the line to catalog pricing. Draft orders only.'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ required:+ - variant_id+ description: 'Line items to upsert, keyed by variant. An entry sets that+ variant''s quantity, creating the line item when the order has none; `quantity:+ 0` removes it. Variants you do not send are left alone.'+ OrderRoutingRuleCreateParams:+ type: object+ properties:+ type:+ type: string+ description: Wire shorthand for the rule kind, from the order routing rule+ types endpoint.+ example: preferred_location+ active:+ type: boolean+ position:+ type: integer+ description: 1-based priority in the channel's rule list. Omitted on create,+ the rule goes last; a new position reorders the rest of the list around+ it.+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's preference schema.+ required:+ - type+ OrderRoutingRuleUpdateParams:+ type: object+ properties:+ active:+ type: boolean+ position:+ type: integer+ description: 1-based priority in the channel's rule list. Omitted on create,+ the rule goes last; a new position reorders the rest of the list around+ it.+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's preference schema.+ OrderUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ email:+ type: string+ example: [email protected]+ customer_id:+ type: string+ currency:+ type: string+ example: USD+ market_id:+ type: string+ channel_id:+ type: string+ description: Defaults to the store primary channel when omitted.+ locale:+ type: string+ example: en-US+ customer_note:+ type: string+ description: Public, customer-visible note.+ internal_note:+ type: string+ description: Staff-only note. Rich text HTML; reads come back as this plus+ `internal_note_html`.+ po_number:+ type: string+ description: The buyer's own purchase-order reference. Searchable alongside+ the order number, and rendered on every order-facing document.+ po_document_signed_id:+ type: string+ description: 'The `signed_id` of the buyer''s purchase order, from `files.upload()`+ with `visibility: ''private''`. Null removes the document the order carries.'+ nullable: true+ preferred_stock_location_id:+ type: string+ description: Stock location to prefer for fulfillment. Order Routing's built-in+ preferred-location rule ranks it first; routing falls back to the next+ rule when the location can't cover the cart.+ company_id:+ type: string+ description: Makes the order a company purchase, with that company's catalog+ prices and tax treatment. Null makes a draft a plain customer order again.+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ tags:+ type: array+ items:+ type: string+ shipping_address:+ "$ref": "#/components/schemas/AddressInputParams"+ billing_address:+ "$ref": "#/components/schemas/AddressInputParams"+ items:+ type: array+ items:+ type: object+ properties:+ variant_id:+ type: string+ quantity:+ type: integer+ example: 1+ price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Negotiated unit price; stamps `price_source: ''manual''`.+ Null reverts the line to catalog pricing. Draft orders only.'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ required:+ - variant_id+ description: 'Line items to upsert, keyed by variant. An entry sets that+ variant''s quantity, creating the line item when the order has none; `quantity:+ 0` removes it. Variants you do not send are left alone.'+ PackageTypeCreateParams:+ type: object+ properties:+ name:+ type: string+ description: Unique within the store.+ example: Euro pallet+ kind:+ type: string+ enum:+ - box+ - envelope+ - carton+ - pallet+ - container+ description: 'What this packaging is: the box parcels ship in, or the carton,+ pallet or container a wholesale order leaves on.'+ example: pallet+ length:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ description: Unit the three dimensions are in; falls back to the store's+ unit system.+ example: cm+ nullable: true+ weight:+ type: number+ description: The empty package's own weight, added to content weight on+ every quote.+ nullable: true+ max_weight:+ type: number+ description: What the package can hold, not the same as its own weight.+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ example: kg+ nullable: true+ default:+ type: boolean+ description: The box every parcel quote is built on. Setting this demotes+ whichever row held it.+ metadata:+ type: object+ additionalProperties: true+ required:+ - name+ - kind+ PackageTypeUpdateParams:+ type: object+ properties:+ name:+ type: string+ description: Unique within the store.+ example: Euro pallet+ kind:+ type: string+ enum:+ - box+ - envelope+ - carton+ - pallet+ - container+ description: 'What this packaging is: the box parcels ship in, or the carton,+ pallet or container a wholesale order leaves on.'+ example: pallet+ length:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ description: Unit the three dimensions are in; falls back to the store's+ unit system.+ example: cm+ nullable: true+ weight:+ type: number+ description: The empty package's own weight, added to content weight on+ every quote.+ nullable: true+ max_weight:+ type: number+ description: What the package can hold, not the same as its own weight.+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ example: kg+ nullable: true+ default:+ type: boolean+ description: The box every parcel quote is built on. Setting this demotes+ whichever row held it.+ metadata:+ type: object+ additionalProperties: true+ PasswordResetParams:+ type: object+ properties:+ password:+ type: string+ password_confirmation:+ type: string+ required:+ - password+ - password_confirmation+ PasswordResetRequestParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ redirect_url:+ type: string+ description: The page the emailed reset link points at, with the reset token+ appended. Honored only on the dashboard origin, for an account that is+ staff of the store; ignored otherwise.+ example: https://admin.your-store.com/reset-password+ required:+ PaymentCaptureParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Captures part of the authorized amount. Defaults to all of+ it.+ PaymentCreateParams:+ type: object+ properties:+ payment_method_id:+ type: string+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the order total left after store credit.+ source_id:+ type: string+ description: A saved payment source of the order's customer (a credit card),+ for an off-session charge. Used only by payment methods that require a+ source.+ required:+ - payment_method_id+ PaymentMethodCreateParams:+ type: object+ properties:+ type:+ type: string+ description: Wire shorthand from the payment method types endpoint.+ example: check+ name:+ type: string+ description:+ type: string+ nullable: true+ active:+ type: boolean+ storefront_visible:+ type: boolean+ description: False keeps the method to the dashboard; true also offers it+ on the storefront.+ auto_capture:+ type: boolean+ description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ nullable: true+ capture_method:+ type: string+ enum:+ - checkout+ - on_dispatch+ - manual+ description: When customers are charged for this method. Null inherits the+ store setting.+ nullable: true+ position:+ type: integer+ metadata:+ type: object+ additionalProperties: true+ preferences:+ type: object+ additionalProperties: true+ description: Values for the provider's preference schema, from the payment+ method types endpoint.+ required:+ - type+ - name+ PaymentMethodUpdateParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ active:+ type: boolean+ storefront_visible:+ type: boolean+ description: False keeps the method to the dashboard; true also offers it+ on the storefront.+ auto_capture:+ type: boolean+ description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ nullable: true+ capture_method:+ type: string+ enum:+ - checkout+ - on_dispatch+ - manual+ description: When customers are charged for this method. Null inherits the+ store setting.+ nullable: true+ position:+ type: integer+ metadata:+ type: object+ additionalProperties: true+ preferences:+ type: object+ additionalProperties: true+ description: Values for the provider's preference schema, from the payment+ method types endpoint.+ PolicyCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Wholesale Policy+ slug:+ type: string+ example: wholesale-policy+ body:+ type: string+ example: "<p>Trade orders ship within five working days.</p>"+ nullable: true+ required:+ - name+ PolicyUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Wholesale Policy+ slug:+ type: string+ example: wholesale-policy+ body:+ type: string+ example: "<p>Trade orders ship within five working days.</p>"+ nullable: true+ PriceAdjustmentTierParams:+ type: object+ properties:+ min_quantity:+ type: integer+ description: Above 1; quantity 1 is the list's own `price_adjustment_percentage`.+ example: 10+ percentage:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Signed: negative discounts, positive marks up.'+ example: "-10.0"+ required:+ - min_quantity+ - percentage+ PriceBulkDestroyParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ example:+ - price_aBc123+ required:+ - ids+ PriceBulkUpsertParams:+ type: object+ properties:+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceBulkUpsertRowParams"+ description: Send an empty list to change nothing.+ required:+ - prices+ PriceBulkUpsertRowParams:+ type: object+ properties:+ id:+ type: string+ description: 'Present: updates that row. Absent: upserts on `(variant_id,+ currency, price_list_id, min_quantity)`.'+ example: price_aBc123+ nullable: true+ variant_id:+ type: string+ example: variant_xY9+ currency:+ type: string+ example: USD+ price_list_id:+ type: string+ description: Omit or null for a base price.+ example: pl_aBc123+ nullable: true+ min_quantity:+ type: integer+ description: The rung of the variant's ladder. Omit for the bottom rung;+ anything above 1 requires a `price_list_id`. A variant carries at most+ ten rungs on one list per currency.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ required:+ - variant_id+ - currency+ PriceCreateParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_xY9+ currency:+ type: string+ example: USD+ min_quantity:+ type: integer+ description: The quantity a line must reach for this price to apply. Omit+ for the bottom rung of the ladder. Anything above 1 requires a `price_list_id`.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ price_list_id:+ type: string+ description: Omit or null for a base price; a price list for a list override.+ example: pl_aBc123+ nullable: true+ required:+ - variant_id+ - currency+ PriceListCreateParams:+ type: object+ properties:+ name:+ type: string+ example: EU wholesale+ description:+ type: string+ nullable: true+ position:+ type: integer+ example: 1+ starts_at:+ type: string+ format: date-time+ description: 'Pair with `ends_at` to schedule the list: activating a list+ whose start is in the future marks it `scheduled`.'+ example: '2026-06-01T00:00:00Z'+ nullable: true+ ends_at:+ type: string+ format: date-time+ example: '2026-09-01T00:00:00Z'+ nullable: true+ match_policy:+ type: string+ enum:+ - all+ - any+ description: "`all`: every rule must match. `any`: one matching rule is+ enough."+ example: all+ price_adjustment_percentage:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Signed: negative discounts off base prices, positive marks+ up.'+ example: "-15.0"+ nullable: true+ adjust_compare_at:+ type: boolean+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListRuleParams"+ description: 'The complete rule set: rules are matched by `id` and updated,+ new ones are built, and rules left out are removed.'+ price_adjustment_tiers:+ type: array+ items:+ "$ref": "#/components/schemas/PriceAdjustmentTierParams"+ description: 'Quantity bands on the list''s percentage. The payload is the+ whole ladder: a band left out is removed.'+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListPriceOverrideParams"+ description: Per-variant price overrides. Each row upserts, so the variants+ it names become part of the list. Curating whole products goes through+ the nested products endpoint instead.+ required:+ - name+ PriceListPriceOverrideParams:+ type: object+ properties:+ id:+ type: string+ description: Updates this price row. Without it, the row upserts on `(variant_id,+ currency, min_quantity)`.+ variant_id:+ type: string+ example: variant_xY9+ currency:+ type: string+ example: USD+ min_quantity:+ type: integer+ description: The rung of the variant's ladder. Omit for the bottom rung.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ PriceListRuleParams:+ type: object+ properties:+ id:+ type: string+ description: Present for existing rules. Omit to create a new one.+ nullable: true+ type:+ type: string+ description: Wire shorthand for the rule kind, from the price rule types+ endpoint.+ example: volume_rule+ preferences:+ type: object+ additionalProperties: true+ description: The rule kind's settings, keyed by preference name.+ required:+ - type+ PriceListUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: EU wholesale+ description:+ type: string+ nullable: true+ position:+ type: integer+ example: 1+ starts_at:+ type: string+ format: date-time+ description: 'Pair with `ends_at` to schedule the list: activating a list+ whose start is in the future marks it `scheduled`.'+ example: '2026-06-01T00:00:00Z'+ nullable: true+ ends_at:+ type: string+ format: date-time+ example: '2026-09-01T00:00:00Z'+ nullable: true+ match_policy:+ type: string+ enum:+ - all+ - any+ description: "`all`: every rule must match. `any`: one matching rule is+ enough."+ example: all+ price_adjustment_percentage:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'Signed: negative discounts off base prices, positive marks+ up.'+ example: "-15.0"+ nullable: true+ adjust_compare_at:+ type: boolean+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListRuleParams"+ description: 'The complete rule set: rules are matched by `id` and updated,+ new ones are built, and rules left out are removed.'+ price_adjustment_tiers:+ type: array+ items:+ "$ref": "#/components/schemas/PriceAdjustmentTierParams"+ description: 'Quantity bands on the list''s percentage. The payload is the+ whole ladder: a band left out is removed.'+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceListPriceOverrideParams"+ description: Per-variant price overrides. Each row upserts, so the variants+ it names become part of the list. Curating whole products goes through+ the nested products endpoint instead.+ PriceParams:+ type: object+ properties:+ currency:+ type: string+ example: USD+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'A canonical decimal string (`"1234.56"`: period decimal, no+ grouping). The API does not parse localized input.'+ example: '29.99'+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '39.99'+ nullable: true+ required:+ - currency+ - amount+ PriceUpdateParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_xY9+ currency:+ type: string+ example: USD+ min_quantity:+ type: integer+ description: The quantity a line must reach for this price to apply. Omit+ for the bottom rung of the ladder. Anything above 1 requires a `price_list_id`.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '19.99'+ nullable: true+ price_list_id:+ type: string+ description: Omit or null for a base price; a price list for a list override.+ example: pl_aBc123+ nullable: true+ ProductBulkCategoriesParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ category_ids:+ type: array+ items:+ type: string+ required:+ - ids+ - category_ids+ ProductBulkChannelsParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ channel_ids:+ type: array+ items:+ type: string+ required:+ - ids+ - channel_ids+ ProductBulkCollectionsParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ collection_ids:+ type: array+ items:+ type: string+ required:+ - ids+ - collection_ids+ ProductBulkDestroyParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ description: Products the caller cannot delete are skipped.+ required:+ - ids+ ProductBulkStatusParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ example:+ - prod_UkLWZg9DAJ+ status:+ type: string+ enum:+ - draft+ - active+ - archived+ description: Products in review are skipped and counted in `skipped_in_review_count`.+ required:+ - ids+ - status+ ProductCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Premium T-Shirt+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ slug:+ type: string+ status:+ type: string+ enum:+ - draft+ - active+ - archived+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ tax_category_id:+ type: string+ product_type_id:+ type: string+ description: The product type this product is created from (`pt_...`). Its+ option types and categories seed onto the product and its custom field+ definitions drive the product form. Editing the type later never rewrites+ existing products.+ nullable: true+ delivery_profile_id:+ type: string+ description: The delivery profile deciding how this product ships (`fp_...`);+ null falls back to the store default.+ nullable: true+ promotionable:+ type: boolean+ tags:+ type: array+ items:+ type: string+ example:+ - eco+ - sale+ category_ids:+ type: array+ items:+ type: string+ collection_ids:+ type: array+ items:+ type: string+ description: Manual collections this product belongs to. Automatic collections+ are kept as they are, since their rules decide membership.+ metadata:+ type: object+ additionalProperties: true+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceParams"+ 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. Don''t pass+ both.'+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ media:+ type: array+ items:+ "$ref": "#/components/schemas/ProductMediaParams"+ description: Media written with the product. Entries with `id` update an+ existing asset; entries with `signed_id` attach a fresh upload; an external+ video needs only its URL.+ digital_assets:+ type: array+ items:+ "$ref": "#/components/schemas/ProductDigitalAssetParams"+ description: Downloadable files written with the product. Each entry carries+ a `signed_id` (an upload to private storage) or a `provider_type` (a provider-backed+ asset), and attaches to the default variant unless `variant_id` is given.+ An `id` updates that asset in place, so replaying the list does not duplicate+ it; removal uses the nested digital assets endpoint.+ product_publications:+ type: array+ items:+ "$ref": "#/components/schemas/ProductPublicationParams"+ variants:+ type: array+ items:+ "$ref": "#/components/schemas/ProductVariantParams"+ description: Every purchasable attribute (sku, prices, stock, weight, dimensions)+ lives on variants. An entry without `options` upserts onto the default+ variant of a simple product; pass `id` to update an existing variant.+ required:+ - name+ ProductDigitalAssetParams:+ type: object+ properties:+ id:+ type: string+ signed_id:+ type: string+ variant_id:+ type: string+ provider_type:+ type: string+ description: A provider shorthand from the digital asset providers endpoint.+ provider_settings:+ type: object+ additionalProperties: true+ description: Values for the provider's settings schema, keyed by field name.+ authorized_clicks:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ authorized_days:+ type: integer+ description: Null means the store's download settings apply.+ nullable: true+ ProductMediaParams:+ type: object+ properties:+ id:+ type: string+ signed_id:+ type: string+ description: A `signed_id` from `files.upload()`.+ source_media_id:+ type: string+ description: Copies an asset from the media library.+ alt:+ type: string+ nullable: true+ position:+ type: integer+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ external_video_url:+ type: string+ nullable: true+ poster_signed_id:+ type: string+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ variant_ids:+ type: array+ items:+ type: string+ description: Replaces the variants this media is linked to. An empty list+ clears them.+ ProductMembershipParams:+ type: object+ properties:+ product_ids:+ type: array+ items:+ type: string+ description: Products from other stores, or ones the caller cannot see,+ are ignored.+ example:+ - prod_abc123+ required:+ - product_ids+ ProductMembershipRepositionParams:+ type: object+ properties:+ new_position:+ type: integer+ description: 0-based index among the parent's products.+ example: 0+ required:+ - new_position+ ProductPublicationParams:+ type: object+ properties:+ id:+ type: string+ channel_id:+ type: string+ published_at:+ type: string+ format: date-time+ nullable: true+ unpublished_at:+ type: string+ format: date-time+ nullable: true+ ProductRejectParams:+ type: object+ properties:+ reason:+ type: string+ description: Why the submission was turned down. Sent back to the seller.+ ProductTypeCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Hoodie+ delivery_profile_id:+ type: string+ description: Delivery profile stamped onto products created with this type.+ Null leaves new products on the store default profile.+ example: fp_86Rf07xd4z+ nullable: true+ option_type_ids:+ type: array+ items:+ type: string+ description: Option types seeded onto products that get this type. Use apply+ to products to backfill existing ones.+ category_ids:+ type: array+ items:+ type: string+ description: Categories seeded onto products that get this type. Categories+ from other stores are ignored.+ custom_field_definitions:+ type: array+ items:+ "$ref": "#/components/schemas/ProductTypeCustomFieldDefinitionParams"+ description: The custom field definitions the product form shows. Definitions+ not listed are removed from the type.+ required:+ - name+ ProductTypeCustomFieldDefinitionParams:+ type: object+ properties:+ id:+ type: string+ description: The custom field definition.+ example: cfdef_abc123+ required:+ type: boolean+ sort_order:+ type: integer+ required:+ - id+ ProductTypeUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Hoodie+ delivery_profile_id:+ type: string+ description: Delivery profile stamped onto products created with this type.+ Null leaves new products on the store default profile.+ example: fp_86Rf07xd4z+ nullable: true+ option_type_ids:+ type: array+ items:+ type: string+ description: Option types seeded onto products that get this type. Use apply+ to products to backfill existing ones.+ category_ids:+ type: array+ items:+ type: string+ description: Categories seeded onto products that get this type. Categories+ from other stores are ignored.+ custom_field_definitions:+ type: array+ items:+ "$ref": "#/components/schemas/ProductTypeCustomFieldDefinitionParams"+ description: The custom field definitions the product form shows. Definitions+ not listed are removed from the type.+ ProductUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Premium T-Shirt+ description:+ type: string+ description: Rich text HTML. Reads come back as this (plain text) plus `description_html`.+ slug:+ type: string+ status:+ type: string+ enum:+ - draft+ - active+ - archived+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ tax_category_id:+ type: string+ product_type_id:+ type: string+ description: The product type this product is created from (`pt_...`). Its+ option types and categories seed onto the product and its custom field+ definitions drive the product form. Editing the type later never rewrites+ existing products.+ nullable: true+ delivery_profile_id:+ type: string+ description: The delivery profile deciding how this product ships (`fp_...`);+ null falls back to the store default.+ nullable: true+ promotionable:+ type: boolean+ tags:+ type: array+ items:+ type: string+ example:+ - eco+ - sale+ category_ids:+ type: array+ items:+ type: string+ collection_ids:+ type: array+ items:+ type: string+ description: Manual collections this product belongs to. Automatic collections+ are kept as they are, since their rules decide membership.+ metadata:+ type: object+ additionalProperties: true+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceParams"+ 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. Don''t pass+ both.'+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ media:+ type: array+ items:+ "$ref": "#/components/schemas/ProductMediaParams"+ description: Media written with the product. Entries with `id` update an+ existing asset; entries with `signed_id` attach a fresh upload; an external+ video needs only its URL.+ digital_assets:+ type: array+ items:+ "$ref": "#/components/schemas/ProductDigitalAssetParams"+ description: Downloadable files written with the product. Each entry carries+ a `signed_id` (an upload to private storage) or a `provider_type` (a provider-backed+ asset), and attaches to the default variant unless `variant_id` is given.+ An `id` updates that asset in place, so replaying the list does not duplicate+ it; removal uses the nested digital assets endpoint.+ product_publications:+ type: array+ items:+ "$ref": "#/components/schemas/ProductPublicationParams"+ variants:+ type: array+ items:+ "$ref": "#/components/schemas/ProductVariantParams"+ description: Every purchasable attribute (sku, prices, stock, weight, dimensions)+ lives on variants. An entry without `options` upserts onto the default+ variant of a simple product; pass `id` to update an existing variant.+ ProductVariantParams:+ type: object+ properties:+ id:+ type: string+ sku:+ type: string+ barcode:+ type: string+ cost_price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ cost_currency:+ type: string+ weight:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ depth:+ type: number+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ hs_code:+ type: string+ country_of_origin:+ type: string+ customs_description:+ type: string+ minimum_order_quantity:+ type: integer+ nullable: true+ order_multiple:+ type: integer+ nullable: true+ purchase_unit:+ type: string+ units_per_carton:+ type: integer+ description: How many units fill one carton.+ nullable: true+ carton_package_type_id:+ type: string+ description: 'The carton this variant is packed into: a package type of+ kind `carton`. Its dimensions are shared by every product packed the same+ way, so a corrected carton size fixes all of them at once.'+ nullable: true+ carton_weight:+ type: number+ description: What one packed carton weighs, in the variant's weight unit.+ nullable: true+ cartons_per_pallet:+ type: integer+ description: How many cartons stack on one pallet.+ nullable: true+ seller_id:+ type: string+ delivery_profile_id:+ type: string+ nullable: true+ track_inventory:+ type: boolean+ preorderable:+ type: boolean+ description: Sell this variant before it's in stock. Adds the pre-order+ label and ships-by promise; the cap comes from `backorder_limit`, an incoming+ stock count, or backorder.+ preorder_ships_at:+ type: string+ format: date-time+ description: The "ships by" date shown to customers while the variant is+ a pre-order. Once it passes, the variant is no longer a pre-order. Null+ clears it.+ nullable: true+ backorder_limit:+ type: integer+ description: Maximum units sellable beyond available stock, capping backorders+ and pre-orders. Null is unlimited.+ nullable: true+ tax_category_id:+ type: string+ position:+ type: integer+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceParams"+ description: Per-currency prices. Upserted by currency.+ stock_levels:+ type: array+ items:+ "$ref": "#/components/schemas/StockLevelParams"+ description: Stock per location. Upserted by location; omitted locations+ are removed.+ options:+ type: array+ items:+ "$ref": "#/components/schemas/VariantOptionParams"+ description: One pair per option type the variant takes part in (size, color).+ Option types and values are created when missing.+ PromotionActionCalculatorParams:+ type: object+ properties:+ type:+ type: string+ description: The calculator kind, from `GET /promotion_actions/calculators`.+ Changing it swaps the calculator.+ example: flat_percent_item_total+ preferences:+ type: object+ additionalProperties: true+ description: Values for the calculator's settings, such as `amount` or `flat_percent`.+ PromotionActionCreateParams:+ type: object+ properties:+ type:+ type: string+ description: The action kind, from `GET /promotion_actions/types`.+ example: free_shipping+ preferences:+ type: object+ additionalProperties: true+ description: Values for the action kind's settings schema, from `GET /promotion_actions/types`.+ calculator:+ allOf:+ - "$ref": "#/components/schemas/PromotionActionCalculatorParams"+ description: For adjustment actions.+ line_items:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionActionLineItemParams"+ description: 'For `create_line_items`: the variants to add and their quantities.+ Variants left out are removed.'+ required:+ - type+ PromotionActionDraftParams:+ type: object+ properties:+ id:+ type: string+ type:+ type: string+ description: The action kind, from `GET /promotion_actions/types`.+ example: free_shipping+ preferences:+ type: object+ additionalProperties: true+ description: Values for the action kind's settings schema, from `GET /promotion_actions/types`.+ calculator:+ allOf:+ - "$ref": "#/components/schemas/PromotionActionCalculatorParams"+ description: For adjustment actions.+ line_items:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionActionLineItemParams"+ description: 'For `create_line_items`: the variants to add and their quantities.+ Variants left out are removed.'+ required:+ - type+ PromotionActionLineItemParams:+ type: object+ properties:+ variant_id:+ type: string+ quantity:+ type: integer+ required:+ - variant_id+ - quantity+ PromotionActionUpdateParams:+ type: object+ properties:+ preferences:+ type: object+ additionalProperties: true+ description: Values for the action kind's settings schema, from `GET /promotion_actions/types`.+ calculator:+ allOf:+ - "$ref": "#/components/schemas/PromotionActionCalculatorParams"+ description: For adjustment actions.+ line_items:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionActionLineItemParams"+ description: 'For `create_line_items`: the variants to add and their quantities.+ Variants left out are removed.'+ PromotionCreateParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ code:+ type: string+ description: Required for single-code coupon promotions. Ignored when `multi_codes`+ is true.+ nullable: true+ path:+ 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+ description: "`coupon_code` needs a code (or `multi_codes`); `automatic`+ applies without one."+ multi_codes:+ type: boolean+ description: Generates `number_of_codes` codes starting with `code_prefix`.+ number_of_codes:+ type: integer+ nullable: true+ code_prefix:+ type: string+ nullable: true+ promotion_category_id:+ type: string+ nullable: true+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionRuleDraftParams"+ description: 'The rules the promotion should have: entries with `id` update,+ entries without are created, and rules left out are removed.'+ actions:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionActionDraftParams"+ description: The actions the promotion should have, matched the same way+ as `rules`.+ required:+ - name+ PromotionRuleCreateParams:+ type: object+ properties:+ type:+ type: string+ description: The rule kind, from `GET /promotion_rules/types`.+ example: currency+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's settings schema, from `GET /promotion_rules/types`.+ product_ids:+ type: array+ items:+ type: string+ description: For the `product` rule.+ category_ids:+ type: array+ items:+ type: string+ description: For the `category` rule.+ customer_ids:+ type: array+ items:+ type: string+ description: 'For the `user` rule: the customers who qualify.'+ required:+ - type+ PromotionRuleDraftParams:+ type: object+ properties:+ id:+ type: string+ type:+ type: string+ description: The rule kind, from `GET /promotion_rules/types`.+ example: currency+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's settings schema, from `GET /promotion_rules/types`.+ product_ids:+ type: array+ items:+ type: string+ description: For the `product` rule.+ category_ids:+ type: array+ items:+ type: string+ description: For the `category` rule.+ customer_ids:+ type: array+ items:+ type: string+ description: 'For the `user` rule: the customers who qualify.'+ required:+ - type+ PromotionRuleUpdateParams:+ type: object+ properties:+ preferences:+ type: object+ additionalProperties: true+ description: Values for the rule kind's settings schema, from `GET /promotion_rules/types`.+ product_ids:+ type: array+ items:+ type: string+ description: For the `product` rule.+ category_ids:+ type: array+ items:+ type: string+ description: For the `category` rule.+ customer_ids:+ type: array+ items:+ type: string+ description: 'For the `user` rule: the customers who qualify.'+ PromotionUpdateParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ code:+ type: string+ description: Required for single-code coupon promotions. Ignored when `multi_codes`+ is true.+ nullable: true+ path:+ 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+ description: "`coupon_code` needs a code (or `multi_codes`); `automatic`+ applies without one."+ multi_codes:+ type: boolean+ description: Generates `number_of_codes` codes starting with `code_prefix`.+ number_of_codes:+ type: integer+ nullable: true+ code_prefix:+ type: string+ nullable: true+ promotion_category_id:+ type: string+ nullable: true+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionRuleDraftParams"+ description: 'The rules the promotion should have: entries with `id` update,+ entries without are created, and rules left out are removed.'+ actions:+ type: array+ items:+ "$ref": "#/components/schemas/PromotionActionDraftParams"+ description: The actions the promotion should have, matched the same way+ as `rules`.+ PurchaseOrderCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: Appended to the order's notes.+ example: Supplier went under+ PurchaseOrderCreateParams:+ type: object+ properties:+ supplier_id:+ type: string+ example: sup_1234567890+ destination_location_id:+ type: string+ example: sloc_1234567890+ currency:+ type: string+ description: Defaults to the store's currency; set it for a foreign-currency+ order.+ example: USD+ nullable: true+ expected_at:+ type: string+ format: date+ description: The day the supplier promised. `null` clears it.+ example: '2026-10-01'+ nullable: true+ cancel_by:+ type: string+ format: date+ description: The day after which the goods are no longer wanted. `null`+ clears it.+ nullable: true+ reference:+ type: string+ description: The supplier's own order number. `null` clears it.+ nullable: true+ notes:+ type: string+ nullable: true+ items:+ type: array+ items:+ "$ref": "#/components/schemas/PurchaseOrderItemParams"+ description: Sending the list replaces whatever the order currently holds.+ required:+ - supplier_id+ - destination_location_id+ PurchaseOrderItemParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_1234567890+ quantity_ordered:+ type: integer+ example: 100+ unit_cost:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: What the merchant agreed to pay per unit.+ example: '12.50'+ required:+ - variant_id+ - quantity_ordered+ PurchaseOrderUpdateParams:+ type: object+ properties:+ supplier_id:+ type: string+ example: sup_1234567890+ destination_location_id:+ type: string+ example: sloc_1234567890+ currency:+ type: string+ description: Defaults to the store's currency; set it for a foreign-currency+ order.+ example: USD+ nullable: true+ expected_at:+ type: string+ format: date+ description: The day the supplier promised. `null` clears it.+ example: '2026-10-01'+ nullable: true+ cancel_by:+ type: string+ format: date+ description: The day after which the goods are no longer wanted. `null`+ clears it.+ nullable: true+ reference:+ type: string+ description: The supplier's own order number. `null` clears it.+ nullable: true+ notes:+ type: string+ nullable: true+ items:+ type: array+ items:+ "$ref": "#/components/schemas/PurchaseOrderItemParams"+ description: Sending the list replaces whatever the order currently holds.+ metadata:+ type: object+ additionalProperties: true+ nullable: true+ ReasonCreateParams:+ type: object+ properties:+ name:+ type: string+ active:+ type: boolean+ description: Whether the reason is offered on new records.+ required:+ - name+ ReasonUpdateParams:+ type: object+ properties:+ name:+ type: string+ active:+ type: boolean+ description: Whether the reason is offered on new records.+ ReceivableCloseParams:+ type: object+ properties:+ reason:+ type: string+ description: Why the balance is not coming.+ nullable: true+ RefundCreateParams:+ type: object+ properties:+ payment_id:+ type: string+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ refund_reason_id:+ type: string+ description: Defaults to the store's first refund reason.+ required:+ - payment_id+ - amount+ ReportingQueryParams:+ type: object+ properties:+ metrics:+ type: array+ items:+ type: string+ description: Registered metric names, from the reporting schema endpoint.+ dimensions:+ type: array+ items: {}+ description: 'Up to 2 dimensions to break the metrics down by. Each is a+ dimension name, or `{ name, grain, include_empty }`: `grain` (`hour`,+ `day`, `week`, `month`) buckets a time dimension, and `include_empty`+ lists members with no matching rows where the schema entry supports it.'+ filters:+ type: array+ items:+ type: object+ properties:+ dimension:+ type: string+ op:+ type: string+ enum:+ - eq+ - in+ value:+ description: One value for `eq`, a list for `in`.+ required:+ - dimension+ - op+ - value+ description: Narrows the rows by dimension value.+ metric_filters:+ type: array+ items:+ type: object+ properties:+ metric:+ type: string+ op:+ type: string+ enum:+ - eq+ - gt+ - gte+ - lt+ - lte+ value:+ type: number+ required:+ - metric+ - op+ - value+ description: Filters on an aggregate, such as `units_sold = 0`. Narrows+ the rows only; the totals stay the period's real figure. The metric must+ also appear in `metrics`, and cannot be a derived one.+ time_range:+ type: object+ properties:+ preset:+ type: string+ since:+ type: string+ until:+ type: string+ description: A named preset (`last_month`, `week_to_date`, any `last_<n>_<days|weeks|months>`),+ or ISO 8601 dates or times in `since` and `until` (a bare date covers+ the store's whole day). Defaults to the last 30 days, in the store's time+ zone.+ compare:+ type: string+ enum:+ - previous_period+ - previous_year+ sort:+ type: string+ description: A metric name; prefix it with `-` to sort descending.+ limit:+ type: integer+ description: At most 1000.+ currency:+ type: string+ required:+ - metrics+ ReturnCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the return was canceled.+ ReturnCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ fulfillment_item_id:+ type: string+ quantity:+ type: integer+ required:+ - fulfillment_item_id+ - quantity+ description: Fulfilled units coming back, and how many of each.+ stock_location_id:+ type: string+ description: Where the goods come back to. Defaults to the location that+ shipped them.+ reason_id:+ type: string+ description: One of the store's return reasons.+ memo:+ type: string+ required:+ - items+ ReturnReceiveParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ return_line_item_id:+ type: string+ quantity:+ type: integer+ resellable:+ type: boolean+ description: Goods that cannot be resold are received but never restocked.+ Defaults to true.+ required:+ - return_line_item_id+ - quantity+ description: What actually arrived. Omit to receive everything as requested+ and resellable; send rows for a partial or damaged receipt.+ ReturnRefundParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the value of what was actually received.+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: "`store_credit` issues credit immediately; `original_payment`+ (the default) refunds through the gateway that took the money."+ ReturnUpdateParams:+ type: object+ properties:+ stock_location_id:+ type: string+ description: Where the goods come back to. Defaults to the location that+ shipped them.+ reason_id:+ type: string+ description: One of the store's return reasons.+ memo:+ type: string+ metadata:+ type: object+ additionalProperties: true+ RoleCreateParams:+ type: object+ properties:+ name:+ type: string+ description: Unique role name, the machine identifier shown capitalized+ in the dashboard.+ example: order_manager+ description:+ type: string+ example: Handles daily orders+ nullable: true+ permissions:+ type: array+ items:+ type: string+ description: Permission keys (`read_orders`, `write_products`, ...) from+ the permissions endpoint. You can only grant keys you hold yourself.+ example:+ - write_orders+ - read_customers+ required:+ - name+ RoleUpdateParams:+ type: object+ properties:+ name:+ type: string+ description: Unique role name, the machine identifier shown capitalized+ in the dashboard.+ example: order_manager+ description:+ type: string+ example: Handles daily orders+ nullable: true+ permissions:+ type: array+ items:+ type: string+ description: Permission keys (`read_orders`, `write_products`, ...) from+ the permissions endpoint. You can only grant keys you hold yourself.+ example:+ - write_orders+ - read_customers+ SavedReportCreateParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ query:+ type: object+ additionalProperties: true+ description: A reporting query, validated against the reporting registry+ on save.+ required:+ - name+ - query+ SavedReportUpdateParams:+ type: object+ properties:+ name:+ type: string+ description:+ type: string+ nullable: true+ query:+ type: object+ additionalProperties: true+ description: A reporting query, validated against the reporting registry+ on save.+ SellerAddressParams:+ type: object+ properties:+ first_name:+ type: string+ example: Ada+ last_name:+ type: string+ example: Lovelace+ company:+ type: string+ example: Sparks Audio Ltd+ address1:+ type: string+ example: 1 Seller Way+ address2:+ type: string+ example: Unit 4+ city:+ type: string+ example: London+ postal_code:+ type: string+ example: EC1A 1BB+ zipcode:+ type: string+ phone:+ type: string+ example: "+44 20 7946 0000"+ country_code:+ type: string+ example: GB+ state_code:+ type: string+ state_name:+ type: string+ label:+ type: string+ example: Head office+ SellerApproveParams:+ type: object+ properties:+ override_requirements:+ type: boolean+ description: 'Admits a seller whose onboarding checklist is unfinished:+ the operator''s deliberate exception, which the `seller.approved` event+ records along with what was outstanding.'+ SellerCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Northwind Books+ slug:+ type: string+ description: URL-safe slug, derived from the name when omitted.+ example: northwind-books+ contact_email:+ type: string+ example: [email protected]+ nullable: true+ billing_email:+ type: string+ example: [email protected]+ nullable: true+ about:+ type: string+ description: 'Sanitized HTML: the seller''s public description.'+ example: "<p>Independent bookshop.</p>"+ nullable: true+ logo_signed_id:+ type: string+ description: A `signed_id` from the files upload endpoint to set the image,+ `null` to remove it, or omit the key to leave it untouched. The same applies+ to `square_logo_signed_id` and `cover_photo_signed_id`.+ nullable: true+ square_logo_signed_id:+ type: string+ nullable: true+ cover_photo_signed_id:+ type: string+ nullable: true+ tax_remittance:+ type: string+ enum:+ - seller+ - platform+ example: seller+ payouts_schedule_interval:+ type: string+ enum:+ - daily+ - weekly+ - biweekly+ - monthly+ - manual+ nullable: true+ minimum_payout_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '25.0'+ nullable: true+ holiday_mode_until:+ type: string+ format: date-time+ description: 'Set while the seller is away: the catalog stays but stops+ selling.'+ nullable: true+ legal_name:+ type: string+ nullable: true+ registration_number:+ type: string+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ billing_address:+ allOf:+ - "$ref": "#/components/schemas/SellerAddressParams"+ description: 'The seller''s own billing 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.'+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ required:+ - name+ SellerInviteParams:+ type: object+ properties:+ email:+ type: string+ example: [email protected]+ role_id:+ type: string+ description: A role this seller owns; defaults to the seller's own admin+ role.+ example: role_UkLWZg9DAJ+ nullable: true+ required:+ SellerPayoutCompleteParams:+ type: object+ properties:+ reference:+ type: string+ description: The provider's own id for the settlement, when one made it.+ example: TRF-8842+ SellerRejectParams:+ type: object+ properties:+ reason:+ type: string+ example: Incomplete paperwork+ SellerReopenOnboardingParams:+ type: object+ properties:+ note:+ type: string+ description: What the seller has to fix.+ SellerRequirementCreateParams:+ type: object+ properties:+ type:+ type: string+ description: The kind, from the seller requirement types endpoint.+ example: document+ 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.+ example: Business registration+ description:+ type: string+ description: Instructions shown to the seller.+ example: A copy of your certificate of incorporation.+ position:+ type: integer+ description: Place in the checklist.+ example: 1+ active:+ type: boolean+ example: true+ required:+ type: boolean+ description: Whether this blocks approval. Off means recommended.+ example: true+ preferences:+ type: object+ additionalProperties: true+ description: Configuration for this kind, per its type's `schema`.+ example:+ accepted_content_types:+ - application/pdf+ metadata:+ type: object+ additionalProperties: true+ custom_field_definition_ids:+ type: array+ items:+ type: string+ description: Custom field definitions this requirement asks the seller to+ fill in (`required_custom_fields` kind).+ required:+ - type+ SellerRequirementReviewParams:+ type: object+ properties:+ review_note:+ type: string+ description: Kept with the decision. On a rejection it is the reason sent+ back to the seller.+ SellerRequirementUpdateParams:+ type: object+ properties:+ 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.+ example: Business registration+ description:+ type: string+ description: Instructions shown to the seller.+ example: A copy of your certificate of incorporation.+ position:+ type: integer+ description: Place in the checklist.+ example: 1+ active:+ type: boolean+ example: true+ required:+ type: boolean+ description: Whether this blocks approval. Off means recommended.+ example: true+ preferences:+ type: object+ additionalProperties: true+ description: Configuration for this kind, per its type's `schema`.+ example:+ accepted_content_types:+ - application/pdf+ metadata:+ type: object+ additionalProperties: true+ custom_field_definition_ids:+ type: array+ items:+ type: string+ description: Custom field definitions this requirement asks the seller to+ fill in (`required_custom_fields` kind).+ SellerRequirementWaiveParams:+ type: object+ properties:+ requirement_id:+ type: string+ description: The requirement the seller is excused from.+ example: selreq_UkLWZg9DAJ+ review_note:+ type: string+ description: Why the seller is excused. Kept with the decision.+ required:+ - requirement_id+ SellerSuspendParams:+ type: object+ properties:+ reason:+ type: string+ example: Counterfeit goods+ SellerUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Northwind Books+ slug:+ type: string+ description: URL-safe slug, derived from the name when omitted.+ example: northwind-books+ contact_email:+ type: string+ example: [email protected]+ nullable: true+ billing_email:+ type: string+ example: [email protected]+ nullable: true+ about:+ type: string+ description: 'Sanitized HTML: the seller''s public description.'+ example: "<p>Independent bookshop.</p>"+ nullable: true+ logo_signed_id:+ type: string+ description: A `signed_id` from the files upload endpoint to set the image,+ `null` to remove it, or omit the key to leave it untouched. The same applies+ to `square_logo_signed_id` and `cover_photo_signed_id`.+ nullable: true+ square_logo_signed_id:+ type: string+ nullable: true+ cover_photo_signed_id:+ type: string+ nullable: true+ tax_remittance:+ type: string+ enum:+ - seller+ - platform+ example: seller+ payouts_schedule_interval:+ type: string+ enum:+ - daily+ - weekly+ - biweekly+ - monthly+ - manual+ nullable: true+ minimum_payout_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '25.0'+ nullable: true+ holiday_mode_until:+ type: string+ format: date-time+ description: 'Set while the seller is away: the catalog stays but stops+ selling.'+ nullable: true+ legal_name:+ type: string+ nullable: true+ registration_number:+ type: string+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ billing_address:+ allOf:+ - "$ref": "#/components/schemas/SellerAddressParams"+ description: 'The seller''s own billing 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.'+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Custom field values, each validated against its definition.+ SetupParams:+ type: object+ properties:+ setup_token:+ type: string+ description: The one-time token from the install output.+ email:+ type: string+ format: email+ example: [email protected]+ password:+ type: string+ password_confirmation:+ type: string+ first_name:+ type: string+ example: Olivia+ last_name:+ type: string+ example: Owner+ store_name:+ type: string+ example: My Store+ country_code:+ type: string+ description: ISO 3166-1 alpha-2 country the store sells from. It determines+ the default market, the warehouse, the delivery zones and the currency.+ example: US+ locale:+ type: string+ description: Storefront locale. Defaults to the country's own language.+ example: en+ currency:+ type: string+ description: 'ISO 4217 currency. Defaults to the country''s own currency:+ pass one only when the store prices in something else.'+ example: USD+ sample_data:+ type: boolean+ description: Load the demo catalog, customers and orders in the background+ once the admin account exists. The load takes minutes, so the response+ does not wait for it.+ required:+ - setup_token+ - password+ - country_code+ ShippingLabelCreateParams:+ type: object+ properties:+ file_signed_id:+ type: string+ description: A `signed_id` from `files.upload()`. Its presence records a+ label bought elsewhere instead of buying one; without it the body is ignored+ and the label is bought through the carrier.+ tracking_number:+ type: string+ description: The number printed on an uploaded label. Required with `file_signed_id`.+ carrier:+ type: string+ description: Free text; a forwarder's name is as valid as a carrier slug.+ Detected from the number when omitted.+ service:+ type: string+ description: Carrier service the label was bought at.+ cost:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: What the merchant paid the carrier. Accounting data only; it+ never touches the order's shipping charge.+ currency:+ type: string+ description: Currency of the cost.+ file_format:+ type: string+ enum:+ - png+ - zpl+ description: Taken from the file when omitted.+ tracking_url:+ type: string+ description: Tracking page for the consignment the label mints.+ StockLevelBulkUpsertParams:+ type: object+ properties:+ stock_levels:+ type: array+ items:+ "$ref": "#/components/schemas/StockLevelBulkUpsertRowParams"+ description: Send an empty list to change nothing.+ required:+ - stock_levels+ StockLevelBulkUpsertRowParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_xY9+ stock_location_id:+ type: string+ example: sloc_aBc+ count_on_hand:+ type: integer+ description: The absolute level the external system reports.+ example: 42+ nullable: true+ adjustment:+ type: integer+ description: A relative change, for feeds that report movements rather than+ levels. Each row needs `count_on_hand` or `adjustment`.+ example: -3+ nullable: true+ backorderable:+ type: boolean+ nullable: true+ required:+ - variant_id+ - stock_location_id+ StockLevelParams:+ type: object+ properties:+ id:+ type: string+ stock_location_id:+ type: string+ description: The location holding the stock (`sloc_...`).+ count_on_hand:+ type: integer+ description: 'Units physically at the location, not units available to sell:+ stock promised to placed orders counts until it ships. Sent as the count+ the shelf should end at; the API records the difference as an adjustment+ in the stock history.'+ backorderable:+ type: boolean+ description: Whether this location sells the variant beyond what it holds.+ required:+ - stock_location_id+ - count_on_hand+ StockLevelUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ count_on_hand:+ type: integer+ description: 'The count the shelf should end at: a whole number of zero+ or more. The API records the difference as an `adjusted` movement, so+ the correction appears in the stock history.'+ adjustment:+ type: integer+ description: A signed change to the shelf instead of a target count, applied+ to the count the API holds at that moment and recorded the same way. Cannot+ be sent together with `count_on_hand`.+ backorderable:+ type: boolean+ description: Whether this location sells the variant beyond what it holds.+ reason:+ type: string+ description: Labels the correction in the stock history. Defaults to "Manual+ adjustment".+ metadata:+ type: object+ additionalProperties: true+ StockLocationCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Brooklyn warehouse+ admin_name:+ type: string+ description: Internal name shown only in the admin.+ nullable: true+ active:+ type: boolean+ default:+ type: boolean+ description: Setting to true demotes the previous default.+ kind:+ type: string+ description: 'Categorizes the location. Built-in values: `warehouse`, `store`,+ `fulfillment_center`; extensions may add their own.'+ example: warehouse+ 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+ description: ISO-3166 alpha-2 country code.+ example: US+ nullable: true+ state_code:+ type: string+ description: State or province abbreviation, resolved against the selected+ country's states.+ example: NY+ nullable: true+ state_name:+ type: string+ description: Free-text state for countries that don't have a states list.+ nullable: true+ pickup_enabled:+ type: boolean+ pickup_stock_policy:+ type: string+ enum:+ - local+ - any+ description: "`local` collects only items at this location; `any` lets items+ transfer in from other locations (ship-to-store)."+ pickup_ready_in_minutes:+ type: integer+ nullable: true+ returns_enabled:+ type: boolean+ description: Whether customers may send returns to this location.+ pickup_instructions:+ type: string+ nullable: true+ required:+ - name+ StockLocationUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ name:+ type: string+ example: Brooklyn warehouse+ admin_name:+ type: string+ description: Internal name shown only in the admin.+ nullable: true+ active:+ type: boolean+ default:+ type: boolean+ description: Setting to true demotes the previous default.+ kind:+ type: string+ description: 'Categorizes the location. Built-in values: `warehouse`, `store`,+ `fulfillment_center`; extensions may add their own.'+ example: warehouse+ 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+ description: ISO-3166 alpha-2 country code.+ example: US+ nullable: true+ state_code:+ type: string+ description: State or province abbreviation, resolved against the selected+ country's states.+ example: NY+ nullable: true+ state_name:+ type: string+ description: Free-text state for countries that don't have a states list.+ nullable: true+ pickup_enabled:+ type: boolean+ pickup_stock_policy:+ type: string+ enum:+ - local+ - any+ description: "`local` collects only items at this location; `any` lets items+ transfer in from other locations (ship-to-store)."+ pickup_ready_in_minutes:+ type: integer+ nullable: true+ returns_enabled:+ type: boolean+ description: Whether customers may send returns to this location.+ pickup_instructions:+ type: string+ nullable: true+ StockReceiptCreateParams:+ type: object+ properties:+ reference:+ type: string+ description: The supplier's delivery note, or the carrier's reference.+ example: DN-4471+ nullable: true+ received_at:+ type: string+ format: date-time+ description: When the goods were counted in. Defaults to now.+ nullable: true+ notes:+ type: string+ nullable: true+ items:+ type: array+ items:+ "$ref": "#/components/schemas/StockReceiptItemParams"+ description: 'Omit to book in everything still outstanding, intact. Naming+ lines, even none, records exactly what the dock counted: `quantity_accepted`+ reaches the shelf; `quantity_rejected` is refused, recorded with a `rejection_reason`+ and never stocked.'+ StockReceiptItemParams:+ type: object+ properties:+ id:+ type: string+ description: The purchase order or transfer line.+ quantity_accepted:+ type: integer+ example: 58+ quantity_rejected:+ type: integer+ example: 2+ rejection_reason:+ type: string+ enum:+ - damaged+ - wrong_item+ - expired+ - other+ example: damaged+ nullable: true+ notes:+ type: string+ nullable: true+ required:+ - id+ StockTransferCancelParams:+ type: object+ properties:+ on_in_transit:+ type: string+ enum:+ - restock+ - write_off+ description: 'Required once the units have left the source: either they+ come back (`restock`) or they are written off as lost (`write_off`).'+ reason:+ type: string+ description: Recorded against the written-off lines.+ nullable: true+ StockTransferCreateParams:+ type: object+ properties:+ source_location_id:+ type: string+ example: sloc_1234567890+ destination_location_id:+ type: string+ example: sloc_1234567890+ reference:+ type: string+ description: The merchant's own label for the trip. `null` clears it.+ nullable: true+ notes:+ type: string+ nullable: true+ items:+ type: array+ items:+ "$ref": "#/components/schemas/StockTransferItemParams"+ description: A draft may open empty and gain lines as the merchant packs.+ Sending the list replaces whatever the draft currently holds.+ required:+ - source_location_id+ - destination_location_id+ StockTransferItemParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_1234567890+ quantity_shipped:+ type: integer+ example: 10+ required:+ - variant_id+ - quantity_shipped+ StockTransferMarkInTransitParams:+ type: object+ properties:+ force:+ type: boolean+ description: Ship even if it drives the source below zero.+ StockTransferUpdateParams:+ type: object+ properties:+ source_location_id:+ type: string+ example: sloc_1234567890+ destination_location_id:+ type: string+ example: sloc_1234567890+ reference:+ type: string+ description: The merchant's own label for the trip. `null` clears it.+ nullable: true+ notes:+ type: string+ nullable: true+ items:+ type: array+ items:+ "$ref": "#/components/schemas/StockTransferItemParams"+ description: A draft may open empty and gain lines as the merchant packs.+ Sending the list replaces whatever the draft currently holds.+ metadata:+ type: object+ additionalProperties: true+ nullable: true+ StoreCreditApplyParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the customer's available store credit, up to the+ order total.+ StoreUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: My Store+ admin_locale:+ type: string+ example: en+ timezone:+ type: string+ example: Europe/Berlin+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ unit_system:+ type: string+ enum:+ - metric+ - imperial+ storefront_access:+ type: string+ enum:+ - public+ - prices_hidden+ - login_required+ description: The store-wide default for what anonymous visitors can see.+ Channels fall back to it when they don't set their own.+ storefront_url:+ type: string+ description: The storefront's public URL, the base for links in customer+ emails. Saving it also completes the storefront setup task.+ nullable: true+ guest_checkout:+ type: boolean+ description: The store-wide default for guest checkout. Channels fall back+ to it.+ always_include_confirm_step:+ type: boolean+ description: Always show a confirmation step in checkout, even when no payment+ method requires one.+ company_field_enabled:+ type: boolean+ description: Shows a company field on address forms.+ address_requires_company:+ type: boolean+ description: Makes a company name mandatory on addresses.+ address_requires_phone:+ type: boolean+ description: Makes a phone number mandatory on customer addresses.+ capture_method:+ type: string+ enum:+ - checkout+ - on_dispatch+ - manual+ description: The store-wide default for when a customer is charged rather+ than only authorized. A payment method's own setting wins when set.+ preferred_auto_capture:+ type: boolean+ description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ preferred_auto_capture_on_dispatch:+ type: boolean+ description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ track_inventory_levels:+ type: boolean+ description: Counts on-hand quantities. Off means everything is treated+ as always available.+ stock_reservations_enabled:+ type: boolean+ description: Holds stock for shoppers while they check out, so the same+ item can't be sold twice.+ low_stock_threshold:+ type: integer+ description: On-hand units at or below which a tracked variant counts as+ low stock on the home screen; 0 turns the warning off.+ tax_using_ship_address:+ type: boolean+ description: Calculates tax from the shipping address. When false, tax is+ calculated from the billing address.+ track_price_history:+ type: boolean+ description: Records price changes for the EU Omnibus lowest-price-in-30-days+ display.+ show_products_without_price:+ type: boolean+ description: Whether products with no price in the shopper's currency still+ appear in listings.+ disable_sku_validation:+ type: boolean+ description: Lets more than one variant share the same SKU.+ order_routing_strategy:+ type: string+ description: The store-wide order routing strategy shorthand. Channels fall+ back to it.+ pricing_provider:+ type: string+ description: 'Where prices come from: a registered provider key, or `internal`.'+ inventory_provider:+ type: string+ description: 'Where stock levels come from: a registered provider key, or+ `internal`.'+ pricing_provider_failure_policy:+ type: string+ enum:+ - fallback+ - strict+ description: "`strict` refuses to price when the provider cannot answer;+ `fallback` uses the catalog."+ inventory_provider_failure_policy:+ type: string+ enum:+ - fallback+ - strict+ description: "`fallback` sells on the local stock snapshot when the provider+ cannot answer; `strict` refuses."+ payout_provider:+ type: string+ description: 'Blank means the built-in provider: the marketplace settles+ by hand.'+ default_payouts_schedule_interval:+ type: string+ enum:+ - daily+ - weekly+ - biweekly+ - monthly+ - manual+ default_minimum_payout_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: In the store's currency.+ example: '50.00'+ auto_approve_sellers:+ type: boolean+ description: Admits a seller as soon as they finish onboarding, with no+ operator review.+ auto_approve_seller_products:+ type: boolean+ description: Puts a seller product on sale the moment it is submitted, with+ no review.+ send_seller_transactional_emails:+ type: boolean+ description: When false, transactional seller emails (approval, payouts+ and so on) are not sent.+ default_commission_tax_rate:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Tax charged on commission as a fraction (`"0.23"` is 23%),+ when neither the commission rate nor the tax provider names one.+ example: '0.23'+ document_number_format:+ type: string+ description: 'How document numbers are produced: `sequential` or `random`.+ Applies to every numbered document.'+ example: sequential+ order_number_prefix:+ type: string+ description: 'Leads every order number. Uppercase letters, digits, dashes+ and # only.'+ example: R+ order_number_suffix:+ type: string+ description: 'Ends every order number. Uppercase letters, digits, dashes+ and # only.'+ order_number_sequence_start:+ type: integer+ description: The first sequential order number. Only applies before the+ store's first order.+ limit_digital_download_count:+ type: boolean+ description: Whether a digital download link stops working after a number+ of clicks.+ digital_asset_authorized_clicks:+ type: integer+ description: How many clicks a download link allows, unless the file sets+ its own.+ limit_digital_download_days:+ type: boolean+ description: Whether a digital download link expires after a number of days.+ digital_asset_authorized_days:+ type: integer+ description: How many days a download link stays valid, unless the file+ sets its own.+ mail_from_address:+ type: string+ description: Sender address of every transactional email.+ customer_support_email:+ type: string+ description: Customer-facing reply-to address shown in the storefront and+ email footers.+ nullable: true+ new_order_notifications_email:+ type: string+ description: Recipient of "new order placed" staff notifications.+ nullable: true+ send_consumer_transactional_emails:+ type: boolean+ description: When false, transactional customer emails (order confirmation+ and so on) are not sent.+ email_accent_color:+ type: string+ description: Customer email buttons and links, as `#RRGGBB`. Blank keeps+ the outlined buttons emails ship with.+ nullable: true+ email_background_color:+ type: string+ description: Customer email page background, as `#RRGGBB`.+ nullable: true+ email_card_color:+ type: string+ description: Customer email card behind the content, as `#RRGGBB`.+ nullable: true+ email_text_color:+ type: string+ description: Customer email body text, as `#RRGGBB`.+ nullable: true+ email_heading_color:+ type: string+ description: Customer email headings and emphasized text, as `#RRGGBB`.+ nullable: true+ email_font:+ type: string+ description: 'Customer email font: `inter`, `system`, `helvetica`, `georgia`,+ `roboto`, `lato` or `merriweather`.'+ example: inter+ nullable: true+ logo_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the store logo, or+ null to remove it.+ nullable: true+ mailer_logo_signed_id:+ type: string+ description: A `signed_id` from `files.upload()` for the logo in transactional+ emails, or null to remove it.+ nullable: true+ SupplierCreateParams:+ type: object+ properties:+ name:+ type: string+ example: Northwind Trading+ contact_name:+ type: string+ example: Dana Okafor+ nullable: true+ email:+ type: string+ example: [email protected]+ nullable: true+ phone:+ type: string+ example: 555-0100+ nullable: true+ notes:+ type: string+ nullable: true+ address1:+ type: string+ example: 1 Warehouse Way+ nullable: true+ address2:+ type: string+ nullable: true+ city:+ type: string+ example: Brooklyn+ nullable: true+ state_name:+ type: string+ nullable: true+ state_code:+ type: string+ example: NY+ nullable: true+ country_code:+ type: string+ example: US+ nullable: true+ postal_code:+ type: string+ example: '11201'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ nullable: true+ required:+ - name+ SupplierUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Northwind Trading+ contact_name:+ type: string+ example: Dana Okafor+ nullable: true+ email:+ type: string+ example: [email protected]+ nullable: true+ phone:+ type: string+ example: 555-0100+ nullable: true+ notes:+ type: string+ nullable: true+ address1:+ type: string+ example: 1 Warehouse Way+ nullable: true+ address2:+ type: string+ nullable: true+ city:+ type: string+ example: Brooklyn+ nullable: true+ state_name:+ type: string+ nullable: true+ state_code:+ type: string+ example: NY+ nullable: true+ country_code:+ type: string+ example: US+ nullable: true+ postal_code:+ type: string+ example: '11201'+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ nullable: true+ TaxCategoryCreateParams:+ type: object+ properties:+ name:+ type: string+ tax_code:+ type: string+ nullable: true+ description:+ type: string+ nullable: true+ is_default:+ type: boolean+ required:+ - name+ TaxCategoryUpdateParams:+ type: object+ properties:+ name:+ type: string+ tax_code:+ type: string+ nullable: true+ description:+ type: string+ nullable: true+ is_default:+ type: boolean+ TaxExemptionCertificateParams:+ type: object+ properties:+ certificate_number:+ type: string+ description: Required when creating.+ example: DE-RESALE-7+ reason_code:+ type: string+ description: Becomes the tax provider's entity use code. Required when creating.+ example: resale+ issuing_authority:+ type: string+ example: Finanzamt Berlin+ nullable: true+ issued_at:+ type: string+ format: date-time+ nullable: true+ expires_at:+ type: string+ format: date-time+ nullable: true+ country_code:+ type: string+ description: Where the certificate holds. Omit both for one valid everywhere.+ nullable: true+ state_code:+ type: string+ description: Where the certificate holds. Omit both for one valid everywhere.+ nullable: true+ document_signed_id:+ type: string+ description: 'A `signed_id` from `files.upload()` with `visibility: ''private''`.'+ metadata:+ type: object+ additionalProperties: true+ TaxIdentifierParams:+ type: object+ properties:+ kind:+ type: string+ description: 'The registration the number belongs to, such as `eu_vat` or+ `gb_vat`. Any kind is accepted; one with a registered validator is checked+ by it. Built-in: `eu_vat`. Extensions may register more. Required when+ creating.'+ example: gb_vat+ value:+ type: string+ description: Required when creating.+ example: GB123456789+ TaxRateParams:+ type: object+ properties:+ name:+ type: string+ description: Customer-facing rate name.+ example: VAT+ rate:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: The rate as a fraction. Send this or `rate_percent`.+ example: '0.19'+ rate_percent:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: The rate as a percentage.+ example: '19'+ included_in_price:+ type: boolean+ show_rate_in_label:+ type: boolean+ tax_category_id:+ type: string+ country_code:+ type: string+ description: ISO country code. A rate naming no country taxes everywhere.+ example: DE+ nullable: true+ state_code:+ type: string+ description: State abbreviation within that country.+ example: CA+ nullable: true+ metadata:+ type: object+ additionalProperties: true+ TranslationBatchEntryParams:+ type: object+ properties:+ resource_type:+ type: string+ description: Translatable resource type token, e.g. `option_type`.+ example: option_type+ resource_id:+ type: string+ example: opt_abc123+ values:+ type: object+ additionalProperties: true+ description: Translated fields keyed by locale code, then by field name.+ example:+ de:+ label: Größe+ required:+ - resource_type+ - resource_id+ - values+ TranslationBatchParams:+ type: object+ properties:+ translations:+ type: array+ items:+ "$ref": "#/components/schemas/TranslationBatchEntryParams"+ description: At least one entry. All entries are saved, or none are.+ required:+ - translations+ VariantCreateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ sku:+ type: string+ barcode:+ type: string+ cost_price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ cost_currency:+ type: string+ weight:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ depth:+ type: number+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ hs_code:+ type: string+ country_of_origin:+ type: string+ customs_description:+ type: string+ minimum_order_quantity:+ type: integer+ nullable: true+ order_multiple:+ type: integer+ nullable: true+ purchase_unit:+ type: string+ units_per_carton:+ type: integer+ description: How many units fill one carton.+ nullable: true+ carton_package_type_id:+ type: string+ description: 'The carton this variant is packed into: a package type of+ kind `carton`. Its dimensions are shared by every product packed the same+ way, so a corrected carton size fixes all of them at once.'+ nullable: true+ carton_weight:+ type: number+ description: What one packed carton weighs, in the variant's weight unit.+ nullable: true+ cartons_per_pallet:+ type: integer+ description: How many cartons stack on one pallet.+ nullable: true+ seller_id:+ type: string+ delivery_profile_id:+ type: string+ nullable: true+ track_inventory:+ type: boolean+ preorderable:+ type: boolean+ description: Sell this variant before it's in stock. Adds the pre-order+ label and ships-by promise; the cap comes from `backorder_limit`, an incoming+ stock count, or backorder.+ preorder_ships_at:+ type: string+ format: date-time+ description: The "ships by" date shown to customers while the variant is+ a pre-order. Once it passes, the variant is no longer a pre-order. Null+ clears it.+ nullable: true+ backorder_limit:+ type: integer+ description: Maximum units sellable beyond available stock, capping backorders+ and pre-orders. Null is unlimited.+ nullable: true+ tax_category_id:+ type: string+ position:+ type: integer+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceParams"+ description: Per-currency prices. Upserted by currency.+ stock_levels:+ type: array+ items:+ "$ref": "#/components/schemas/StockLevelParams"+ description: Stock per location. Upserted by location; omitted locations+ are removed.+ options:+ type: array+ items:+ "$ref": "#/components/schemas/VariantOptionParams"+ description: One pair per option type the variant takes part in (size, color).+ Option types and values are created when missing. On update, omit to leave+ the option values untouched.+ required:+ - options+ VariantOptionParams:+ type: object+ properties:+ name:+ type: string+ example: size+ value:+ type: string+ example: Small+ required:+ - name+ - value+ VariantUpdateParams:+ type: object+ properties:+ external_references:+ type: object+ additionalProperties: true+ description: 'Identities the record has in external systems, keyed by system:+ the same `{ system: external_id }` map the Admin API renders, so what+ you read can be sent straight back. Systems you do not name keep the reference+ they have. A list of `{ system, external_id }` entries is accepted too.'+ sku:+ type: string+ barcode:+ type: string+ cost_price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ cost_currency:+ type: string+ weight:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ depth:+ type: number+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ hs_code:+ type: string+ country_of_origin:+ type: string+ customs_description:+ type: string+ minimum_order_quantity:+ type: integer+ nullable: true+ order_multiple:+ type: integer+ nullable: true+ purchase_unit:+ type: string+ units_per_carton:+ type: integer+ description: How many units fill one carton.+ nullable: true+ carton_package_type_id:+ type: string+ description: 'The carton this variant is packed into: a package type of+ kind `carton`. Its dimensions are shared by every product packed the same+ way, so a corrected carton size fixes all of them at once.'+ nullable: true+ carton_weight:+ type: number+ description: What one packed carton weighs, in the variant's weight unit.+ nullable: true+ cartons_per_pallet:+ type: integer+ description: How many cartons stack on one pallet.+ nullable: true+ seller_id:+ type: string+ delivery_profile_id:+ type: string+ nullable: true+ track_inventory:+ type: boolean+ preorderable:+ type: boolean+ description: Sell this variant before it's in stock. Adds the pre-order+ label and ships-by promise; the cap comes from `backorder_limit`, an incoming+ stock count, or backorder.+ preorder_ships_at:+ type: string+ format: date-time+ description: The "ships by" date shown to customers while the variant is+ a pre-order. Once it passes, the variant is no longer a pre-order. Null+ clears it.+ nullable: true+ backorder_limit:+ type: integer+ description: Maximum units sellable beyond available stock, capping backorders+ and pre-orders. Null is unlimited.+ nullable: true+ tax_category_id:+ type: string+ position:+ type: integer+ prices:+ type: array+ items:+ "$ref": "#/components/schemas/PriceParams"+ description: Per-currency prices. Upserted by currency.+ stock_levels:+ type: array+ items:+ "$ref": "#/components/schemas/StockLevelParams"+ description: Stock per location. Upserted by location; omitted locations+ are removed.+ options:+ type: array+ items:+ "$ref": "#/components/schemas/VariantOptionParams"+ description: One pair per option type the variant takes part in (size, color).+ Option types and values are created when missing. On update, omit to leave+ the option values untouched.+ WebhookEndpointCreateParams:+ type: object+ properties:+ name:+ type: string+ description: A label shown in the dashboard list.+ example: Order pipeline+ nullable: true+ url:+ type: string+ description: HTTPS destination URL. It cannot resolve to a private IP address+ outside development.+ example: https://example.com/webhooks/orders+ active:+ type: boolean+ description: Defaults to true on create. Prefer the disable and enable endpoints+ to pause one.+ subscriptions:+ type: array+ items:+ type: string+ description: Event names this endpoint receives. An empty list or `["*"]`+ subscribes to every event; otherwise list exact names (`order.completed`)+ or patterns (`order.*`).+ example:+ - order.placed+ - order.canceled+ required:+ - url+ WebhookEndpointDisableParams:+ type: object+ properties:+ reason:+ type: string+ description: Shown next to the disabled indicator. Defaults to "Manually+ disabled".+ example: Investigating elevated 5xx rate+ WebhookEndpointUpdateParams:+ type: object+ properties:+ name:+ type: string+ description: A label shown in the dashboard list.+ example: Order pipeline+ nullable: true+ url:+ type: string+ description: HTTPS destination URL. It cannot resolve to a private IP address+ outside development.+ example: https://example.com/webhooks/orders+ active:+ type: boolean+ description: Defaults to true on create. Prefer the disable and enable endpoints+ to pause one.+ subscriptions:+ type: array+ items:+ type: string+ description: Event names this endpoint receives. An empty list or `["*"]`+ subscribes to every event; otherwise list exact names (`order.completed`)+ or patterns (`order.*`).+ example:+ - order.placed+ - order.canceledx-spree-filter-tables:Address:attributes:diff --git a/docs/api-reference/seller.yaml b/docs/api-reference/seller.yamlindex 460f7f317f..c91461bfea 100644--- a/docs/api-reference/seller.yaml+++ b/docs/api-reference/seller.yaml@@ -112,23 +112,8 @@ paths:content:application/json:schema:- type: object- properties:- provider:- type: string- enum:- default: email- email:- type: string- format: email- example: [email protected]- password:- type: string- example: password123- required:- - password+ "$ref": "#/components/schemas/LoginParams"+ required: true"/api/v3/seller/auth/refresh":post:summary: Refresh token@@ -306,7 +291,7 @@ paths:selected_locale:sellers:- id: sel_UkLWZg9DAJ- name: Seller 50+ name: Seller 59status: approvedschema:"$ref": "#/components/schemas/AuthResponse"@@ -324,20 +309,8 @@ paths:content:application/json:schema:- type: object- properties:- password:- type: string- example: password123- password_confirmation:- type: string- example: password123- first_name:- type: string- example: Robin- last_name:- type: string- example: Ellis+ "$ref": "#/components/schemas/InvitationAcceptParams"+ required: true"/api/v3/seller/auth/password_resets":post:summary: Request password reset@@ -371,19 +344,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- redirect_url:- type: string- example: https://sellers.your-store.com/reset-password- description: Must match an allowed origin of the store; ignored- otherwise.- required:+ "$ref": "#/components/schemas/PasswordResetCreateParams"+ required: true"/api/v3/seller/auth/password_resets/{id}":patch:summary: Reset password@@ -423,7 +385,7 @@ paths:selected_locale:sellers:- id: sel_UkLWZg9DAJ- name: Seller 87+ name: Seller 97status: approvedschema:"$ref": "#/components/schemas/AuthResponse"@@ -441,17 +403,8 @@ paths:content:application/json:schema:- type: object- properties:- password:- type: string- example: new-password-123- password_confirmation:- type: string- example: new-password-123- required:- - password- - password_confirmation+ "$ref": "#/components/schemas/PasswordResetUpdateParams"+ required: true"/api/v3/seller/me":get:summary: Current user@@ -493,8 +446,8 @@ paths:selected_locale:sellers:- id: sel_UkLWZg9DAJ- name: Seller 60- slug: seller-60+ name: Seller 69+ slug: seller-69status: approvedpermissions:- allow: true@@ -748,8 +701,8 @@ paths:selected_locale:sellers:- id: sel_UkLWZg9DAJ- name: Seller 62- slug: seller-62+ name: Seller 71+ slug: seller-71status: approvedpermissions: []permission_keys: []@@ -784,23 +737,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: Ada- last_name:- type: string- example: Lovelace- selected_locale:- type: string- example: de- description: Panel display language, as a code the panel ships.- avatar_signed_id:- type: string- nullable: true- description: The `signed_id` returned by POST /files, or `null`- to remove the photo.+ "$ref": "#/components/schemas/AccountUpdateParams"+ required: true"/api/v3/seller/countries":get:summary: List countries@@ -12470,7 +12408,7 @@ paths:data:- id: dm_UkLWZg9DAJname: My courier- code: UPS_GROUND_85+ code: UPS_GROUND_115estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12493,7 +12431,7 @@ paths:currency: USD- id: dm_gbHJdmfrXBname: Marketplace post- code: UPS_GROUND_86+ code: UPS_GROUND_116estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12603,58 +12541,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- admin_name:- type: string- nullable: true- code:- type: string- nullable: true- delivery_profile_id:- type: string- description: One of the marketplace's delivery profiles- delivery_zone_id:- type: string- nullable: true- description: Narrows where the method ships- 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- calculator:- type: object- description: 'How the method is priced: a type from `/delivery_methods/calculators`- and its preferences, per that type''s `schema`.'- properties:- type:- type: string- example: flat_rate- preferences:- type: object- example:- amount: '12.5'- rules:- type: array- description: Conditions on the method, from `/delivery_methods/rule_types`- items:- type: object- properties:- type:- type: string- preferences:- type: object- required:- - name+ "$ref": "#/components/schemas/DeliveryMethodParams"+ required: true"/api/v3/seller/delivery_methods/{id}":parameters:- name: id@@ -12682,7 +12570,7 @@ paths:example:id: dm_UkLWZg9DAJname: My courier- code: UPS_GROUND_91+ code: UPS_GROUND_121estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12722,7 +12610,7 @@ paths:example:id: dm_UkLWZg9DAJname: My express courier- code: UPS_GROUND_93+ code: UPS_GROUND_123estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12749,59 +12637,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- admin_name:- type: string- nullable: true- code:- type: string- nullable: true- delivery_profile_id:- type: string- description: One of the marketplace's delivery profiles- delivery_zone_id:- type: string- nullable: true- description: Narrows where the method ships- 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- calculator:- type: object- description: 'How the method is priced: a type from `/delivery_methods/calculators`- and its preferences, per that type''s `schema`.'- properties:- type:- type: string- example: flat_rate- preferences:- type: object- example:- amount: '12.5'- rules:- type: array- description: Replaces the whole set — a rule dropped here is deleted,- so re-send surviving rules with their `id`.- items:- type: object- properties:- id:- type: string- type:- type: string- preferences:- type: object+ "$ref": "#/components/schemas/DeliveryMethodParams"+ required: truedelete:summary: Retire a delivery methodtags:@@ -13400,6 +13237,37 @@ paths:message: Requirements Accept terms is not completeschema:"$ref": "#/components/schemas/ErrorResponse"+ "/api/v3/seller/onboarding/payout_account":+ post:+ summary: Get a payout account link+ tags:+ - Onboarding+ security:+ - bearer_auth: []+ description: |+ A fresh link to wherever the marketplace's payout provider collects+ what it needs before it will pay this seller. Ask for it when the+ seller acts: these links are short-lived and single-use. Answers+ `{ "url": null }` when the provider hosts no onboarding.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: payout account link+ content:+ application/json:+ example:+ url:+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/OnboardingPayoutAccountParams"+ required: true"/api/v3/seller/requirements/{requirement_id}/submissions":parameters:- name: requirement_id@@ -13466,19 +13334,8 @@ paths:content:application/json:schema:- type: object- properties:- note:- type: string- description: Anything the seller wants to say alongside the submission- reference:- type: string- description: A reference number or external identifier, for requirements- that ask for one- file_signed_id:- type: string- description: The `signed_id` returned by POST /files, for requirements- that ask for a document+ "$ref": "#/components/schemas/RequirementSubmissionParams"+ required: true"/api/v3/seller/requirement_submissions/{id}/download":parameters:- name: id@@ -13663,19 +13520,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Shipping Policy- slug:- type: string- example: shipping-policy- body:- type: string- example: "<p>Orders leave the workshop within two working days.</p>"- required:- - name+ "$ref": "#/components/schemas/PolicyCreateParams"+ required: true"/api/v3/seller/policies/{id}":parameters:- name: id@@ -13754,14 +13600,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- slug:- type: string- body:- type: string+ "$ref": "#/components/schemas/PolicyUpdateParams"+ required: truedelete:summary: Delete a policytags:@@ -14098,8 +13938,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 2233250- slug: product-2233250+ name: Product 2683250+ slug: product-2683250meta_title:meta_description:meta_keywords:@@ -14248,60 +14088,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Hand-thrown mug- description:- type: string- slug:- type: string- example: hand-thrown-mug- status:- type: string- example: draft- meta_title:- type: string- meta_description:- type: string- meta_keywords:- type: string- product_type_id:- type: string- example: ptype_abc123- tags:- type: array- items:- type: string- example:- - ceramics- - handmade- category_ids:- type: array- items:- type: string- example:- - cat_abc123- metadata:- type: object- additionalProperties: true- prices:- type: array- items:- type: object- properties:- amount:- type: string- example: '24.00'- compare_at_amount:- type: string- example: '30.00'- currency:- type: string- example: USD- required:- - name+ "$ref": "#/components/schemas/ProductParams"+ required: true"/api/v3/seller/products/{id}":parameters:- name: id@@ -14334,8 +14122,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 2266710- slug: product-2266710+ name: Product 2716710+ slug: product-2716710meta_title:meta_description:meta_keywords:@@ -14410,7 +14198,7 @@ paths:example:id: prod_UkLWZg9DAJname: Hand-thrown mug, large- slug: product-2298212+ slug: product-2748212meta_title:meta_description:meta_keywords:@@ -14454,29 +14242,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Hand-thrown mug, large- description:- type: string- slug:- type: string- status:- type: string- example: active- tags:- type: array- items:- type: string- category_ids:- type: array- items:- type: string- metadata:- type: object- additionalProperties: true+ "$ref": "#/components/schemas/ProductParams"+ required: truedelete:summary: Delete a producttags:@@ -14493,6 +14260,66 @@ paths:responses:'204':description: product deleted+ "/api/v3/seller/products/bulk_submit":+ post:+ summary: Submit products for review+ tags:+ - Products+ security:+ - bearer_auth: []+ description: |+ Submits a selection for the marketplace to review. Only drafts and+ rejected listings can be submitted, so a mixed selection moves what it+ can: `product_count` is what was submitted, and `skipped_count`, present+ only when something was skipped, is the rest.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: products submitted+ content:+ application/json:+ example:+ product_count: 1+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ProductBulkSubmitParams"+ required: true+ "/api/v3/seller/products/bulk_status_update":+ post:+ summary: Change the status of products+ tags:+ - Products+ security:+ - bearer_auth: []+ description: |+ Moves a selection to `draft` or `archived`. There is no bulk route onto+ `active`: a listing goes on sale when the marketplace approves it.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: statuses changed+ content:+ application/json:+ example:+ product_count: 1+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ProductBulkStatusParams"+ required: true"/api/v3/seller/profile":get:summary: Get profile@@ -14519,8 +14346,8 @@ paths:application/json:example:id: sel_UkLWZg9DAJ- name: Seller 107- slug: seller-107+ name: Seller 119+ slug: seller-119about: ''about_html: ''logo_url:@@ -14593,7 +14420,7 @@ paths:example:id: sel_UkLWZg9DAJname: Acme Supplies- slug: seller-109+ slug: seller-121about: ''about_html: ''logo_url:@@ -14638,59 +14465,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Acme Supplies- contact_email:- type: string- format: email- nullable: true- example: [email protected]- billing_email:- type: string- format: email- nullable: true- example: [email protected]- about:- type: string- nullable: true- description: Sanitized HTML — the seller's public description- legal_name:- type: string- nullable: true- description: The business a commission invoice is made out to- registration_number:- type: string- nullable: true- logo_signed_id:- type: string- nullable: true- description: The `signed_id` returned by POST /files; `null` removes- the image- square_logo_signed_id:- type: string- nullable: true- cover_photo_signed_id:- type: string- nullable: true- accept_terms:- type: boolean- description: Stamps acceptance of the marketplace terms- billing_address:- type: object- additionalProperties: true- custom_fields:- type: array- items:- type: object- properties:- custom_field_definition_id:- type: string- example: cfd_abc123- value:- description: Any JSON value the definition accepts+ "$ref": "#/components/schemas/ProfileUpdateParams"+ required: true"/api/v3/seller/stock_locations":get:summary: List stock locations@@ -14893,53 +14669,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Main warehouse- company:- type: string- nullable: true- address1:- type: string- nullable: true- example: 1 Kiln Lane- address2:- type: string- nullable: true- city:- type: string- nullable: true- example: Portland- zipcode:- type: string- nullable: true- example: '97205'- country_code:- type: string- nullable: true- example: US- state_code:- type: string- nullable: true- example: OR- state_name:- type: string- nullable: true- phone:- type: string- nullable: true- active:- type: boolean- description: Set `false` to retire a location — there is no delete- default:- type: boolean- kind:- type: string- example: warehouse- required:- - name+ "$ref": "#/components/schemas/StockLocationParams"+ required: true"/api/v3/seller/stock_locations/{id}":parameters:- name: id@@ -15053,33 +14784,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Main warehouse- address1:- type: string- nullable: true- city:- type: string- nullable: true- zipcode:- type: string- nullable: true- country_code:- type: string- nullable: true- state_code:- type: string- nullable: true- phone:- type: string- nullable: true- active:- type: boolean- default:- type: boolean+ "$ref": "#/components/schemas/StockLocationParams"+ required: true"/api/v3/seller/invitations":get:summary: List pending invitations@@ -15334,14 +15040,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- required:+ "$ref": "#/components/schemas/TeamMemberCreateParams"+ required: true"/api/v3/seller/team/{id}":parameters:- name: id@@ -15426,7 +15126,7 @@ paths:content:application/json:example:- signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--bb0b6973ee0447f02cdcd29af88cf330e909e39c+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7bfilename: registration.pdfcontent_type: application/pdfbyte_size: 51234@@ -15434,7 +15134,7 @@ paths:expires_at: '2026-01-16T12:00:00.000Z'upload:method: PUT- url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiI4NDFrenlvbTQ5cnRhcDk0cmZxbGV6dnM1cGJsIiwiY29udGVudF90eXBlIjoiYXBwbGljYXRpb24vcGRmIiwiY29udGVudF9sZW5ndGgiOjUxMjM0LCJjaGVja3N1bSI6IlZqaHowNGxRdUVHdXY0bkR2aHNhTlE9PSIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--8107f48df9ba51d19f7688d473fda995d4063f66+ url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiI4NDFrenlvbTQ5cnRhcDk0cmZxbGV6dnM1cGJsIiwiY29udGVudF90eXBlIjoiYXBwbGljYXRpb24vcGRmIiwiY29udGVudF9sZW5ndGgiOjUxMjM0LCJjaGVja3N1bSI6IlZqaHowNGxRdUVHdXY0bkR2aHNhTlE9PSIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--5d9d0b86e73fd398b0da66a7fd3ed0f444c4c192headers:Content-Type: application/pdfschema:@@ -15443,64 +15143,11 @@ paths:content:application/json:schema:- type: object- properties:- filename:- type: string- example: registration.pdf- content_type:- type: string- example: application/pdf- byte_size:- type: integer- example: 51234- checksum:- type: string- description: Base64-encoded MD5 digest of the file- example: rL0Y20zC+Fzt72VPzMSk2A==- visibility:- type: string- enum:- - public- - private- default: public- file:- type: string- format: binary- description: The bytes, for a multipart upload- required:- - filename- - content_type+ "$ref": "#/components/schemas/FileUploadCreateParams"multipart/form-data:schema:- type: object- properties:- filename:- type: string- example: registration.pdf- content_type:- type: string- example: application/pdf- byte_size:- type: integer- example: 51234- checksum:- type: string- description: Base64-encoded MD5 digest of the file- example: rL0Y20zC+Fzt72VPzMSk2A==- visibility:- type: string- enum:- - public- - private- default: public- file:- type: string- format: binary- description: The bytes, for a multipart upload- required:- - filename- - content_type+ "$ref": "#/components/schemas/FileUploadCreateParams"+ required: true"/api/v3/seller/balances":get:summary: List balances@@ -15687,39 +15334,8 @@ paths:content:application/json:schema:- type: object- properties:- items:- type: array- items:- type: object- properties:- line_item_id:- type: string- quantity:- type: integer- description:- type: string- nullable: true- send_replacement:- type: boolean- replacement_variant_id:- type: string- nullable: true- refund_amount:- type: string- nullable: true- required:- - line_item_id- - quantity- reason_id:- type: string- nullable: true- memo:- type: string- nullable: true- required:- - items+ "$ref": "#/components/schemas/ClaimCreateParams"+ required: true"/api/v3/seller/orders/{order_id}/claims/{id}/approve":parameters:- name: order_id@@ -15818,28 +15434,8 @@ paths:content:application/json:schema:- type: object- properties:- resolution:- type: string- enum:- - refund- - replacement- - refund_and_replacement- refund_method:- type: string- enum:- - original_payment- - store_credit- amount:- type: string- nullable: true- replacement_line_item_ids:- type: array- items:- type: string- required:- - resolution+ "$ref": "#/components/schemas/ClaimResolveParams"+ required: true"/api/v3/seller/orders/{order_id}/claims/{id}/deny":parameters:- name: order_id@@ -15882,9 +15478,64 @@ paths:resolved_at:denied_at: '2026-01-15T12:00:00Z'canceled_at:- memo:+ memo: Reported after the claim window closed+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimDenyParams"+ "/api/v3/seller/orders/{order_id}/claims/{id}/cancel":+ parameters:+ - name: order_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ patch:+ summary: Cancel a claim+ tags:+ - Claims+ security:+ - bearer_auth: []+ description: Withdraws a claim that is no longer needed.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: claim canceled+ content:+ application/json:+ example:+ id: claim_UkLWZg9DAJ+ number: CLM1001+ status: canceled+ resolution:+ order_id: or_UkLWZg9DAJ+ reason_id:+ refund_total: '0.00'+ approved_at:+ resolved_at:+ denied_at:+ canceled_at: '2026-01-15T12:00:00Z'+ memo: Customer found the missing itemschema:"$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ClaimCancelParams""/api/v3/seller/claim_reasons":get:summary: List claim reasons@@ -16104,34 +15755,60 @@ paths:content:application/json:schema:- type: object- properties:- items:- type: array- items:- type: object- properties:- fulfillment_item_id:- type: string- new_variant_id:- type: string- quantity:- type: integer- required:- - fulfillment_item_id- - new_variant_id- - quantity+ "$ref": "#/components/schemas/ExchangeCreateParams"+ required: true+ "/api/v3/seller/orders/{order_id}/exchanges/{id}/receive":+ parameters:+ - name: order_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ patch:+ summary: Receive an exchange+ tags:+ - Exchanges+ security:+ - bearer_auth: []+ description: |+ Records the goods coming back. Send the rows that actually arrived for+ a partial or damaged receipt; omit them to receive everything.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: exchange received+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: received+ order_id: or_UkLWZg9DAJreason_id:- type: string- nullable: true- stock_location_id:- type: string- nullable: true+ price_difference: '9.99'+ approved_at: '2026-01-15T12:00:00Z'+ received_at: '2026-01-15T12:00:00Z'+ fulfilled_at:+ canceled_at:memo:- type: string- nullable: true- required:- - items+ stock_location_id: sloc_UkLWZg9DAJ+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeReceiveParams""/api/v3/seller/orders/{order_id}/exchanges/{id}/fulfill":parameters:- name: order_id@@ -16183,13 +15860,57 @@ paths:content:application/json:schema:- type: object- properties:- refund_method:- type: string- enum:- - original_payment- - store_credit+ "$ref": "#/components/schemas/ExchangeFulfillParams"+ "/api/v3/seller/orders/{order_id}/exchanges/{id}/cancel":+ parameters:+ - name: order_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ patch:+ summary: Cancel an exchange+ tags:+ - Exchanges+ security:+ - bearer_auth: []+ description: Withdraws an exchange before the goods come back.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: exchange canceled+ content:+ application/json:+ example:+ id: exch_UkLWZg9DAJ+ number: EX1001+ status: canceled+ order_id: or_UkLWZg9DAJ+ reason_id:+ price_difference: '9.99'+ approved_at:+ received_at:+ fulfilled_at:+ canceled_at: '2026-01-15T12:00:00Z'+ memo: Customer kept the original+ stock_location_id: sloc_UkLWZg9DAJ+ schema:+ "$ref": "#/components/schemas/Exchange"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ExchangeCancelParams""/api/v3/seller/exports":post:summary: Create an export@@ -16246,32 +15967,8 @@ paths:content:application/json:schema:- type: object- properties:- type:- type: string- enum:- - orders- - products- description: Which dataset to export.- record_selection:- type: string- enum:- - filtered- - all- description: "`filtered` (default) honours `search_params`; `all`- exports everything this seller owns."- search_params:- type: object- description: Ransack predicates, the same shape the list endpoints- take. Ignored when `record_selection` is `all`.- additionalProperties: true- results_url:- type: string- description: Panel URL the export-done email links back to. Honoured- only when it matches one of the store's allowed origins.- required:- - type+ "$ref": "#/components/schemas/SellerExportCreateParams"+ required: true"/api/v3/seller/exports/{id}":parameters:- name: id@@ -16446,7 +16143,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 93+ delivery_method_name: UPS Ground 125stock_location_name: Vernie Lehnerstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -16454,13 +16151,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2029315- sku: SKU-273+ name: Product 2429315+ sku: SKU-324options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 93+ name: UPS Ground 125selected: truecost: '10.00'total: '10.00'@@ -16552,7 +16249,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 94+ delivery_method_name: UPS Ground 126stock_location_name: Mirta Hermanstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -16560,13 +16257,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 203961- sku: SKU-274+ name: Product 243961+ sku: SKU-325options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 94+ name: UPS Ground 126selected: truecost: '10.00'total: '10.00'@@ -16594,31 +16291,7 @@ paths:content:application/json:schema:- type: object- properties:- tracking:- type: string- description: Carrier tracking number- tracking_carrier:- type: string- description: Carrier name- notify_customer:- type: boolean- description: Send the dispatch email (default true)- items:- type: array- description: Ship only these lines; the rest split onto a new fulfillment- items:- type: object- properties:- item_id:- type: string- description: Prefixed line item ID- quantity:- type: integer- required:- - item_id- - quantity+ "$ref": "#/components/schemas/FulfillmentFulfillParams""/api/v3/seller/orders/{order_id}/fulfillments/{id}":parameters:- name: order_id@@ -16638,11 +16311,9 @@ paths:security:- bearer_auth: []description: |- Adds or corrects the tracking number and its carrier.-- Deliberately narrow: where a parcel ships from and which service- carries it are the marketplace's arrangements, so they are not- editable here.+ Adds or corrects the tracking number and its carrier. Can also move the+ parcel to another of the seller's own stock locations, which quotes its+ rates again from there, or pick a different one of its quoted rates.parameters:- name: X-Spree-Seller-Idin: header@@ -16665,7 +16336,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 95+ delivery_method_name: UPS Ground 127stock_location_name: Eugena Schultzstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -16673,13 +16344,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2043170- sku: SKU-275+ name: Product 2443170+ sku: SKU-326options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 95+ name: UPS Ground 127selected: truecost: '10.00'total: '10.00'@@ -16707,14 +16378,8 @@ paths:content:application/json:schema:- type: object- properties:- tracking:- type: string- nullable: true- tracking_carrier:- type: string- nullable: true+ "$ref": "#/components/schemas/FulfillmentUpdateParams"+ required: true"/api/v3/seller/orders/{order_id}/fulfillments/{id}/cancel":parameters:- name: order_id@@ -16758,7 +16423,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 96+ delivery_method_name: UPS Ground 128stock_location_name: Karyn Moorestock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -16766,13 +16431,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2057276- sku: SKU-276+ name: Product 2457276+ sku: SKU-327options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 96+ name: UPS Ground 128selected: truecost: '10.00'total: '10.00'@@ -16796,6 +16461,127 @@ paths:labels: []schema:"$ref": "#/components/schemas/Fulfillment"+ "/api/v3/seller/orders/{order_id}/fulfillments/{id}/split":+ parameters:+ - name: order_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ patch:+ summary: Split a parcel+ tags:+ - Fulfillments+ security:+ - bearer_auth: []+ description: |+ Moves part of what this parcel holds onto a new one, for goods leaving+ separately. Answers with every fulfillment on the order, since+ splitting rewrites more than one.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: parcel split+ content:+ application/json:+ example:+ data:+ - id: ful_UkLWZg9DAJ+ number: R1001-F1+ status: unfulfilled+ tracking: U10000+ tracking_url:+ fulfilled_at:+ delivered_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ fulfillment_type: shipping+ delivery_method_name: UPS Ground 129+ stock_location_name: Fred Hand+ stock_location_id: sloc_UkLWZg9DAJ+ fulfillment_items:+ - id: fi_gbHJdmfrXB+ quantity: 1+ line_item_id: li_gbHJdmfrXB+ variant_id: variant_gbHJdmfrXB+ name: Product 2471765+ sku: SKU-329+ options_text: ''+ selected_delivery_rate_id: dr_EfhxLZ9ck8+ delivery_rates:+ - id: dr_EfhxLZ9ck8+ name: UPS Ground 129+ selected: true+ cost: '10.00'+ total: '10.00'+ carrier:+ service_level:+ estimated_delivery_date:+ unpriced: false+ deliveries:+ - id: dlv_UkLWZg9DAJ+ tracking_number: U10000+ carrier:+ carrier_name:+ service:+ status: pending+ tracking_url:+ estimated_delivery_at:+ delivered_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ shipping_label_id:+ labels: []+ - id: ful_gbHJdmfrXB+ number: R1001-F2+ status: unfulfilled+ tracking:+ tracking_url:+ fulfilled_at:+ delivered_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ fulfillment_type: shipping+ delivery_method_name: UPS Ground 129+ stock_location_name: Fred Hand+ stock_location_id: sloc_UkLWZg9DAJ+ fulfillment_items:+ - id: fi_EfhxLZ9ck8+ quantity: 1+ line_item_id: li_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJ+ name: Product 2463520+ sku: SKU-328+ options_text: ''+ selected_delivery_rate_id: dr_VqXmZF31wY+ delivery_rates:+ - id: dr_VqXmZF31wY+ name: UPS Ground 129+ selected: true+ cost: '10.00'+ total: '10.00'+ carrier:+ service_level:+ estimated_delivery_date:+ unpriced: false+ deliveries: []+ labels: []+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/FulfillmentSplitParams"+ required: true"/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries":parameters:- name: order_id@@ -16912,7 +16698,47 @@ paths:required:- data- meta- "/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/labels":+ post:+ summary: Add a delivery+ tags:+ - Fulfillments+ security:+ - bearer_auth: []+ description: 'Adds a tracked consignment to the parcel: a second box, or a freight+ number covering several pallets.'+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: delivery added+ content:+ application/json:+ example:+ id: dlv_gbHJdmfrXB+ tracking_number: 1Z879E930346834440+ carrier: ups+ carrier_name: UPS+ service:+ status: pending+ tracking_url: https://www.ups.com/track?tracknum=1Z879E930346834440+ estimated_delivery_at:+ delivered_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ shipping_label_id:+ schema:+ "$ref": "#/components/schemas/Delivery"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DeliveryCreateParams"+ required: true+ "/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}":parameters:- name: order_idin: path@@ -16926,38 +16752,98 @@ paths:required: trueschema:type: string- get:- summary: List shipping labels+ - name: id+ in: path+ description: Prefixed delivery ID+ required: true+ schema:+ type: string+ patch:+ summary: Correct a deliverytags:- Fulfillmentssecurity:- bearer_auth: []- description: Every label bought or uploaded for one of this seller's parcels,- refunded ones included.+ description: Corrects the tracking number, carrier or link. A corrected number+ starts the carrier journey over.parameters:- name: X-Spree-Seller-Idin: headerrequired: trueschema:type: string- - name: page- in: query- required: false- description: Page number- schema:- type: integer- - name: limit- in: query- required: false- description: Records per page (max 100)- schema:- type: integer- - name: q- in: query- required: false- style: deepObject- explode: true- schema:+ responses:+ '200':+ description: delivery updated+ content:+ application/json:+ example:+ id: dlv_UkLWZg9DAJ+ tracking_number: CORRECTED-1+ carrier:+ carrier_name:+ service:+ status: pending+ tracking_url:+ estimated_delivery_at:+ delivered_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ shipping_label_id:+ schema:+ "$ref": "#/components/schemas/Delivery"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/DeliveryUpdateParams"+ required: true+ "/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/labels":+ parameters:+ - name: order_id+ in: path+ description: Prefixed order ID+ required: true+ schema:+ type: string+ - name: fulfillment_id+ in: path+ description: Prefixed fulfillment ID+ required: true+ schema:+ type: string+ get:+ summary: List shipping labels+ tags:+ - Fulfillments+ security:+ - bearer_auth: []+ description: Every label bought or uploaded for one of this seller's parcels,+ refunded ones included.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ 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 (max 100)+ schema:+ type: integer+ - name: q+ in: query+ required: false+ style: deepObject+ explode: true+ schema:type: objectadditionalProperties: truedescription: Attribute filters, as `q[<attribute>_<predicate>]=value`. See@@ -17038,6 +16924,57 @@ paths:required:- data- meta+ post:+ summary: Upload a shipping label+ tags:+ - Fulfillments+ security:+ - bearer_auth: []+ description: |+ Records a label the seller bought elsewhere. Upload the file with+ `POST /files` first and send its `signed_id` as `file_signed_id`.+ Buying a label needs the marketplace's carrier account, so a request+ without a file is refused.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: label recorded+ content:+ application/json:+ example:+ id: lbl_UkLWZg9DAJ+ source: uploaded+ status: purchased+ carrier:+ carrier_name:+ service:+ tracking_number: SELLER-LBL-1+ currency: USD+ format: pdf+ external_id:+ metadata: {}+ refunded_at:+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ owner_id: ful_UkLWZg9DAJ+ owner_type: fulfillment+ cost: '4.20'+ integration_id:+ file_pending: false+ download_url: "/api/v3/seller/orders/or_UkLWZg9DAJ/fulfillments/ful_UkLWZg9DAJ/labels/lbl_UkLWZg9DAJ/download"+ schema:+ "$ref": "#/components/schemas/ShippingLabel"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ShippingLabelCreateParams"+ required: true"/api/v3/seller/tracking_carriers":get:summary: List tracking carriers@@ -17367,6 +17304,384 @@ paths:required:- data- meta+ post:+ summary: Create an import+ tags:+ - Imports+ security:+ - bearer_auth: []+ description: |+ Starts a product CSV import for this seller. Upload the CSV with `POST /files`+ (`visibility: 'private'`) and pass the returned `signed_id` as+ `attachment_signed_id`. On success the import is in the `mapping` state, carrying+ the auto-assigned column `mappings`; confirm them with+ `PATCH /imports/{id}/complete_mapping`. Imported products are created as drafts.+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: import created in mapping state+ content:+ application/json:+ example:+ id: imp_gbHJdmfrXB+ number: IM1002+ rows_count: 0+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: products+ status: mapping+ store_id: store_UkLWZg9DAJ+ seller_id: sel_UkLWZg9DAJ+ owner_type: seller+ owner_id: sel_UkLWZg9DAJ+ user_id: adm_UkLWZg9DAJ+ processing_errors:+ delimiter: ","+ original_filename: import.csv+ original_byte_size: 44+ original_file_url: "/api/v3/seller/imports/imp_gbHJdmfrXB/download"+ completed_rows_count: 0+ failed_rows_count: 0+ schema_fields:+ - name: slug+ label: Slug+ required: true+ - name: sku+ label: SKU+ required: true+ - name: name+ label: Name+ required: true+ - name: price+ label: Price+ required: true+ - name: status+ label: Status+ required: false+ - name: description+ label: Description+ required: false+ - name: meta_title+ label: Meta Title+ required: false+ - name: meta_description+ label: Meta Description+ required: false+ - name: meta_keywords+ label: Meta Keywords+ required: false+ - name: tags+ label: Tags+ required: false+ - name: compare_at_price+ label: Compare at Price+ required: false+ - name: currency+ label: Currency+ required: false+ - name: width+ label: Width+ required: false+ - name: height+ label: Height+ required: false+ - name: depth+ label: Depth+ required: false+ - name: dimensions_unit+ label: Dimensions Unit+ required: false+ - name: weight+ label: Weight+ required: false+ - name: weight_unit+ label: Weight Unit+ required: false+ - name: available_on+ label: Available On+ required: false+ - name: discontinue_on+ label: Discontinue On+ required: false+ - name: track_inventory+ label: Track Inventory+ required: false+ - name: inventory_count+ label: Inventory Count+ required: false+ - name: inventory_backorderable+ label: Inventory Backorderable+ required: false+ - name: stock_location+ label: Stock Location+ required: false+ - name: tax_category+ label: Tax Category+ required: false+ - name: product_type+ label: Product Type+ required: false+ - name: hs_code+ label: HS Code+ required: false+ - name: country_of_origin+ label: Country of Origin+ required: false+ - name: customs_description+ label: Customs Description+ required: false+ - name: carton+ label: Carton+ required: false+ - name: units_per_carton+ label: Units per Carton+ required: false+ - name: carton_weight+ label: Carton Weight+ required: false+ - name: cartons_per_pallet+ label: Cartons per Pallet+ required: false+ - name: image1_src+ label: Image 1 URL+ required: false+ - name: image2_src+ label: Image 2 URL+ required: false+ - name: image3_src+ label: Image 3 URL+ required: false+ - name: option1_name+ label: Option 1 Name+ required: false+ - name: option1_value+ label: Option 1 Value+ required: false+ - name: option2_name+ label: Option 2 Name+ required: false+ - name: option2_value+ label: Option 2 Value+ required: false+ - name: option3_name+ label: Option 3 Name+ required: false+ - name: option3_value+ label: Option 3 Value+ required: false+ - name: category1+ label: Category 1+ required: false+ - name: category2+ label: Category 2+ required: false+ - name: category3+ label: Category 3+ required: false+ csv_headers:+ - slug+ - sku+ - name+ - price+ sample_row:+ slug: widget+ sku: W-1+ name: Widget+ price: '10.00'+ mappings:+ - id: immap_UkLWZg9DAJ+ schema_field: slug+ file_column: slug+ required: true+ - id: immap_gbHJdmfrXB+ schema_field: sku+ file_column: sku+ required: true+ - id: immap_EfhxLZ9ck8+ schema_field: name+ file_column: name+ required: true+ - id: immap_VqXmZF31wY+ schema_field: price+ file_column: price+ required: true+ - id: immap_uw2YK1rnl0+ schema_field: status+ file_column:+ required: false+ - id: immap_OIJLhNcSbf+ schema_field: description+ file_column:+ required: false+ - id: immap_AXs1igzRC6+ schema_field: meta_title+ file_column:+ required: false+ - id: immap_p6klVeMgbn+ schema_field: meta_description+ file_column:+ required: false+ - id: immap_nJqfPa3Cpe+ schema_field: meta_keywords+ file_column:+ required: false+ - id: immap_98FqgRua4h+ schema_field: tags+ file_column:+ required: false+ - id: immap_xhoCpeNMWu+ schema_field: compare_at_price+ file_column:+ required: false+ - id: immap_vEmzDoNU0H+ schema_field: currency+ file_column:+ required: false+ - id: immap_2KY5XM6frI+ schema_field: width+ file_column:+ required: false+ - id: immap_HOVtlDrOmL+ schema_field: height+ file_column:+ required: false+ - id: immap_ed6l8wVqSM+ schema_field: depth+ file_column:+ required: false+ - id: immap_s18jaGonyx+ schema_field: dimensions_unit+ file_column:+ required: false+ - id: immap_GZUcnUYI5A+ schema_field: weight+ file_column:+ required: false+ - id: immap_ROeNhrwyV9+ schema_field: weight_unit+ file_column:+ required: false+ - id: immap_L3pHOn63Vw+ schema_field: available_on+ file_column:+ required: false+ - id: immap_PQNMcnNFWw+ schema_field: discontinue_on+ file_column:+ required: false+ - id: immap_C9SrJgpzQ4+ schema_field: track_inventory+ file_column:+ required: false+ - id: immap_YHETxCGlb0+ schema_field: inventory_count+ file_column:+ required: false+ - id: immap_5OQZnCRf8J+ schema_field: inventory_backorderable+ file_column:+ required: false+ - id: immap_F0GX8NaP3Y+ schema_field: stock_location+ file_column:+ required: false+ - id: immap_kOKT9MVfb0+ schema_field: tax_category+ file_column:+ required: false+ - id: immap_3uWpPTcf5W+ schema_field: product_type+ file_column:+ required: false+ - id: immap_D6Psx31WaT+ schema_field: hs_code+ file_column:+ required: false+ - id: immap_msx3nOJap6+ schema_field: country_of_origin+ file_column:+ required: false+ - id: immap_5CQZnCRf8J+ schema_field: customs_description+ file_column:+ required: false+ - id: immap_M2nyloHRUQ+ schema_field: carton+ file_column:+ required: false+ - id: immap_prklVeMgbn+ schema_field: units_per_carton+ file_column:+ required: false+ - id: immap_so8jaGonyx+ schema_field: carton_weight+ file_column:+ required: false+ - id: immap_rsClYtECFI+ schema_field: cartons_per_pallet+ file_column:+ required: false+ - id: immap_8DR0I7fEbw+ schema_field: image1_src+ file_column:+ required: false+ - id: immap_aAtNvLSUAr+ schema_field: image2_src+ file_column:+ required: false+ - id: immap_QiA48cIW7A+ schema_field: image3_src+ file_column:+ required: false+ - id: immap_QDA48cIW7A+ schema_field: option1_name+ file_column:+ required: false+ - id: immap_8cR0I7fEbw+ schema_field: option1_value+ file_column:+ required: false+ - id: immap_oqlrKdXjaP+ schema_field: option2_name+ file_column:+ required: false+ - id: immap_48Olu6p4zZ+ schema_field: option2_value+ file_column:+ required: false+ - id: immap_qp31JYFduR+ schema_field: option3_name+ file_column:+ required: false+ - id: immap_JgaEBgznCp+ schema_field: option3_value+ file_column:+ required: false+ - id: immap_tXyJwvFCuK+ schema_field: category1+ file_column:+ required: false+ - id: immap_NJzXvxTk8u+ schema_field: category2+ file_column:+ required: false+ - id: immap_XLbb5HTmVa+ schema_field: category3+ file_column:+ required: false+ schema:+ "$ref": "#/components/schemas/Import"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ImportCreateParams"+ required: true"/api/v3/seller/imports/{import_id}/rows":parameters:- name: import_id@@ -17476,6 +17791,381 @@ paths:required:- data- meta+ "/api/v3/seller/imports/{id}/complete_mapping":+ parameters:+ - name: id+ in: path+ required: true+ description: Import prefixed ID+ schema:+ type: string+ patch:+ summary: Complete mapping and start processing+ tags:+ - Imports+ security:+ - bearer_auth: []+ description: |+ Applies the submitted column mappings, then starts row processing. Omit `mappings`+ to accept the auto-assigned ones from the create response. Returns 422 when a+ required field is left unmapped (`details.missing_required_fields`).+ parameters:+ - name: X-Spree-Seller-Id+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: mapping completed, processing queued+ content:+ application/json:+ example:+ id: imp_UkLWZg9DAJ+ number: IM1001+ rows_count: 0+ created_at: '2026-01-15T12:00:00.000Z'+ updated_at: '2026-01-15T12:00:00.000Z'+ type: products+ status: completed_mapping+ store_id: store_UkLWZg9DAJ+ seller_id: sel_UkLWZg9DAJ+ owner_type: seller+ owner_id: sel_UkLWZg9DAJ+ user_id: adm_UkLWZg9DAJ+ processing_errors:+ delimiter: ","+ original_filename: products_import.csv+ original_byte_size: 3627+ original_file_url: "/api/v3/seller/imports/imp_UkLWZg9DAJ/download"+ completed_rows_count: 0+ failed_rows_count: 0+ schema_fields:+ - name: slug+ label: Slug+ required: true+ - name: sku+ label: SKU+ required: true+ - name: name+ label: Name+ required: true+ - name: price+ label: Price+ required: true+ - name: status+ label: Status+ required: false+ - name: description+ label: Description+ required: false+ - name: meta_title+ label: Meta Title+ required: false+ - name: meta_description+ label: Meta Description+ required: false+ - name: meta_keywords+ label: Meta Keywords+ required: false+ - name: tags+ label: Tags+ required: false+ - name: compare_at_price+ label: Compare at Price+ required: false+ - name: currency+ label: Currency+ required: false+ - name: width+ label: Width+ required: false+ - name: height+ label: Height+ required: false+ - name: depth+ label: Depth+ required: false+ - name: dimensions_unit+ label: Dimensions Unit+ required: false+ - name: weight+ label: Weight+ required: false+ - name: weight_unit+ label: Weight Unit+ required: false+ - name: available_on+ label: Available On+ required: false+ - name: discontinue_on+ label: Discontinue On+ required: false+ - name: track_inventory+ label: Track Inventory+ required: false+ - name: inventory_count+ label: Inventory Count+ required: false+ - name: inventory_backorderable+ label: Inventory Backorderable+ required: false+ - name: stock_location+ label: Stock Location+ required: false+ - name: tax_category+ label: Tax Category+ required: false+ - name: product_type+ label: Product Type+ required: false+ - name: hs_code+ label: HS Code+ required: false+ - name: country_of_origin+ label: Country of Origin+ required: false+ - name: customs_description+ label: Customs Description+ required: false+ - name: carton+ label: Carton+ required: false+ - name: units_per_carton+ label: Units per Carton+ required: false+ - name: carton_weight+ label: Carton Weight+ required: false+ - name: cartons_per_pallet+ label: Cartons per Pallet+ required: false+ - name: image1_src+ label: Image 1 URL+ required: false+ - name: image2_src+ label: Image 2 URL+ required: false+ - name: image3_src+ label: Image 3 URL+ required: false+ - name: option1_name+ label: Option 1 Name+ required: false+ - name: option1_value+ label: Option 1 Value+ required: false+ - name: option2_name+ label: Option 2 Name+ required: false+ - name: option2_value+ label: Option 2 Value+ required: false+ - name: option3_name+ label: Option 3 Name+ required: false+ - name: option3_value+ label: Option 3 Value+ required: false+ - name: category1+ label: Category 1+ required: false+ - name: category2+ label: Category 2+ required: false+ - name: category3+ label: Category 3+ required: false+ csv_headers: []+ sample_row: {}+ mappings:+ - id: immap_UkLWZg9DAJ+ schema_field: slug+ file_column: slug+ required: true+ - id: immap_gbHJdmfrXB+ schema_field: sku+ file_column: sku+ required: true+ - id: immap_EfhxLZ9ck8+ schema_field: name+ file_column: name+ required: true+ - id: immap_VqXmZF31wY+ schema_field: price+ file_column: price+ required: true+ - id: immap_uw2YK1rnl0+ schema_field: status+ file_column: status+ required: false+ - id: immap_OIJLhNcSbf+ schema_field: description+ file_column: description+ required: false+ - id: immap_AXs1igzRC6+ schema_field: meta_title+ file_column: meta_title+ required: false+ - id: immap_p6klVeMgbn+ schema_field: meta_description+ file_column: meta_description+ required: false+ - id: immap_nJqfPa3Cpe+ schema_field: meta_keywords+ file_column: meta_keywords+ required: false+ - id: immap_98FqgRua4h+ schema_field: tags+ file_column: tags+ required: false+ - id: immap_xhoCpeNMWu+ schema_field: compare_at_price+ file_column: compare_at_price+ required: false+ - id: immap_vEmzDoNU0H+ schema_field: currency+ file_column: currency+ required: false+ - id: immap_2KY5XM6frI+ schema_field: width+ file_column: width+ required: false+ - id: immap_HOVtlDrOmL+ schema_field: height+ file_column: height+ required: false+ - id: immap_ed6l8wVqSM+ schema_field: depth+ file_column: depth+ required: false+ - id: immap_s18jaGonyx+ schema_field: dimensions_unit+ file_column: dimensions_unit+ required: false+ - id: immap_GZUcnUYI5A+ schema_field: weight+ file_column: weight+ required: false+ - id: immap_ROeNhrwyV9+ schema_field: weight_unit+ file_column: weight_unit+ required: false+ - id: immap_L3pHOn63Vw+ schema_field: available_on+ file_column: available_on+ required: false+ - id: immap_PQNMcnNFWw+ schema_field: discontinue_on+ file_column: discontinue_on+ required: false+ - id: immap_C9SrJgpzQ4+ schema_field: track_inventory+ file_column: track_inventory+ required: false+ - id: immap_YHETxCGlb0+ schema_field: inventory_count+ file_column: inventory_count+ required: false+ - id: immap_5OQZnCRf8J+ schema_field: inventory_backorderable+ file_column: inventory_backorderable+ required: false+ - id: immap_F0GX8NaP3Y+ schema_field: stock_location+ file_column:+ required: false+ - id: immap_kOKT9MVfb0+ schema_field: tax_category+ file_column: tax_category+ required: false+ - id: immap_3uWpPTcf5W+ schema_field: product_type+ file_column:+ required: false+ - id: immap_D6Psx31WaT+ schema_field: hs_code+ file_column:+ required: false+ - id: immap_msx3nOJap6+ schema_field: country_of_origin+ file_column:+ required: false+ - id: immap_5CQZnCRf8J+ schema_field: customs_description+ file_column:+ required: false+ - id: immap_M2nyloHRUQ+ schema_field: carton+ file_column:+ required: false+ - id: immap_prklVeMgbn+ schema_field: units_per_carton+ file_column:+ required: false+ - id: immap_so8jaGonyx+ schema_field: carton_weight+ file_column:+ required: false+ - id: immap_rsClYtECFI+ schema_field: cartons_per_pallet+ file_column:+ required: false+ - id: immap_8DR0I7fEbw+ schema_field: image1_src+ file_column: image1_src+ required: false+ - id: immap_aAtNvLSUAr+ schema_field: image2_src+ file_column: image2_src+ required: false+ - id: immap_QiA48cIW7A+ schema_field: image3_src+ file_column: image3_src+ required: false+ - id: immap_QDA48cIW7A+ schema_field: option1_name+ file_column: option1_name+ required: false+ - id: immap_8cR0I7fEbw+ schema_field: option1_value+ file_column: option1_value+ required: false+ - id: immap_oqlrKdXjaP+ schema_field: option2_name+ file_column: option2_name+ required: false+ - id: immap_48Olu6p4zZ+ schema_field: option2_value+ file_column: option2_value+ required: false+ - id: immap_qp31JYFduR+ schema_field: option3_name+ file_column: option3_name+ required: false+ - id: immap_JgaEBgznCp+ schema_field: option3_value+ file_column: option3_value+ required: false+ - id: immap_tXyJwvFCuK+ schema_field: category1+ file_column: category1+ required: false+ - id: immap_NJzXvxTk8u+ schema_field: category2+ file_column: category2+ required: false+ - id: immap_XLbb5HTmVa+ schema_field: category3+ file_column: category3+ required: false+ schema:+ "$ref": "#/components/schemas/Import"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ImportCompleteMappingParams""/api/v3/seller/orders":get:summary: List orders@@ -17640,7 +18330,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 20995+ name: Product 25495options_text: ''quantity: 1currency: USD@@ -17649,7 +18339,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-280+ sku: SKU-336thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -17662,7 +18352,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 100+ delivery_method_name: UPS Ground 136stock_location_name: Roseline Robertsstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -17670,13 +18360,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 20995- sku: SKU-280+ name: Product 25495+ sku: SKU-336options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 100+ name: UPS Ground 136selected: truecost: '10.00'total: '10.00'@@ -17704,7 +18394,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 196 Lovely Street+ address1: 263 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -17726,7 +18416,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 195 Lovely Street+ address1: 262 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -17827,7 +18517,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 2109755+ name: Product 2559755options_text: ''quantity: 1currency: USD@@ -17836,7 +18526,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-281+ sku: SKU-337thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -17849,7 +18539,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 101+ delivery_method_name: UPS Ground 137stock_location_name: Woodrow Handstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -17857,13 +18547,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2109755- sku: SKU-281+ name: Product 2559755+ sku: SKU-337options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 101+ name: UPS Ground 137selected: truecost: '10.00'total: '10.00'@@ -17891,7 +18581,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 198 Lovely Street+ address1: 265 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -17913,7 +18603,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 197 Lovely Street+ address1: 264 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18010,7 +18700,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 2136554+ name: Product 2586554options_text: ''quantity: 1currency: USD@@ -18019,7 +18709,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-284+ sku: SKU-340thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -18032,21 +18722,21 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 104- stock_location_name: Ricky Kutch+ delivery_method_name: UPS Ground 140+ stock_location_name: Savanna Hillsstock_location_id: sloc_UkLWZg9DAJfulfillment_items:- id: fi_UkLWZg9DAJquantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2136554- sku: SKU-284+ name: Product 2586554+ sku: SKU-340options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 104+ name: UPS Ground 140selected: truecost: '10.00'total: '10.00'@@ -18074,7 +18764,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 204 Lovely Street+ address1: 271 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18096,7 +18786,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 203 Lovely Street+ address1: 270 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18118,22 +18808,7 @@ paths:content:application/json:schema:- type: object- properties:- cancel_reason_id:- type: string- nullable: true- description: A reason from GET /order_cancellation_reasons- cancel_note:- type: string- nullable: true- description: Free text beside the reason- refund_payments:- type: boolean- description: Hand back what the buyer paid for this order's goods- notify_customer:- type: boolean- description: Email the customer about the cancellation+ "$ref": "#/components/schemas/OrderCancelParams""/api/v3/seller/orders/{id}/address":parameters:- name: id@@ -18200,7 +18875,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 2145038+ name: Product 2595038options_text: ''quantity: 1currency: USD@@ -18209,7 +18884,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-285+ sku: SKU-341thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -18222,7 +18897,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 105+ delivery_method_name: UPS Ground 141stock_location_name: Rudy Mosciskistock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -18230,13 +18905,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2145038- sku: SKU-285+ name: Product 2595038+ sku: SKU-341options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 105+ name: UPS Ground 141selected: truecost: '10.00'total: '10.00'@@ -18286,7 +18961,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 205 Lovely Street+ address1: 272 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18319,76 +18994,7 @@ paths:content:application/json:schema:- type: object- properties:- shipping_address:- type: object- description: Only the lines that change; the rest is carried over- properties:- first_name:- type: string- last_name:- type: string- company:- type: string- nullable: true- address1:- type: string- address2:- type: string- nullable: true- city:- type: string- postal_code:- type: string- country_code:- type: string- state_code:- type: string- nullable: true- state_name:- type: string- nullable: true- phone:- type: string- nullable: true- label:- type: string- nullable: true- billing_address:- type: object- description: Only the lines that change; the rest is carried over- properties:- first_name:- type: string- last_name:- type: string- company:- type: string- nullable: true- address1:- type: string- address2:- type: string- nullable: true- city:- type: string- postal_code:- type: string- country_code:- type: string- state_code:- type: string- nullable: true- state_name:- type: string- nullable: true- phone:- type: string- nullable: true- label:- type: string- nullable: true+ "$ref": "#/components/schemas/OrderAddressCorrectionParams"required: true"/api/v3/seller/orders/{order_id}/notes":parameters:@@ -18453,7 +19059,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 2163962+ name: Product 2613962options_text: ''quantity: 1currency: USD@@ -18462,7 +19068,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-287+ sku: SKU-343thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -18475,7 +19081,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 107+ delivery_method_name: UPS Ground 143stock_location_name: Kecia Pollichstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -18483,13 +19089,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2163962- sku: SKU-287+ name: Product 2613962+ sku: SKU-343options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 107+ name: UPS Ground 143selected: truecost: '10.00'total: '10.00'@@ -18517,7 +19123,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 210 Lovely Street+ address1: 277 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18539,7 +19145,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 209 Lovely Street+ address1: 276 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18612,7 +19218,7 @@ paths:cancel_note:items:- id: li_UkLWZg9DAJ- name: Product 2175749+ name: Product 2625749options_text: ''quantity: 1currency: USD@@ -18621,7 +19227,7 @@ paths:additional_tax_total: '0.00'total: '10.00'variant_id: variant_UkLWZg9DAJ- sku: SKU-288+ sku: SKU-344thumbnail_url:fulfillments:- id: ful_UkLWZg9DAJ@@ -18634,7 +19240,7 @@ paths:created_at: '2026-01-15T12:00:00.000Z'updated_at: '2026-01-15T12:00:00.000Z'fulfillment_type: shipping- delivery_method_name: UPS Ground 108+ delivery_method_name: UPS Ground 144stock_location_name: Ophelia Hartmannstock_location_id: sloc_UkLWZg9DAJfulfillment_items:@@ -18642,13 +19248,13 @@ paths:quantity: 1line_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ- name: Product 2175749- sku: SKU-288+ name: Product 2625749+ sku: SKU-344options_text: ''selected_delivery_rate_id: dr_gbHJdmfrXBdelivery_rates:- id: dr_gbHJdmfrXB- name: UPS Ground 108+ name: UPS Ground 144selected: truecost: '10.00'total: '10.00'@@ -18676,7 +19282,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 212 Lovely Street+ address1: 279 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18698,7 +19304,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 211 Lovely Street+ address1: 278 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -18731,16 +19337,7 @@ paths:content:application/json:schema:- type: object- properties:- customer_note:- type: string- nullable: true- description: What the buyer asked for- internal_note:- type: string- nullable: true- description: The seller's own working note, as HTML+ "$ref": "#/components/schemas/OrderNotesParams"required: true"/api/v3/seller/order_cancellation_reasons":get:@@ -19030,48 +19627,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- kind:- type: string- enum:- - box- - envelope- - carton- - pallet- - container- length:- type: number- nullable: true- width:- type: number- nullable: true- height:- type: number- nullable: true- dimensions_unit:- type: string- nullable: true- weight:- type: number- nullable: true- description: The empty package's own weight, added to every quote- max_weight:- type: number- nullable: true- weight_unit:- type: string- nullable: true- default:- type: boolean- metadata:- type: object- nullable: true- required:- - name- - kind+ "$ref": "#/components/schemas/PackageTypeParams"required: true"/api/v3/seller/package_types/{id}":parameters:@@ -19173,44 +19729,7 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- kind:- type: string- enum:- - box- - envelope- - carton- - pallet- - container- length:- type: number- nullable: true- width:- type: number- nullable: true- height:- type: number- nullable: true- dimensions_unit:- type: string- nullable: true- weight:- type: number- nullable: true- max_weight:- type: number- nullable: true- weight_unit:- type: string- nullable: true- default:- type: boolean- metadata:- type: object- nullable: true+ "$ref": "#/components/schemas/PackageTypeParams"required: truedelete:summary: Delete a package type@@ -19562,36 +20081,13 @@ paths:example:error:code: processing_error- message: Only 1 of Product 2337120 can be returned+ message: Only 1 of Product 2817120 can be returnedrequestBody:content:application/json:schema:- type: object- properties:- items:- type: array- items:- type: object- properties:- fulfillment_item_id:- type: string- quantity:- type: integer- required:- - fulfillment_item_id- - quantity- reason_id:- type: string- nullable: true- stock_location_id:- type: string- nullable: true- memo:- type: string- nullable: true- required:- - items+ "$ref": "#/components/schemas/ReturnCreateParams"+ required: true"/api/v3/seller/orders/{order_id}/returns/{id}/approve":parameters:- name: order_id@@ -19695,22 +20191,7 @@ paths:content:application/json:schema:- type: object- properties:- items:- type: array- items:- type: object- properties:- return_line_item_id:- type: string- quantity:- type: integer- resellable:- type: boolean- required:- - return_line_item_id- - quantity+ "$ref": "#/components/schemas/ReturnReceiveParams""/api/v3/seller/orders/{order_id}/returns/{id}/refund":parameters:- name: order_id@@ -19777,16 +20258,7 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- nullable: true- refund_method:- type: string- enum:- - original_payment- - store_credit+ "$ref": "#/components/schemas/ReturnRefundParams""/api/v3/seller/orders/{order_id}/returns/{id}/cancel":parameters:- name: order_id@@ -19829,12 +20301,17 @@ paths:received_at:refunded_at:canceled_at: '2026-01-15T12:00:00Z'- memo:+ memo: Customer decided to keep the goodsstock_location_id: sloc_UkLWZg9DAJrefunded_total: '0.00'refundable_total: '10.00'schema:"$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/ReturnCancelParams""/api/v3/seller/return_reasons":get:summary: List return reasons@@ -20033,17 +20510,8 @@ paths:content:application/json:schema:- type: object- properties:- kind:- type: string- example: eu_vat- value:- type: string- example: DE100000008- required:- - kind- - value+ "$ref": "#/components/schemas/SellerTaxIdentifierParams"+ required: true"/api/v3/seller/tax_identifiers/{id}":parameters:- name: id@@ -20081,14 +20549,8 @@ paths:content:application/json:schema:- type: object- properties:- kind:- type: string- example: eu_vat- value:- type: string- example: DE100000016+ "$ref": "#/components/schemas/SellerTaxIdentifierParams"+ required: truedelete:summary: Remove a tax registrationtags:@@ -22020,15 +22482,15 @@ components:- image- video- external_video+ external_video_url:+ type: string+ nullable: truefocal_point_x:type: numbernullable: truefocal_point_y:type: numbernullable: true- external_video_url:- type: string- nullable: truevideo_provider:type: stringnullable: true@@ -22073,9 +22535,9 @@ components:- position- alt- media_type+ - external_video_url- focal_point_x- focal_point_y- - external_video_url- video_provider- video_embed_url- video_url@@ -23920,6 +24382,1265 @@ components:required:- type- preferences+ AccountUpdateParams:+ type: object+ properties:+ first_name:+ type: string+ example: Ada+ last_name:+ type: string+ example: Lovelace+ selected_locale:+ type: string+ description: The panel's display language, as a code the panel ships.+ example: de+ avatar_signed_id:+ type: string+ description: A `signed_id` from `POST /files` to set the photo, or `null`+ to remove it. Omit to leave the current one alone.+ nullable: true+ ClaimCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the claim was canceled.+ ClaimCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ line_item_id:+ type: string+ quantity:+ type: integer+ description:+ type: string+ nullable: true+ send_replacement:+ type: boolean+ replacement_variant_id:+ type: string+ description: One of this seller's own variants.+ nullable: true+ refund_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ required:+ - line_item_id+ - quantity+ reason_id:+ type: string+ nullable: true+ memo:+ type: string+ nullable: true+ required:+ - items+ ClaimDenyParams:+ type: object+ properties:+ reason:+ type: string+ description: Recorded on the claim for the customer.+ ClaimResolveParams:+ type: object+ properties:+ resolution:+ type: string+ enum:+ - refund+ - replacement+ - refund_and_replacement+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: Defaults to `store_credit`.+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ replacement_line_item_ids:+ type: array+ items:+ type: string+ description: Which claimed lines to replace. Omit to keep the lines the+ claim was opened with.+ required:+ - resolution+ CustomFieldValueParams:+ type: object+ properties:+ id:+ type: string+ custom_field_definition_id:+ type: string+ value:+ description: A scalar for text, number and boolean fields; a list or a hash+ for JSON fields.+ DeliveryCreateParams:+ type: object+ properties:+ tracking_number:+ type: string+ description: A carrier tracking number, a freight PRO or container number,+ or a full tracking link. A corrected number resets the carrier status+ to `pending`.+ carrier:+ type: string+ description: Free text; detected from the number's format when omitted.+ service:+ type: string+ tracking_url:+ type: string+ required:+ - tracking_number+ DeliveryMethodParams:+ type: object+ properties:+ name:+ type: string+ admin_name:+ type: string+ nullable: true+ code:+ type: string+ nullable: true+ delivery_profile_id:+ type: string+ description: One of the marketplace's delivery profiles.+ delivery_zone_id:+ type: string+ description: Narrows where the method ships; null serves everywhere the+ profile reaches.+ 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+ calculator:+ type: object+ properties:+ type:+ type: string+ example: flat_rate+ preferences:+ type: object+ additionalProperties: true+ example:+ amount: '12.5'+ description: 'How the method is priced: a type from `/delivery_methods/calculators`+ and its preferences, per that type''s `schema`.'+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/DeliveryMethodRuleParams"+ description: 'Replaces the whole set: a rule dropped here is deleted, so+ re-send surviving rules with their `id`. An empty list clears every condition.'+ DeliveryMethodRuleParams:+ type: object+ properties:+ id:+ type: string+ type:+ type: string+ description: A type from `/delivery_methods/rule_types`.+ active:+ type: boolean+ preferences:+ type: object+ additionalProperties: true+ required:+ - type+ DeliveryUpdateParams:+ type: object+ properties:+ tracking_number:+ type: string+ description: A carrier tracking number, a freight PRO or container number,+ or a full tracking link. A corrected number resets the carrier status+ to `pending`.+ carrier:+ type: string+ description: Free text; detected from the number's format when omitted.+ service:+ type: string+ tracking_url:+ type: string+ ExchangeCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the exchange was canceled.+ ExchangeCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ fulfillment_item_id:+ type: string+ new_variant_id:+ type: string+ description: One of this seller's own variants.+ quantity:+ type: integer+ required:+ - fulfillment_item_id+ - new_variant_id+ - quantity+ reason_id:+ type: string+ nullable: true+ stock_location_id:+ type: string+ description: One of this seller's own stock locations, where the goods are+ restocked.+ nullable: true+ memo:+ type: string+ nullable: true+ required:+ - items+ ExchangeFulfillParams:+ type: object+ properties:+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: Defaults to `store_credit`.+ ExchangeReceiveParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ exchange_line_item_id:+ type: string+ quantity:+ type: integer+ resellable:+ type: boolean+ description: Goods that cannot be resold are received but never restocked.+ Defaults to true.+ required:+ - exchange_line_item_id+ - quantity+ description: What actually arrived. Omit to receive everything as requested+ and resellable.+ FileUploadCreateParams:+ type: object+ properties:+ filename:+ type: string+ example: registration.pdf+ content_type:+ type: string+ example: application/pdf+ byte_size:+ type: integer+ example: 51234+ checksum:+ type: string+ description: Base64-encoded MD5 digest of the file; the storage service+ checks the bytes against it.+ example: rL0Y20zC+Fzt72VPzMSk2A==+ visibility:+ type: string+ enum:+ - public+ - private+ description: "`public` (the default) for web images, videos and CSV, `private`+ for any type."+ file:+ type: string+ format: binary+ description: The bytes, for a multipart upload.+ required:+ - filename+ - content_type+ FulfillmentFulfillParams:+ type: object+ properties:+ tracking:+ type: string+ description: Carrier tracking number.+ tracking_carrier:+ type: string+ description: Carrier name.+ notify_customer:+ type: boolean+ description: Send the dispatch email (default true).+ items:+ type: array+ items:+ type: object+ properties:+ item_id:+ type: string+ description: Prefixed line item ID.+ quantity:+ type: integer+ required:+ - item_id+ - quantity+ description: Ship only these lines; the rest split onto a new fulfillment.+ FulfillmentSplitParams:+ type: object+ properties:+ variant_id:+ type: string+ description: The variant being moved out.+ quantity:+ type: integer+ stock_location_id:+ type: string+ description: One of this seller's own stock locations. Defaults to the source+ fulfillment's location.+ required:+ - variant_id+ - quantity+ FulfillmentUpdateParams:+ type: object+ properties:+ tracking:+ type: string+ nullable: true+ tracking_carrier:+ type: string+ nullable: true+ stock_location_id:+ type: string+ description: One of this seller's own stock locations; the rates requote+ from there.+ selected_delivery_rate_id:+ type: string+ description: One of the rates quoted for this parcel from its current origin.+ ImportCompleteMappingParams:+ type: object+ properties:+ mappings:+ type: array+ items:+ type: object+ properties:+ schema_field:+ type: string+ description: Canonical schema field name.+ file_column:+ type: string+ description: CSV header to read the field from; `null` unmaps the+ field.+ nullable: true+ required:+ - schema_field+ - file_column+ description: Column assignments to apply before processing starts.+ ImportCreateParams:+ type: object+ properties:+ type:+ type: string+ enum:+ - products+ attachment_signed_id:+ type: string+ description: 'The `signed_id` of the uploaded CSV, from `POST /files` with+ `visibility: ''private''`.'+ delimiter:+ type: string+ description: CSV column separator. Defaults to a comma.+ results_url:+ type: string+ description: Absolute URL of the panel's imports view; the import-done email+ links back to it. Honored only when it matches one of the store's allowed+ origins.+ required:+ - type+ - attachment_signed_id+ InvitationAcceptParams:+ type: object+ properties:+ password:+ type: string+ description: Sets the password of a new account, or confirms the password+ of an existing one.+ password_confirmation:+ type: string+ first_name:+ type: string+ description: Used only when the invitation creates a new account.+ last_name:+ type: string+ description: Used only when the invitation creates a new account.+ LoginParams:+ type: object+ properties:+ provider:+ type: string+ enum:+ description: The authentication method. Defaults to `email`.+ email:+ type: string+ example: [email protected]+ password:+ type: string+ example: password123+ required:+ - password+ OnboardingPayoutAccountParams:+ type: object+ properties:+ refresh_url:+ type: string+ format: uri+ description: Where the provider sends the seller back. Must be on the seller+ panel's origin; any other address is replaced with the panel's.+ return_url:+ type: string+ format: uri+ description: Where the provider sends the seller back. Must be on the seller+ panel's origin; any other address is replaced with the panel's.+ required:+ - refresh_url+ - return_url+ OrderAddressCorrectionParams:+ type: object+ properties:+ shipping_address:+ allOf:+ - "$ref": "#/components/schemas/OrderAddressParams"+ description: Only the lines that change; the rest of the address is carried+ over.+ billing_address:+ allOf:+ - "$ref": "#/components/schemas/OrderAddressParams"+ description: Only the lines that change; the rest of the address is carried+ over.+ OrderAddressParams:+ type: object+ properties:+ first_name:+ type: string+ last_name:+ type: string+ address1:+ type: string+ city:+ type: string+ postal_code:+ type: string+ zipcode:+ type: string+ company:+ type: string+ nullable: true+ address2:+ type: string+ nullable: true+ phone:+ type: string+ nullable: true+ alternative_phone:+ type: string+ nullable: true+ state_code:+ type: string+ nullable: true+ state_name:+ type: string+ nullable: true+ label:+ type: string+ nullable: true+ country_code:+ type: string+ example: US+ OrderCancelParams:+ type: object+ properties:+ cancel_reason_id:+ type: string+ description: A reason from the order cancellation reasons endpoint.+ nullable: true+ cancel_note:+ type: string+ description: Free text beside the reason.+ nullable: true+ refund_payments:+ type: boolean+ description: Hand back what the buyer paid for this order's goods.+ notify_customer:+ type: boolean+ description: Email the customer about the cancellation.+ OrderNotesParams:+ type: object+ properties:+ customer_note:+ type: string+ description: What the buyer asked for.+ nullable: true+ internal_note:+ type: string+ description: The seller's own working note, as HTML. Sanitized on save;+ `internal_note_html` reads it back.+ nullable: true+ PackageTypeParams:+ type: object+ properties:+ name:+ type: string+ kind:+ type: string+ enum:+ - box+ - envelope+ - carton+ - pallet+ - container+ length:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ nullable: true+ weight:+ type: number+ description: The empty package's own weight, added to every quote.+ nullable: true+ max_weight:+ type: number+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ nullable: true+ default:+ type: boolean+ description: Makes this the box this seller's parcels are quoted with. One+ default per seller, so it never displaces the marketplace's.+ metadata:+ type: object+ additionalProperties: true+ nullable: true+ PasswordResetCreateParams:+ type: object+ properties:+ email:+ type: string+ example: [email protected]+ redirect_url:+ type: string+ description: Must match an allowed origin of the store; ignored otherwise.+ example: https://sellers.your-store.com/reset-password+ required:+ PasswordResetUpdateParams:+ type: object+ properties:+ password:+ type: string+ example: new-password-123+ password_confirmation:+ type: string+ example: new-password-123+ required:+ - password+ - password_confirmation+ PolicyCreateParams:+ type: object+ properties:+ name:+ type: string+ description: 'When the marketplace requires a named policy, use that exact+ name: the onboarding check matches on it.'+ example: Shipping Policy+ slug:+ type: string+ example: shipping-policy+ body:+ type: string+ description: HTML, sanitized before it is stored. `body_html` on the response+ is the rendering of what was stored.+ example: "<p>Orders leave the workshop within two working days.</p>"+ nullable: true+ required:+ - name+ PolicyUpdateParams:+ type: object+ properties:+ name:+ type: string+ description: 'When the marketplace requires a named policy, use that exact+ name: the onboarding check matches on it.'+ example: Shipping Policy+ slug:+ type: string+ example: shipping-policy+ body:+ type: string+ description: HTML, sanitized before it is stored. `body_html` on the response+ is the rendering of what was stored.+ example: "<p>Orders leave the workshop within two working days.</p>"+ nullable: true+ ProductBulkStatusParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ example:+ - prod_UkLWZg9DAJ+ status:+ type: string+ enum:+ - draft+ - archived+ description: A listing goes on sale only when the marketplace approves it,+ so there is no bulk route onto `active`.+ required:+ - ids+ - status+ ProductBulkSubmitParams:+ type: object+ properties:+ ids:+ type: array+ items:+ type: string+ description: Only drafts and rejected listings are submitted; the rest are+ counted in `skipped_count`.+ required:+ - ids+ ProductParams:+ type: object+ properties:+ name:+ type: string+ example: Hand-thrown mug+ description:+ type: string+ slug:+ type: string+ example: hand-thrown-mug+ meta_title:+ type: string+ meta_description:+ type: string+ meta_keywords:+ type: string+ metadata:+ type: object+ additionalProperties: true+ product_type_id:+ type: string+ description: The marketplace's product type this product is listed against,+ from the product types endpoint. Null detaches it. Saving with a type+ seeds its option types onto the product.+ nullable: true+ delivery_profile_id:+ type: string+ description: Which of the marketplace's delivery profiles the product ships+ under. A new product sent without one lands on the profile marked default.+ prices:+ type: array+ items:+ type: object+ properties:+ currency:+ type: string+ description: Omit to price in the store's currency. A seller has no+ currency of their own.+ example: USD+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'A canonical decimal string (`"1234.56"`: period decimal,+ no grouping). The API does not parse localized input.'+ example: '24.00'+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '30.00'+ nullable: true+ required:+ - amount+ description: 'Shorthand for a simple (no-options) product: per-currency+ prices that forward to the product''s sole variant.'+ media:+ type: array+ items:+ "$ref": "#/components/schemas/SellerProductMediaParams"+ description: 'The gallery, as a whole: a file absent from the list is removed.+ `signed_id` attaches a fresh upload; `id` updates one already there.'+ variants:+ type: array+ items:+ "$ref": "#/components/schemas/SellerProductVariantParams"+ description: 'The variants, as a whole: one absent from the list is removed.+ Pass `id` to update an existing variant.'+ ProfileUpdateParams:+ type: object+ properties:+ name:+ type: string+ example: Acme Supplies+ contact_email:+ type: string+ format: email+ nullable: true+ billing_email:+ type: string+ format: email+ nullable: true+ about:+ type: string+ description: 'Sanitized HTML: the seller''s public description.'+ nullable: true+ legal_name:+ type: string+ description: The business a commission invoice is made out to.+ nullable: true+ registration_number:+ type: string+ nullable: true+ logo_signed_id:+ type: string+ description: A `signed_id` from `POST /files`; `null` removes the image.+ nullable: true+ square_logo_signed_id:+ type: string+ description: A `signed_id` from `POST /files`; `null` removes the image.+ nullable: true+ cover_photo_signed_id:+ type: string+ description: A `signed_id` from `POST /files`; `null` removes the image.+ nullable: true+ billing_address:+ "$ref": "#/components/schemas/SellerAddressParams"+ custom_fields:+ type: array+ items:+ "$ref": "#/components/schemas/CustomFieldValueParams"+ description: Answers to the custom fields this marketplace's onboarding+ asks for. A field nothing asked for is ignored rather than written.+ accept_terms:+ type: boolean+ description: 'Stamps the moment the seller accepted the marketplace''s terms.+ One-way: sending `false` does not unmake the stamp.'+ RequirementSubmissionParams:+ type: object+ properties:+ note:+ type: string+ description: Anything the seller wants to say alongside the submission.+ reference:+ type: string+ description: A reference number or external identifier, for requirements+ that ask for one.+ file_signed_id:+ type: string+ description: A `signed_id` from `POST /files`, for requirements that ask+ for a document.+ ReturnCancelParams:+ type: object+ properties:+ reason:+ type: string+ description: A note on why the return was canceled.+ ReturnCreateParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ fulfillment_item_id:+ type: string+ quantity:+ type: integer+ required:+ - fulfillment_item_id+ - quantity+ reason_id:+ type: string+ nullable: true+ stock_location_id:+ type: string+ description: One of this seller's own stock locations, where the goods are+ restocked.+ nullable: true+ memo:+ type: string+ nullable: true+ required:+ - items+ ReturnReceiveParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ return_line_item_id:+ type: string+ quantity:+ type: integer+ resellable:+ type: boolean+ description: Defaults to true.+ required:+ - return_line_item_id+ - quantity+ description: What actually arrived. Omit to receive everything as requested+ and resellable.+ ReturnRefundParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ refund_method:+ type: string+ enum:+ - original_payment+ - store_credit+ description: Defaults to `original_payment`.+ SellerAddressParams:+ type: object+ 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+ zipcode:+ type: string+ phone:+ type: string+ state_name:+ type: string+ label:+ type: string+ country_code:+ type: string+ description: ISO 3166-1 alpha-2 code, such as `US`.+ state_code:+ type: string+ description: The state or province abbreviation, such as `NY`.+ SellerExportCreateParams:+ type: object+ properties:+ type:+ type: string+ enum:+ - orders+ - products+ description: Which dataset to export.+ record_selection:+ type: string+ enum:+ - filtered+ - all+ description: "`filtered` (default) keeps `search_params`; `all` exports+ everything this seller owns."+ search_params:+ type: object+ additionalProperties: true+ description: Ransack predicates, the same shape the list endpoints take.+ Ignored when `record_selection` is `all`.+ results_url:+ type: string+ description: Panel URL the export-done email links back to. Honored only+ when it matches one of the store's allowed origins.+ required:+ - type+ SellerProductMediaParams:+ type: object+ properties:+ id:+ type: string+ signed_id:+ type: string+ description: A `signed_id` from `POST /files`.+ alt:+ type: string+ nullable: true+ position:+ type: integer+ media_type:+ type: string+ enum:+ - image+ - video+ - external_video+ external_video_url:+ type: string+ nullable: true+ poster_signed_id:+ type: string+ focal_point_x:+ type: number+ nullable: true+ focal_point_y:+ type: number+ nullable: true+ variant_ids:+ type: array+ items:+ type: string+ description: Replaces the variants this media is linked to. An empty list+ clears them.+ SellerProductVariantParams:+ type: object+ properties:+ id:+ type: string+ sku:+ type: string+ barcode:+ type: string+ cost_price:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ nullable: true+ cost_currency:+ type: string+ weight:+ type: number+ nullable: true+ height:+ type: number+ nullable: true+ width:+ type: number+ nullable: true+ depth:+ type: number+ nullable: true+ weight_unit:+ type: string+ enum:+ - g+ - kg+ - lb+ - oz+ dimensions_unit:+ type: string+ enum:+ - mm+ - cm+ - in+ - ft+ hs_code:+ type: string+ country_of_origin:+ type: string+ customs_description:+ type: string+ minimum_order_quantity:+ type: integer+ nullable: true+ order_multiple:+ type: integer+ nullable: true+ purchase_unit:+ type: string+ units_per_carton:+ type: integer+ description: How many units fill one carton.+ nullable: true+ carton_package_type_id:+ type: string+ description: 'The carton this variant is packed into: a package type of+ kind `carton`.'+ nullable: true+ carton_weight:+ type: number+ description: What one packed carton weighs, in the variant's weight unit.+ nullable: true+ cartons_per_pallet:+ type: integer+ description: How many cartons stack on one pallet.+ nullable: true+ track_inventory:+ type: boolean+ preorderable:+ type: boolean+ preorder_ships_at:+ type: string+ format: date-time+ description: The "ships by" date shown to customers while the variant is+ a pre-order. Null clears it.+ nullable: true+ backorder_limit:+ type: integer+ description: Maximum units sellable beyond available stock, capping backorders+ and pre-orders. Null is unlimited.+ nullable: true+ position:+ type: integer+ options:+ type: array+ items:+ "$ref": "#/components/schemas/VariantOptionParams"+ description: One pair per option type the variant takes part in (size, color).+ prices:+ type: array+ items:+ type: object+ properties:+ currency:+ type: string+ description: Omit to price in the store's currency. A seller has no+ currency of their own.+ example: USD+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: 'A canonical decimal string (`"1234.56"`: period decimal,+ no grouping). The API does not parse localized input.'+ example: '24.00'+ compare_at_amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '30.00'+ nullable: true+ required:+ - amount+ description: Per-currency prices. Upserted by currency.+ stock_levels:+ type: array+ items:+ "$ref": "#/components/schemas/StockLevelParams"+ description: 'Stock per location, at this seller''s own locations only:+ a location belonging to anyone else is ignored.'+ SellerTaxIdentifierParams:+ type: object+ properties:+ kind:+ type: string+ description: 'The registration the number belongs to, such as `eu_vat` or+ `gb_vat`. Any kind is accepted; one with a registered validator is checked+ by it. Built-in: `eu_vat`. Extensions may register more. One registration+ per kind.'+ example: eu_vat+ value:+ type: string+ description: A number the validator for its kind refuses is rejected rather+ than stored.+ example: DE100000008+ ShippingLabelCreateParams:+ type: object+ properties:+ file_signed_id:+ type: string+ description: A `signed_id` from `files.upload()`.+ tracking_number:+ type: string+ description: The number printed on the label.+ carrier:+ type: string+ description: Free text; a forwarder's name is as valid as a carrier slug.+ Detected from the number when omitted.+ service:+ type: string+ description: Carrier service the label was bought at.+ cost:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: What the seller paid the carrier. Accounting data only; it+ never touches the order's shipping charge.+ currency:+ type: string+ description: Currency of the cost.+ file_format:+ type: string+ enum:+ - png+ - zpl+ description: Taken from the file when omitted.+ tracking_url:+ type: string+ description: Tracking page for the consignment the label mints.+ required:+ - file_signed_id+ - tracking_number+ StockLevelParams:+ type: object+ properties:+ id:+ type: string+ stock_location_id:+ type: string+ description: The location holding the stock (`sloc_...`).+ count_on_hand:+ type: integer+ description: 'Units physically at the location, not units available to sell:+ stock promised to placed orders counts until it ships. Sent as the count+ the shelf should end at; the API records the difference as an adjustment+ in the stock history.'+ backorderable:+ type: boolean+ description: Whether this location sells the variant beyond what it holds.+ required:+ - stock_location_id+ - count_on_hand+ StockLocationParams:+ type: object+ properties:+ name:+ type: string+ example: Main warehouse+ admin_name:+ type: string+ nullable: true+ active:+ type: boolean+ description: 'Set `false` to retire a location: there is no delete.'+ default:+ type: boolean+ kind:+ type: string+ description: 'Categorizes the location. Built-in values: `warehouse`, `store`,+ `fulfillment_center`; extensions may add their own.'+ example: warehouse+ 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+ description: ISO-3166 alpha-2 country code.+ example: US+ nullable: true+ state_code:+ type: string+ description: State or province abbreviation, resolved against the selected+ country's states.+ example: OR+ nullable: true+ state_name:+ type: string+ description: Free-text state for countries that don't have a states list.+ nullable: true+ pickup_enabled:+ type: boolean+ pickup_stock_policy:+ type: string+ enum:+ - local+ - any+ description: "`local` collects only items at this location; `any` lets items+ transfer in from other locations (ship-to-store)."+ pickup_ready_in_minutes:+ type: integer+ nullable: true+ returns_enabled:+ type: boolean+ description: Whether customers may send returns to this location.+ pickup_instructions:+ type: string+ nullable: true+ TeamMemberCreateParams:+ type: object+ properties:+ email:+ type: string+ example: [email protected]+ required:+ VariantOptionParams:+ type: object+ properties:+ name:+ type: string+ example: size+ value:+ type: string+ example: Small+ required:+ - name+ - valuex-spree-filter-tables:Claim:attributes:diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yamlindex 398e0351b6..393d8ebd85 100644--- a/docs/api-reference/store.yaml+++ b/docs/api-reference/store.yaml@@ -229,13 +229,8 @@ paths:content:application/json:schema:- type: object- properties:- refresh_token:- type: string- description: Refresh token from login response- required:- - refresh_token+ "$ref": "#/components/schemas/RefreshTokenParams"+ required: true"/api/v3/store/auth/logout":post:summary: Logout@@ -273,11 +268,8 @@ paths:content:application/json:schema:- type: object- properties:- refresh_token:- type: string- description: Refresh token to revoke+ "$ref": "#/components/schemas/LogoutParams"+ required: true"/api/v3/store/password_resets":post:summary: Request a password reset@@ -335,21 +327,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- description: Email address of the account to reset- redirect_url:- type: string- format: uri- example: https://myshop.com/reset-password- description: URL to redirect the user to after clicking the reset- link. Validated against the store's allowed origins.- required:+ "$ref": "#/components/schemas/RequestPasswordResetParams"+ required: true"/api/v3/store/password_resets/{token}":patch:summary: Reset password with token@@ -439,18 +418,8 @@ paths:content:application/json:schema:- type: object- properties:- password:- type: string- minLength: 6- example: newsecurepassword- password_confirmation:- type: string- example: newsecurepassword- required:- - password- - password_confirmation+ "$ref": "#/components/schemas/ResetPasswordParams"+ required: true"/api/v3/store/categories":get:summary: List categories@@ -1128,8 +1097,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 2706979- slug: product-2706979+ name: Product 3226979+ slug: product-3226979meta_title:meta_description:meta_keywords:@@ -1419,8 +1388,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 3189085- slug: product-3189085+ name: Product 3709085+ slug: product-3709085meta_title:meta_description:meta_keywords:@@ -1449,8 +1418,8 @@ paths:original_price:seller_id:- id: prod_gbHJdmfrXB- name: Product 3198209- slug: product-3198209+ name: Product 3718209+ slug: product-3718209meta_title:meta_description:meta_keywords:@@ -1577,8 +1546,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 3466885- slug: product-3466885+ name: Product 3986885+ slug: product-3986885meta_title:meta_description:meta_keywords:@@ -1924,6 +1893,122 @@ paths:message: Valid API key requiredschema:"$ref": "#/components/schemas/ErrorResponse"+ "/api/v3/store/carts/{cart_id}/po_document":+ parameters:+ - name: cart_id+ in: path+ required: true+ description: Cart prefixed ID+ schema:+ type: string+ post:+ summary: Upload a purchase order document+ tags:+ - Carts+ security:+ - api_key: []+ bearer_auth: []+ description: |+ Prepares an upload for the buyer's signed purchase order document. Send the+ file's metadata, then `PUT` the bytes to `upload.url` with exactly+ `upload.headers`, and attach the file by sending the returned `signed_id` as+ `po_document_signed_id` on a cart update. Files are stored privately.+ `checksum` is the file's MD5 digest, base64-encoded. Returns 422 when the+ declared size or type is not accepted for a purchase order.+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: false+ schema:+ type: string+ - name: x-spree-token+ in: header+ required: false+ schema:+ type: string+ responses:+ '201':+ description: upload target created+ content:+ application/json:+ example:+ signed_id: eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNi0wMS0xNlQxMjowMDowMC4wMDBaIiwicHVyIjoiYmxvYl9pZCJ9fQ==--e3e622807fc2a4cbaf839915644236c074b14c7b+ filename: purchase-order.pdf+ content_type: application/pdf+ byte_size: 48210+ visibility: private+ expires_at: '2026-01-16T12:00:00.000Z'+ upload:+ method: PUT+ url: http://www.example.com/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiIwc3NuNW5kM3RneWtwcWJndXdybGprZjNwbjc4IiwiY29udGVudF90eXBlIjoiYXBwbGljYXRpb24vcGRmIiwiY29udGVudF9sZW5ndGgiOjQ4MjEwLCJjaGVja3N1bSI6IjVXMjhrY2ZxcDlLMGY1djRZN2VyUkE9PSIsInNlcnZpY2VfbmFtZSI6InRlc3QifSwiZXhwIjoiMjAyNi0wMS0xNVQxMjowNTowMC4wMDBaIiwicHVyIjoiYmxvYl90b2tlbiJ9fQ==--3750f7691683b5375486d3266b42be430e421821+ headers:+ Content-Type: application/pdf+ schema:+ "$ref": "#/components/schemas/FileUpload"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/CreatePoDocumentParams"+ required: true+ "/api/v3/store/carts/{cart_id}/tax_identifier":+ parameters:+ - name: cart_id+ in: path+ required: true+ description: Cart prefixed ID+ schema:+ type: string+ patch:+ summary: Set the cart tax identifier+ tags:+ - Carts+ security:+ - api_key: []+ bearer_auth: []+ description: |+ Sets the tax registration this cart is taxed against, overriding the one on the+ customer's profile — for a buyer paying through a different company than the one+ on their account. Send both `kind` and `value` every time. The cart's totals are+ recalculated. Returns 201 when the cart had no override yet, 200 when it replaced one.+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: false+ schema:+ type: string+ - name: x-spree-token+ in: header+ required: false+ schema:+ type: string+ responses:+ '201':+ description: tax identifier set+ content:+ application/json:+ example:+ id: txi_UkLWZg9DAJ+ kind: eu_vat+ value: DE100000008+ schema:+ "$ref": "#/components/schemas/TaxIdentifier"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/TaxIdentifierParams"+ required: true"/api/v3/store/carts":get:summary: List active carts@@ -2162,8 +2247,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 243715- slug: product-243715+ name: Product 293715+ slug: product-293715options_text: ''price: '10.00'display_price: "$10.00"@@ -2283,8 +2368,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2442171- slug: product-2442171+ name: Product 2942171+ slug: product-2942171options_text: ''price: '10.00'display_price: "$10.00"@@ -2485,30 +2570,7 @@ paths:content:application/json:schema:- type: object- properties:- metadata:- type: object- description: Write-only key-value metadata (Stripe-style).- items:- type: array- description: Items to add to the cart on creation- items:- type: object- properties:- variant_id:- type: string- example: variant_abc123- description: Prefixed variant ID- quantity:- type: integer- example: 2- description: Quantity (defaults to 1)- metadata:- type: object- additionalProperties: true- required:- - variant_id+ "$ref": "#/components/schemas/CreateCartParams""/api/v3/store/carts/{id}":get:summary: Get a cart@@ -2596,7 +2658,7 @@ paths:total_quantity: 0warnings:- code: line_item_removed- message: Product 248307 was removed because it was sold out+ message: Product 298307 was removed because it was sold outline_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJcoupon_code:@@ -2838,8 +2900,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2493263- slug: product-2493263+ name: Product 2993263+ slug: product-2993263options_text: ''price: '10.00'display_price: "$10.00"@@ -2887,72 +2949,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- customer_note:- type: string- example: Leave at door- metadata:- type: object- additionalProperties: true- shipping_address_id:- type: string- description: Existing address ID to use as shipping address- example: addr_abc123- billing_address_id:- type: string- description: Existing address ID to use as billing address- example: addr_def456- billing_address:- type: object- properties:- first_name:- type: string- last_name:- type: string- address1:- type: string- address2:- type: string- city:- type: string- postal_code:- type: string- phone:- type: string- company:- type: string- country_code:- type: string- state_code:- type: string- shipping_address:- type: object- properties:- first_name:- type: string- last_name:- type: string- address1:- type: string- address2:- type: string- city:- type: string- postal_code:- type: string- phone:- type: string- company:- type: string- country_code:- type: string- state_code:- type: string+ "$ref": "#/components/schemas/UpdateCartParams"+ required: truedelete:summary: Delete a carttags:@@ -3126,8 +3124,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2518992- slug: product-2518992+ name: Product 3018992+ slug: product-3018992options_text: ''price: '10.00'display_price: "$10.00"@@ -3158,7 +3156,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 283 Lovely Street+ address1: 354 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -3180,7 +3178,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 282 Lovely Street+ address1: 353 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -3341,8 +3339,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2544794- slug: product-2544794+ name: Product 3044794+ slug: product-3044794options_text: ''price: '10.00'display_price: "$10.00"@@ -3396,8 +3394,8 @@ paths:deliveries: []delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 127- code: UPS_GROUND_144+ name: UPS Ground 163+ code: UPS_GROUND_180estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -3418,7 +3416,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 127+ name: UPS Ground 163selected: truecost: '10.00'total: '10.00'@@ -3437,8 +3435,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 127- code: UPS_GROUND_144+ name: UPS Ground 163+ code: UPS_GROUND_180estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -3465,7 +3463,7 @@ paths:gateway_payment_profile_id:payment_method:id: pm_UkLWZg9DAJ- name: Check 5+ name: Check 8description:type: checksession_required: false@@ -3476,7 +3474,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 289 Lovely Street+ address1: 360 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -3498,7 +3496,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 288 Lovely Street+ address1: 359 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -3683,8 +3681,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2852614- slug: product-2852614+ name: Product 3372614+ slug: product-3372614options_text: ''price: '10.00'display_price: "$10.00"@@ -3742,14 +3740,8 @@ paths:content:application/json:schema:- type: object- properties:- code:- type: string- example: SAVE10- description: Promotion discount code to apply- required:- - code+ "$ref": "#/components/schemas/ApplyDiscountCodeParams"+ required: true"/api/v3/store/carts/{cart_id}/discount_codes/{id}":delete:summary: Remove discount code@@ -3884,8 +3876,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2863461- slug: product-2863461+ name: Product 3383461+ slug: product-3383461options_text: ''price: '10.00'display_price: "$10.00"@@ -4073,8 +4065,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2888182- slug: product-2888182+ name: Product 3408182+ slug: product-3408182options_text: ''price: '10.00'display_price: "$10.00"@@ -4128,8 +4120,8 @@ paths:deliveries: []delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 146- code: UPS_GROUND_164+ name: UPS Ground 184+ code: UPS_GROUND_202estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -4150,7 +4142,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 146+ name: UPS Ground 184selected: truecost: '10.00'total: '10.00'@@ -4169,8 +4161,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 146- code: UPS_GROUND_164+ name: UPS Ground 184+ code: UPS_GROUND_202estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -4184,7 +4176,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 395 Lovely Street+ address1: 472 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -4231,14 +4223,8 @@ paths:content:application/json:schema:- type: object- properties:- selected_delivery_rate_id:- type: string- example: dr_abc123- description: Delivery rate ID to select- required:- - selected_delivery_rate_id+ "$ref": "#/components/schemas/UpdateFulfillmentParams"+ required: true"/api/v3/store/carts/{cart_id}/gift_cards":post:summary: Apply gift card@@ -4372,8 +4358,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2905702- slug: product-2905702+ name: Product 3425702+ slug: product-3425702options_text: ''price: '10.00'display_price: "$10.00"@@ -4481,14 +4467,8 @@ paths:content:application/json:schema:- type: object- properties:- code:- type: string- example: GC-ABCD-1234- description: Gift card code to apply- required:- - code+ "$ref": "#/components/schemas/ApplyGiftCardParams"+ required: true"/api/v3/store/carts/{cart_id}/gift_cards/{id}":delete:summary: Remove gift card@@ -4622,8 +4602,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2949569- slug: product-2949569+ name: Product 3469569+ slug: product-3469569options_text: ''price: '10.00'display_price: "$10.00"@@ -4778,10 +4758,10 @@ paths:total_quantity: 2warnings:- code: delivery_unavailable- message: Product 29763 cannot be delivered to the selected address+ message: Product 34963 cannot be delivered to the selected addressline_item_id: li_UkLWZg9DAJ- code: delivery_unavailable- message: Product 298298 cannot be delivered to the selected address+ message: Product 350298 cannot be delivered to the selected addressline_item_id: li_gbHJdmfrXBcoupon_code:item_total: '29.99'@@ -4839,8 +4819,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 29763- slug: product-29763+ name: Product 34963+ slug: product-34963options_text: ''price: '10.00'display_price: "$10.00"@@ -4870,8 +4850,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 298298- slug: product-298298+ name: Product 350298+ slug: product-350298options_text: ''price: '19.99'display_price: "$19.99"@@ -4942,24 +4922,8 @@ paths:content:application/json:schema:- type: object- properties:- variant_id:- type: string- example: variant_abc123- description: Variant ID to add- quantity:- type: integer- example: 2- description: 'Quantity to add (default: 1)'- metadata:- type: object- additionalProperties: true- description: Arbitrary key-value metadata- example:- gift_message: Happy Birthday!- required:- - variant_id+ "$ref": "#/components/schemas/AddLineItemParams"+ required: true"/api/v3/store/carts/{cart_id}/items/{id}":patch:summary: Update line item quantity@@ -5102,8 +5066,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 3049165- slug: product-3049165+ name: Product 3569165+ slug: product-3569165options_text: ''price: '10.00'display_price: "$10.00"@@ -5151,18 +5115,8 @@ paths:content:application/json:schema:- type: object- properties:- quantity:- type: integer- minimum: 1- example: 5- metadata:- type: object- additionalProperties: true- description: Arbitrary key-value metadata (merged with existing)- example:- engraving: J.D.+ "$ref": "#/components/schemas/UpdateLineItemParams"+ required: truedelete:summary: Remove line item from carttags:@@ -5393,7 +5347,7 @@ paths:cart_id: cart_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 141+ name: Credit Card 201description:type: bogussession_required: true@@ -5404,22 +5358,8 @@ paths:content:application/json:schema:- type: object- properties:- payment_method_id:- type: string- example: pm_abc123- description: Payment method ID- amount:- type: string- example: '99.99'- description: Payment amount (defaults to order total minus store- credits)- external_data:- type: object- description: Provider-specific data passed to the gateway- required:- - payment_method_id+ "$ref": "#/components/schemas/CreatePaymentSessionParams"+ required: true"/api/v3/store/carts/{cart_id}/payment_sessions/{id}":parameters:- name: x-spree-api-key@@ -5494,7 +5434,7 @@ paths:cart_id: cart_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 142+ name: Credit Card 202description:type: bogussession_required: true@@ -5562,7 +5502,7 @@ paths:cart_id: cart_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 144+ name: Credit Card 204description:type: bogussession_required: true@@ -5573,15 +5513,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: string- example: '50.00'- description: Updated payment amount- external_data:- type: object- description: Provider-specific data to update+ "$ref": "#/components/schemas/UpdatePaymentSessionParams"+ required: true"/api/v3/store/carts/{cart_id}/payment_sessions/{id}/complete":parameters:- name: x-spree-api-key@@ -5670,7 +5603,7 @@ paths:cart_id: cart_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 145+ name: Credit Card 205description:type: bogussession_required: true@@ -5691,14 +5624,8 @@ paths:content:application/json:schema:- type: object- properties:- session_result:- type: string- description: Provider-specific session result token- external_data:- type: object- description: Provider-specific completion data+ "$ref": "#/components/schemas/CompletePaymentSessionParams"+ required: true"/api/v3/store/carts/{cart_id}/payments":post:summary: Create payment@@ -5771,7 +5698,7 @@ paths:source:payment_method:id: pm_UkLWZg9DAJ- name: Check 6+ name: Check 9description:type: checksession_required: false@@ -5793,22 +5720,8 @@ paths:content:application/json:schema:- type: object- properties:- payment_method_id:- type: string- example: pm_abc123- description: Payment method ID (must be a non-session payment method)- amount:- type: string- example: '99.99'- description: Payment amount (defaults to order total minus store- credits)- metadata:- type: object- description: Arbitrary metadata to attach to the payment- required:- - payment_method_id+ "$ref": "#/components/schemas/CreatePaymentParams"+ required: true"/api/v3/store/carts/{cart_id}/store_credits":post:summary: Apply store credit@@ -5936,8 +5849,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 3679789- slug: product-3679789+ name: Product 4219789+ slug: product-4219789options_text: ''price: '10.00'display_price: "$10.00"@@ -6020,12 +5933,8 @@ paths:content:application/json:schema:- type: object- properties:- amount:- type: number- example: 10.0- description: Amount to apply (optional - defaults to max available)+ "$ref": "#/components/schemas/ApplyStoreCreditParams"+ required: truedelete:summary: Remove store credittags:@@ -6150,8 +6059,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 369179- slug: product-369179+ name: Product 423179+ slug: product-423179options_text: ''price: '10.00'display_price: "$10.00"@@ -6310,6 +6219,60 @@ paths:required:- data- meta+ post:+ summary: Open a claim+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: Reports a damaged, missing or wrong item on one of the customer's+ orders. Approving, denying and resolving it are the merchant's. Accessible+ via JWT or the order token header for guests.+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: false+ description: Bearer token for authenticated customers+ schema:+ type: string+ - name: x-spree-token+ in: header+ required: false+ description: Order token for guest access+ schema:+ type: string+ responses:+ '201':+ description: claim opened+ content:+ application/json:+ example:+ id: claim_gbHJdmfrXB+ number: CLM1002+ status: open+ resolution:+ order_id: or_gbHJdmfrXB+ reason_id: clr_UkLWZg9DAJ+ refund_total: '0.00'+ display_refund_total: "$0.00"+ approved_at:+ resolved_at:+ denied_at:+ canceled_at:+ schema:+ "$ref": "#/components/schemas/Claim"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/CreateClaimParams"+ required: true"/api/v3/store/orders/{id}":get:summary: Get an order@@ -6446,8 +6409,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 308496- slug: product-308496+ name: Product 360496+ slug: product-360496options_text: ''price: '10.00'display_price: "$10.00"@@ -6510,8 +6473,8 @@ paths:delivered_at:delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 160- code: UPS_GROUND_178+ name: UPS Ground 198+ code: UPS_GROUND_216estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -6532,7 +6495,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 160+ name: UPS Ground 198selected: truecost: '10.00'total: '10.00'@@ -6551,8 +6514,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 160- code: UPS_GROUND_178+ name: UPS Ground 198+ code: UPS_GROUND_216estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -6565,7 +6528,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 451 Lovely Street+ address1: 528 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -6587,7 +6550,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 452 Lovely Street+ address1: 529 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -6745,6 +6708,61 @@ paths:required:- data- meta+ post:+ summary: Open a return+ tags:+ - Orders+ security:+ - api_key: []+ bearer_auth: []+ description: Opens a return for shipped units of one of the customer's orders.+ Approving, receiving and refunding it are the merchant's. Accessible via JWT+ or the order token header for guests.+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: false+ description: Bearer token for authenticated customers+ schema:+ type: string+ - name: x-spree-token+ in: header+ required: false+ description: Order token for guest access+ schema:+ type: string+ responses:+ '201':+ description: return opened+ content:+ application/json:+ example:+ id: ret_gbHJdmfrXB+ number: RET1002+ status: requested+ order_id: or_gbHJdmfrXB+ reason_id: rar_UkLWZg9DAJ+ refund_total: '10.00'+ display_refund_total: "$10.00"+ refund_tax_total: '0.00'+ display_refund_tax_total: "$0.00"+ approved_at:+ received_at:+ refunded_at:+ canceled_at:+ schema:+ "$ref": "#/components/schemas/Return"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/CreateReturnParams"+ required: true"/api/v3/store/customers/me/addresses":get:summary: List customer addresses@@ -6860,7 +6878,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 247 Lovely Street+ address1: 314 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -6881,7 +6899,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 248 Lovely Street+ address1: 315 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -6902,7 +6920,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 249 Lovely Street+ address1: 316 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -7050,60 +7068,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: John- last_name:- type: string- example: Doe- address1:- type: string- example: 123 Main St- address2:- type: string- example: Apt 4B- city:- type: string- example: New York- postal_code:- type: string- example: '10001'- phone:- type: string- example: "+1 555 123 4567"- company:- type: string- example: Acme Inc- country_code:- type: string- example: US- description: ISO 3166-1 alpha-2 country code (e.g., "US", "DE")- state_code:- type: string- example: NY- description: ISO 3166-2 subdivision code without country prefix- (e.g., "CA", "NY")- state_name:- type: string- example: New York- description: State name - for countries without predefined states- is_default_billing:- type: boolean- example: true- description: Set as default billing address- is_default_shipping:- type: boolean- example: true- description: Set as default shipping address- required:- - first_name- - last_name- - address1- - city- - postal_code- - country_code+ "$ref": "#/components/schemas/AddressParams"+ required: true"/api/v3/store/customers/me/addresses/{id}":get:summary: Get an address@@ -7160,7 +7126,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 261 Lovely Street+ address1: 328 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -7242,7 +7208,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 267 Lovely Street+ address1: 334 Lovely Streetaddress2: Northwestpostal_code: '10118'city: Los Angeles@@ -7264,28 +7230,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: John- last_name:- type: string- example: Doe- address1:- type: string- example: 456 Oak Ave- city:- type: string- example: Los Angeles- is_default_billing:- type: boolean- example: true- description: Set as default billing address- is_default_shipping:- type: boolean- example: true- description: Set as default shipping address+ "$ref": "#/components/schemas/AddressParams"+ required: truedelete:summary: Delete an addresstags:@@ -7810,8 +7756,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2725270- slug: product-2725270+ name: Product 3245270+ slug: product-3245270options_text: ''price: '10.00'display_price: "$10.00"@@ -7874,8 +7820,8 @@ paths:delivered_at:delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 138- code: UPS_GROUND_155+ name: UPS Ground 176+ code: UPS_GROUND_193estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -7896,7 +7842,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 138+ name: UPS Ground 176selected: truecost: '10.00'total: '10.00'@@ -7915,8 +7861,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 138- code: UPS_GROUND_155+ name: UPS Ground 176+ code: UPS_GROUND_193estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -7929,7 +7875,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 339 Lovely Street+ address1: 416 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -7951,7 +7897,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 340 Lovely Street+ address1: 417 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8134,8 +8080,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2745633- slug: product-2745633+ name: Product 3265633+ slug: product-3265633options_text: ''price: '10.00'display_price: "$10.00"@@ -8198,8 +8144,8 @@ paths:delivered_at:delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 140- code: UPS_GROUND_157+ name: UPS Ground 178+ code: UPS_GROUND_195estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -8220,7 +8166,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 140+ name: UPS Ground 178selected: truecost: '10.00'total: '10.00'@@ -8239,8 +8185,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 140- code: UPS_GROUND_157+ name: UPS Ground 178+ code: UPS_GROUND_195estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -8253,7 +8199,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 345 Lovely Street+ address1: 422 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8275,7 +8221,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 346 Lovely Street+ address1: 423 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8402,38 +8348,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- password:- type: string- minLength: 6- example: password123- password_confirmation:- type: string- example: password123- first_name:- type: string- example: John- last_name:- type: string- example: Doe- phone:- type: string- example: "+1234567890"- accepts_email_marketing:- type: boolean- example: true- metadata:- type: object- example:- source: storefront- required:- - password+ "$ref": "#/components/schemas/RegisterParams"+ required: true"/api/v3/store/customers/me":get:summary: Get current customer profile@@ -8498,7 +8414,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 351 Lovely Street+ address1: 428 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8519,7 +8435,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 352 Lovely Street+ address1: 429 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8541,7 +8457,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 352 Lovely Street+ address1: 429 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8563,7 +8479,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 351 Lovely Street+ address1: 428 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8655,7 +8571,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 353 Lovely Street+ address1: 430 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8676,7 +8592,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 354 Lovely Street+ address1: 431 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8698,7 +8614,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 354 Lovely Street+ address1: 431 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8720,7 +8636,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 353 Lovely Street+ address1: 430 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -8757,34 +8673,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: John- last_name:- type: string- example: Doe- email:- type: string- format: email- example: [email protected]- password:- type: string- example: newpassword123- password_confirmation:- type: string- example: newpassword123- accepts_email_marketing:- type: boolean- example: true- phone:- type: string- example: "+1 555 123 4567"- metadata:- type: object- example:- preferred_contact: email+ "$ref": "#/components/schemas/UpdateCustomerParams"+ required: true"/api/v3/store/customers/me/data_requests":get:summary: List data requests@@ -8964,17 +8854,7 @@ paths:content:application/json:schema:- type: object- properties:- kind:- type: string- enum:- - access- - erasure- description: Defaults to access- current_password:- type: string- description: Required for erasure+ "$ref": "#/components/schemas/CreateDataRequestParams""/api/v3/store/customers/me/data_requests/{id}":get:summary: Get a data request@@ -9344,7 +9224,7 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 147+ name: Credit Card 207description:type: bogussession_required: true@@ -9375,17 +9255,8 @@ paths:content:application/json:schema:- type: object- properties:- payment_method_id:- type: string- example: pm_abc123- description: Payment method ID- external_data:- type: object- description: Provider-specific data passed to the gateway- required:- - payment_method_id+ "$ref": "#/components/schemas/CreatePaymentSetupSessionParams"+ required: true"/api/v3/store/customers/me/payment_setup_sessions/{id}":parameters:- name: x-spree-api-key@@ -9445,7 +9316,7 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 150+ name: Credit Card 210description:type: bogussession_required: true@@ -9526,7 +9397,7 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method:id: pm_UkLWZg9DAJ- name: Credit Card 152+ name: Credit Card 212description:type: bogussession_required: true@@ -9547,11 +9418,7 @@ paths:content:application/json:schema:- type: object- properties:- external_data:- type: object- description: Provider-specific completion data+ "$ref": "#/components/schemas/CompletePaymentSetupSessionParams""/api/v3/store/customers/me/store_credits":get:summary: List store credits@@ -10660,19 +10527,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Birthday Ideas- is_private:- type: boolean- example: true- is_default:- type: boolean- example: false- required:- - name+ "$ref": "#/components/schemas/CreateWishlistParams"+ required: true"/api/v3/store/wishlists/{id}":get:summary: Get a wishlist@@ -10814,17 +10670,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Updated Name- is_private:- type: boolean- example: true- is_default:- type: boolean- example: false+ "$ref": "#/components/schemas/UpdateWishlistParams"+ required: truedelete:summary: Delete a wishlisttags:@@ -10925,7 +10772,7 @@ paths:variant:id: variant_gbHJdmfrXBproduct_id: prod_gbHJdmfrXB- sku: SKU-462+ sku: SKU-527options_text: ''track_inventory: truemedia_count: 0@@ -10962,34 +10809,109 @@ paths:content:application/json:schema:- type: object- properties:- variant_id:- type: string- example: variant_abc123- quantity:- type: integer- example: 1- required:- - variant_id+ "$ref": "#/components/schemas/CreateWishlistItemParams"+ required: true"/api/v3/store/wishlists/{wishlist_id}/items/{id}":- delete:- summary: Remove item from wishlist+ patch:+ summary: Update a wishlist itemtags:- Wishlistssecurity:- api_key: []bearer_auth: []- x-codeSamples:- - lang: javascript- label: Spree SDK- source: |-- import { createClient } from '@spree/sdk'-- const client = createClient({- baseUrl: 'https://your-store.com',- publishableKey: '<api-key>',- })+ description: Changes the quantity of a wishlist item, or moves it to another+ variant+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ - name: wishlist_id+ in: path+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: item updated+ content:+ application/json:+ example:+ id: wi_UkLWZg9DAJ+ variant_id: variant_UkLWZg9DAJ+ product_id: prod_UkLWZg9DAJ+ wishlist_id: wl_UkLWZg9DAJ+ quantity: 2+ variant:+ id: variant_UkLWZg9DAJ+ product_id: prod_UkLWZg9DAJ+ sku: SKU-528+ options_text: ''+ track_inventory: true+ media_count: 0+ preorder_ships_at:+ thumbnail_url:+ purchasable: true+ in_stock: false+ backorderable: true+ preorder: false+ weight: 0.0+ height:+ width:+ depth:+ weight_unit: lb+ dimensions_unit: in+ minimum_order_quantity: 1+ order_multiple: 1+ purchase_unit: unit+ units_per_carton:+ price:+ id: price_UkLWZg9DAJ+ currency: USD+ amount: '19.99'+ compare_at_amount:+ display_amount: "$19.99"+ display_compare_at_amount:+ price_list_id:+ original_price:+ seller_id:+ option_values: []+ schema:+ "$ref": "#/components/schemas/WishlistItem"+ requestBody:+ content:+ application/json:+ schema:+ "$ref": "#/components/schemas/UpdateWishlistItemParams"+ required: true+ delete:+ summary: Remove item from wishlist+ tags:+ - Wishlists+ security:+ - api_key: []+ bearer_auth: []+ x-codeSamples:+ - lang: javascript+ label: Spree SDK+ source: |-+ import { createClient } from '@spree/sdk'++ const client = createClient({+ baseUrl: 'https://your-store.com',+ publishableKey: '<api-key>',+ })await client.wishlists.items.delete('wl_abc123', 'wi_abc123', {token: '<token>',@@ -11121,22 +11043,8 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- redirect_url:- type: string- format: uri- example: https://your-store.com/newsletter/confirm- description: Storefront URL the verification token should be appended- to. Silently omitted from the webhook payload when the store has- allowed origins configured and this URL does not match one of- them, or when no allowed origins are configured at all.- required:+ "$ref": "#/components/schemas/CreateNewsletterSubscriberParams"+ required: true"/api/v3/store/newsletter_subscribers/verify":post:summary: Verify a newsletter subscription@@ -11200,14 +11108,8 @@ paths:content:application/json:schema:- type: object- properties:- token:- type: string- example: abc123def456- description: Verification token from the confirmation email- required:- - token+ "$ref": "#/components/schemas/VerifyNewsletterSubscriberParams"+ required: true"/api/v3/store/newsletter_subscribers/{id}":parameters:- name: id@@ -11291,18 +11193,7 @@ paths:content:application/json:schema:- type: object- properties:- email:- type: string- format: email- example: [email protected]- redirect_url:- type: string- format: uri- description: Storefront URL the unsubscribe token should be appended- to in the resulting email. Silently dropped from the event payload- if outside the store's allowed origins.+ "$ref": "#/components/schemas/RequestNewsletterUnsubscribeParams""/api/v3/store/policies":get:summary: List store policies@@ -11769,11 +11660,8 @@ paths:content:application/json:schema:- type: object- properties:- name:- type: string- example: Acme Industrial Group+ "$ref": "#/components/schemas/UpdateCompanyParams"+ required: true"/api/v3/store/companies/{company_id}/members":parameters:- name: company_id@@ -11908,13 +11796,8 @@ paths:content:application/json:schema:- type: object- properties:- customer_email:- type: string- example: [email protected]- required:- - customer_email+ "$ref": "#/components/schemas/AddCompanyMemberParams"+ required: true"/api/v3/store/companies/{company_id}/invitations":parameters:- name: company_id@@ -12097,7 +11980,7 @@ paths:first_name:last_name:full_name: ''- address1: 312 Lovely Street+ address1: 389 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -12168,7 +12051,7 @@ paths:first_name:last_name:full_name: ''- address1: 315 Lovely Street+ address1: 392 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -12188,14 +12071,8 @@ paths:content:application/json:schema:- type: object- properties:- label:- type: string- example: Northern Warehouse- default_shipping:- type: boolean- example: true+ "$ref": "#/components/schemas/CompanyAddressParams"+ required: truedelete:summary: Remove an address book entrytags:@@ -12432,8 +12309,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2715649- slug: product-2715649+ name: Product 3235649+ slug: product-3235649options_text: ''price: '10.00'display_price: "$10.00"@@ -12495,8 +12372,8 @@ paths:delivered_at:delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 129- code: UPS_GROUND_146+ name: UPS Ground 167+ code: UPS_GROUND_184estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12517,7 +12394,7 @@ paths:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ- name: UPS Ground 129+ name: UPS Ground 167selected: truecost: '10.00'total: '10.00'@@ -12536,8 +12413,8 @@ paths:display_tax_total: "$0.00"delivery_method:id: dm_UkLWZg9DAJ- name: UPS Ground 129- code: UPS_GROUND_146+ name: UPS Ground 167+ code: UPS_GROUND_184estimated_transit_business_days_min:estimated_transit_business_days_max:digital: false@@ -12550,7 +12427,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 323 Lovely Street+ address1: 400 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -12572,7 +12449,7 @@ paths:first_name: Johnlast_name: Doefull_name: John Doe- address1: 324 Lovely Street+ address1: 401 Lovely Streetaddress2: Northwestpostal_code: '10118'city: New York@@ -12713,20 +12590,8 @@ paths:content:application/json:schema:- type: object- properties:- first_name:- type: string- example: Ada- last_name:- type: string- example: Lovelace- password:- type: string- example: a-strong-password- password_confirmation:- type: string- example: a-strong-password+ "$ref": "#/components/schemas/AcceptCompanyInvitationParams"+ required: true"/api/v3/store/delivery_methods":get:summary: List delivery methods@@ -15768,15 +15633,15 @@ components:- image- video- external_video+ external_video_url:+ type: string+ nullable: truefocal_point_x:type: numbernullable: truefocal_point_y:type: numbernullable: true- external_video_url:- type: string- nullable: truevideo_provider:type: stringnullable: true@@ -15817,9 +15682,9 @@ components:- position- alt- media_type+ - external_video_url- focal_point_x- focal_point_y- - external_video_url- video_provider- video_embed_url- video_url@@ -17823,6 +17688,742 @@ components:- is_default- is_privatex-typelizer: true+ AcceptCompanyInvitationParams:+ type: object+ properties:+ first_name:+ type: string+ example: Ada+ last_name:+ type: string+ example: Lovelace+ phone:+ type: string+ password:+ type: string+ example: a-strong-password+ password_confirmation:+ type: string+ example: a-strong-password+ AddCompanyMemberParams:+ type: object+ properties:+ customer_email:+ type: string+ example: [email protected]+ required:+ - customer_email+ AddLineItemParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_abc123+ quantity:+ type: integer+ description: Defaults to 1.+ example: 2+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata.+ example:+ gift_message: Happy Birthday!+ options:+ type: object+ additionalProperties: true+ description: Values for line item attributes an extension adds.+ required:+ - variant_id+ AddressParams:+ type: object+ 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+ description: ISO 3166-1 alpha-2 country code, such as `US` or `DE`.+ example: US+ state_code:+ type: string+ description: ISO 3166-2 subdivision code without the country prefix, such+ as `CA` or `NY`.+ example: NY+ state_name:+ type: string+ description: The state name, for countries without predefined states.+ country_iso:+ type: string+ description: 'Deprecated: use `country_code`. Accepted until 6.1.'+ state_abbr:+ type: string+ description: 'Deprecated: use `state_code`. Accepted until 6.1.'+ is_default_billing:+ type: boolean+ description: Makes this the default billing address.+ is_default_shipping:+ type: boolean+ description: Makes this the default shipping address.+ ApplyDiscountCodeParams:+ type: object+ properties:+ code:+ type: string+ description: The promotion code to apply.+ example: SAVE10+ required:+ - code+ ApplyGiftCardParams:+ type: object+ properties:+ code:+ type: string+ description: The gift card code to apply.+ example: GC-ABCD-1234+ required:+ - code+ ApplyStoreCreditParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to as much as the cart can use.+ example: '10.00'+ CartAddressParams:+ type: object+ properties:+ id:+ type: string+ description: An existing address of the customer to use. The other fields+ are then ignored.+ 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+ description: ISO 3166-1 alpha-2 country code, such as `US` or `DE`.+ example: US+ state_code:+ type: string+ description: ISO 3166-2 subdivision code without the country prefix, such+ as `CA` or `NY`.+ example: NY+ state_name:+ type: string+ description: The state name, for countries without predefined states.+ country_iso:+ type: string+ description: 'Deprecated: use `country_code`. Accepted until 6.1.'+ state_abbr:+ type: string+ description: 'Deprecated: use `state_code`. Accepted until 6.1.'+ quick_checkout:+ type: boolean+ description: Relaxes validation (name, phone, postal code, street), for+ express checkouts that share a partial address.+ CompanyAddressParams:+ type: object+ 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+ zipcode:+ type: string+ phone:+ type: string+ state_name:+ type: string+ label:+ type: string+ country_code:+ type: string+ description: ISO 3166-1 alpha-2 code, such as `US`.+ state_code:+ type: string+ description: The state or province abbreviation, such as `NY`.+ default_billing:+ type: boolean+ description: True makes this the node's default billing address, false gives+ that up, and leaving it out changes nothing.+ default_shipping:+ type: boolean+ description: True makes this the node's default shipping address, false+ gives that up, and leaving it out changes nothing.+ CompletePaymentSessionParams:+ type: object+ properties:+ session_result:+ type: string+ description: Provider-specific session result token.+ external_data:+ type: object+ additionalProperties: true+ description: Provider-specific completion data.+ CompletePaymentSetupSessionParams:+ type: object+ properties:+ external_data:+ type: object+ additionalProperties: true+ description: Provider-specific completion data.+ CreateCartParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ customer_note:+ type: string+ example: Leave at door+ market_id:+ type: string+ currency:+ type: string+ locale:+ type: string+ shipping_address_id:+ type: string+ description: An existing address to ship to.+ example: addr_abc123+ billing_address_id:+ type: string+ description: An existing address to bill.+ example: addr_def456+ preferred_stock_location_id:+ type: string+ company_id:+ type: string+ description: 'The company node this purchase is for. The buyer must have+ standing over it: a membership on that node or one of its ancestors. Null+ clears it, and with it the company''s catalog, pricing and tax anchoring.'+ nullable: true+ po_number:+ type: string+ description: The buyer's own purchase-order reference. Their accounting+ reconciles the order, the invoice and the payment against it. Blank clears+ it.+ nullable: true+ po_document_signed_id:+ type: string+ description: The `signed_id` of the buyer's purchase order, from `POST /store/carts/:id/po_document`.+ Blank detaches the document.+ nullable: true+ use_shipping:+ type: boolean+ description: When true, copies the shipping address to the billing address.+ shipping_address:+ allOf:+ - "$ref": "#/components/schemas/CartAddressParams"+ description: A new shipping address.+ billing_address:+ allOf:+ - "$ref": "#/components/schemas/CartAddressParams"+ description: A new billing address.+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata, merged with what the cart has.+ items:+ type: array+ items:+ "$ref": "#/components/schemas/LineItemInputParams"+ description: 'Items to upsert: sets the quantity of a variant already in+ the cart, adds the others.'+ CreateClaimParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ line_item_id:+ type: string+ quantity:+ type: integer+ description:+ type: string+ description: What is wrong with the item.+ required:+ - line_item_id+ - quantity+ reason_id:+ type: string+ description: One of the store's claim reasons.+ memo:+ type: string+ required:+ - items+ CreateDataRequestParams:+ type: object+ properties:+ kind:+ type: string+ enum:+ - access+ - erasure+ description: Defaults to `access`.+ current_password:+ type: string+ description: Required for `erasure`.+ CreateNewsletterSubscriberParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ redirect_url:+ type: string+ format: uri+ description: The storefront URL the verification token is appended to. Left+ out of the webhook payload unless it matches one of the store's allowed+ origins.+ example: https://your-store.com/newsletter/confirm+ required:+ CreatePaymentParams:+ type: object+ properties:+ payment_method_id:+ type: string+ description: A payment method that needs no payment session.+ example: pm_abc123+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the order total minus store credits.+ example: '99.99'+ metadata:+ type: object+ additionalProperties: true+ description: Key-value metadata to attach to the payment.+ required:+ - payment_method_id+ CreatePaymentSessionParams:+ type: object+ properties:+ payment_method_id:+ type: string+ example: pm_abc123+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ description: Defaults to the order total minus store credits.+ example: '99.99'+ external_data:+ type: object+ additionalProperties: true+ description: Provider-specific data passed to the gateway.+ required:+ - payment_method_id+ CreatePaymentSetupSessionParams:+ type: object+ properties:+ payment_method_id:+ type: string+ example: pm_abc123+ external_data:+ type: object+ additionalProperties: true+ description: Provider-specific data passed to the gateway.+ required:+ - payment_method_id+ CreatePoDocumentParams:+ type: object+ properties:+ filename:+ type: string+ content_type:+ type: string+ byte_size:+ type: integer+ checksum:+ type: string+ description: Base64-encoded MD5 digest of the file; the storage service+ checks the bytes against it.+ required:+ - filename+ - content_type+ - byte_size+ - checksum+ CreateReturnParams:+ type: object+ properties:+ items:+ type: array+ items:+ type: object+ properties:+ fulfillment_item_id:+ type: string+ description: The shipped unit coming back.+ quantity:+ type: integer+ required:+ - fulfillment_item_id+ - quantity+ reason_id:+ type: string+ description: One of the store's return reasons.+ memo:+ type: string+ required:+ - items+ CreateWishlistItemParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_abc123+ quantity:+ type: integer+ example: 1+ required:+ - variant_id+ CreateWishlistParams:+ type: object+ properties:+ name:+ type: string+ example: Birthday Ideas+ is_private:+ type: boolean+ is_default:+ type: boolean+ required:+ - name+ LineItemInputParams:+ type: object+ properties:+ variant_id:+ type: string+ example: variant_abc123+ quantity:+ type: integer+ description: Defaults to 1.+ example: 2+ metadata:+ type: object+ additionalProperties: true+ description: Key-value metadata, merged with what the line item has.+ options:+ type: object+ additionalProperties: true+ required:+ - variant_id+ LogoutParams:+ type: object+ properties:+ refresh_token:+ type: string+ description: The refresh token to revoke.+ RefreshTokenParams:+ type: object+ properties:+ refresh_token:+ type: string+ description: The refresh token from the login response.+ required:+ - refresh_token+ RegisterParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ password:+ type: string+ example: password123+ password_confirmation:+ type: string+ example: password123+ first_name:+ type: string+ example: John+ last_name:+ type: string+ example: Doe+ phone:+ type: string+ example: "+1 555 123 4567"+ accepts_email_marketing:+ type: boolean+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata.+ terms_of_service:+ type: boolean+ description: Whether the customer ticked the storefront's terms of service+ box. Recorded as their consent.+ required:+ - password+ RequestNewsletterUnsubscribeParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ redirect_url:+ type: string+ format: uri+ description: The storefront URL the unsubscribe token is appended to in+ the email. Left out of the event payload unless it matches one of the+ store's allowed origins.+ RequestPasswordResetParams:+ type: object+ properties:+ email:+ type: string+ format: email+ description: The email of the account to reset.+ example: [email protected]+ redirect_url:+ type: string+ format: uri+ description: Where the reset link sends the customer. Ignored unless it+ matches one of the store's allowed origins.+ example: https://myshop.com/reset-password+ required:+ ResetPasswordParams:+ type: object+ properties:+ password:+ type: string+ example: newsecurepassword+ password_confirmation:+ type: string+ example: newsecurepassword+ required:+ - password+ - password_confirmation+ TaxIdentifierParams:+ type: object+ properties:+ kind:+ type: string+ description: 'The registration the number belongs to, such as `eu_vat` or+ `gb_vat`. Any kind is accepted; one with a registered validator is checked+ by it. Built-in: `eu_vat`. Extensions may register more.'+ example: eu_vat+ value:+ type: string+ example: DE123456789+ required:+ - kind+ - value+ UpdateCartParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ customer_note:+ type: string+ example: Leave at door+ market_id:+ type: string+ currency:+ type: string+ locale:+ type: string+ shipping_address_id:+ type: string+ description: An existing address to ship to.+ example: addr_abc123+ billing_address_id:+ type: string+ description: An existing address to bill.+ example: addr_def456+ preferred_stock_location_id:+ type: string+ company_id:+ type: string+ description: 'The company node this purchase is for. The buyer must have+ standing over it: a membership on that node or one of its ancestors. Null+ clears it, and with it the company''s catalog, pricing and tax anchoring.'+ nullable: true+ po_number:+ type: string+ description: The buyer's own purchase-order reference. Their accounting+ reconciles the order, the invoice and the payment against it. Blank clears+ it.+ nullable: true+ po_document_signed_id:+ type: string+ description: The `signed_id` of the buyer's purchase order, from `POST /store/carts/:id/po_document`.+ Blank detaches the document.+ nullable: true+ use_shipping:+ type: boolean+ description: When true, copies the shipping address to the billing address.+ shipping_address:+ allOf:+ - "$ref": "#/components/schemas/CartAddressParams"+ description: A new shipping address.+ billing_address:+ allOf:+ - "$ref": "#/components/schemas/CartAddressParams"+ description: A new billing address.+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata, merged with what the cart has.+ items:+ type: array+ items:+ "$ref": "#/components/schemas/LineItemInputParams"+ description: 'Items to upsert: sets the quantity of a variant already in+ the cart, adds the others.'+ UpdateCompanyParams:+ type: object+ properties:+ name:+ type: string+ example: Acme Industrial Group+ UpdateCustomerParams:+ type: object+ properties:+ email:+ type: string+ format: email+ example: [email protected]+ password:+ type: string+ password_confirmation:+ type: string+ current_password:+ type: string+ description: Required when changing the email or the password.+ first_name:+ type: string+ example: John+ last_name:+ type: string+ example: Doe+ phone:+ type: string+ example: "+1 555 123 4567"+ accepts_email_marketing:+ type: boolean+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata.+ UpdateFulfillmentParams:+ type: object+ properties:+ selected_delivery_rate_id:+ type: string+ description: The delivery rate to select.+ example: dr_abc123+ pickup_point_external_id:+ type: string+ description: 'For a pickup point delivery method: the provider''s id of+ the point to collect from.'+ UpdateLineItemParams:+ type: object+ properties:+ quantity:+ type: integer+ description: At least 1. Remove an item with DELETE.+ example: 5+ metadata:+ type: object+ additionalProperties: true+ description: Write-only key-value metadata, merged with what the line item+ has.+ example:+ engraving: J.D.+ UpdatePaymentSessionParams:+ type: object+ properties:+ amount:+ type: string+ format: decimal+ pattern: "^-?\\d+(\\.\\d+)?$"+ example: '50.00'+ external_data:+ type: object+ additionalProperties: true+ description: Provider-specific data to update.+ UpdateWishlistItemParams:+ type: object+ properties:+ variant_id:+ type: string+ description: Moves the item to another variant.+ quantity:+ type: integer+ example: 2+ UpdateWishlistParams:+ type: object+ properties:+ name:+ type: string+ example: Updated Name+ is_private:+ type: boolean+ is_default:+ type: boolean+ VerifyNewsletterSubscriberParams:+ type: object+ properties:+ token:+ type: string+ description: The verification token from the confirmation email.+ example: abc123def456+ required:+ - tokenx-spree-filter-tables:Address:attributes:diff --git a/docs/developer/contributing/creating-an-extension.mdx b/docs/developer/contributing/creating-an-extension.mdxindex 05becd3fda..721422d34b 100644--- a/docs/developer/contributing/creating-an-extension.mdx+++ b/docs/developer/contributing/creating-an-extension.mdx@@ -163,6 +163,13 @@ module Spreeclass ReviewsController < ResourceControllerscoped_resource :reviews+ request_params :review do+ id :product_id, required: :create+ integer :rating, required: :create+ string :body+ boolean :approved+ end+protecteddef model_class@@ -172,10 +179,6 @@ module Spreedef serializer_classSpree::Api::V3::Admin::ReviewSerializerend-- def resource_permitted_attributes- [:product_id, :rating, :body, :approved]- endendendenddiff --git a/docs/developer/customization/api.mdx b/docs/developer/customization/api.mdxindex 17dc389761..442f9f52ea 100644--- a/docs/developer/customization/api.mdx+++ b/docs/developer/customization/api.mdx@@ -152,7 +152,7 @@ Override these methods to customize:| `serializer_class` | Alba serializer (required) || `scope` | Base query — add `.where()` to filter || `find_resource` | Custom ID lookup (slug fallback, etc.) |-| `permitted_params` | Custom strong params |+| `permitted_params` | Custom strong params (prefer `request_params`) || `collection_includes` | Eager loading for `index` |### Routes@@ -171,24 +171,48 @@ Spree::Core::Engine.add_routes doend```-### Permitted Attributes+### Request Parameters-For endpoints that accept writes (create/update), declare the attributes in your-controller:+For endpoints that accept writes (create/update), declare what the body takes+with `request_params`, at the top of the controller:-```ruby-def resource_permitted_attributes- [:name, :slug, :description, :logo]+```ruby app/controllers/spree/api/v3/admin/brands_controller.rb+request_params :brand do+ string :name, required: :create+ string :slug+ string :description, description: 'Shown on the brand page.'+ id :region_ids, array: true+ object :metadataend```-Entries are `params.permit` fragments, so collections and nested structures use-the shapes you would pass there directly — `[:name, { region_ids: [] }]`.+This one declaration is the endpoint's contract: the controller permits exactly+these keys and nesting, and nothing else. Spree's own endpoints publish the same+declarations in the [API reference](/api-reference/introduction), and the SDK request types+(`ProductCreateParams`, `ProductUpdateParams`, …) are generated from it, so the+controller, the reference and the TypeScript types cannot drift apart.++| Kind | Sent as |+|------|---------|+| `string`, `boolean`, `integer` | the JSON type of the same name |+| `decimal` | a canonical decimal string (`"19.99"`) — every amount of money |+| `number` | a JSON number — weights, dimensions, coordinates |+| `id` | a prefixed ID (`brand_k5nR8xLq`) |+| `date`, `datetime` | ISO 8601 strings |+| `object` | a nested hash: any keys, a block of fields, or a shared `shape:` |+| `any` | a scalar, a list or a hash |++Each field takes `required: true` (or `:create` for create only), `nullable:`,+`array:`, `enum:`, `description:` and `example:`. A custom action declares its+own body with a name ending in `Params`:+`request_params 'BrandMergeParams', action: :merge do ... end`.<Note>- Declare `resource_permitted_attributes`, not `permitted_attributes`. The- latter is what appends extension-contributed attributes to your list, so- overriding it replaces them.+ An endpoint that needs logic of its own can still override+ `resource_permitted_attributes` with a plain `params.permit` list, but then+ its body is neither documented nor typed. Never override+ `permitted_attributes`: it is what appends extension-contributed attributes+ to your list, so overriding it replaces them.</Note>### Adding an Attribute to a Core Resourcediff --git a/docs/developer/customization/model-preferences.mdx b/docs/developer/customization/model-preferences.mdxindex d1aa8d9f19..54282e7e32 100644--- a/docs/developer/customization/model-preferences.mdx+++ b/docs/developer/customization/model-preferences.mdx@@ -139,7 +139,7 @@ module Spreeend```-**3. Accept it in the controller.** Exposing a setting does not make it writable: the controller decides, as for any attribute (see [permitted attributes](/developer/customization/api#permitted-attributes)):+**3. Accept it in the controller.** Exposing a setting does not make it writable: the controller decides, as for any attribute (see [request parameters](/developer/customization/api#request-parameters)):```ruby server/app/controllers/spree/api/v3/admin/brands_controller.rbdef resource_permitted_attributesdiff --git a/lefthook.yml b/lefthook.ymlindex e490e4736c..d98fc6bf04 100644--- a/lefthook.yml+++ b/lefthook.yml@@ -38,6 +38,17 @@ pre-commit:pnpm generate:filtersgit add packages/sdk/src/types/filters.generated.ts packages/admin-sdk/src/types/filters.generated.ts packages/seller-sdk/src/types/filters.generated.ts+ params:+ # The API reference carries the request schemas; regenerating it, or+ # changing the generator, needs fresh SDK request types.+ glob:+ - "docs/api-reference/{store,admin,seller}.yaml"+ - "packages/sdk-core/scripts/generate-params.ts"+ - "packages/sdk-core/src/params-types.ts"+ run: |+ pnpm generate:params+ git add packages/sdk/src/types/params/ packages/admin-sdk/src/types/params/ packages/seller-sdk/src/types/params/+pre-push:commands:biome-ci:diff --git a/package.json b/package.jsonindex 6c0c51d7b5..344623c225 100644--- a/package.json+++ b/package.json@@ -8,6 +8,7 @@"test": "turbo test","generate:zod": "pnpm --recursive --filter \"./packages/*\" run generate:zod","generate:filters": "pnpm --recursive --filter \"./packages/*\" run generate:filters",+ "generate:params": "pnpm --recursive --filter \"./packages/*\" run generate:params","lint": "turbo lint","lint:fix": "turbo lint:fix","format": "turbo format",diff --git a/packages/admin-sdk/biome.json b/packages/admin-sdk/biome.jsonindex 7a23b634ca..731e25ac67 100644--- a/packages/admin-sdk/biome.json+++ b/packages/admin-sdk/biome.json@@ -8,6 +8,7 @@"tests/**","!src/types/generated","!src/types/filters.generated.ts",+ "!src/types/params","!src/zod/generated"]}diff --git a/packages/admin-sdk/package.json b/packages/admin-sdk/package.jsonindex e6909b25c1..e097b52fcd 100644--- a/packages/admin-sdk/package.json+++ b/packages/admin-sdk/package.json@@ -47,6 +47,7 @@"generate:admin-client": "tsx scripts/generate-admin-client.ts","generate:zod": "tsx ../sdk-core/scripts/generate-zod.ts","generate:filters": "tsx ../sdk-core/scripts/generate-filters.ts admin",+ "generate:params": "tsx ../sdk-core/scripts/generate-params.ts admin","build": "tsup","dev": "tsup --watch","typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.examples.json",diff --git a/packages/admin-sdk/scripts/generate-admin-client.ts b/packages/admin-sdk/scripts/generate-admin-client.tsindex 06825cbbfa..fbcd368ede 100644--- a/packages/admin-sdk/scripts/generate-admin-client.ts+++ b/packages/admin-sdk/scripts/generate-admin-client.ts@@ -10,7 +10,7 @@* - Namespace-based: client.admin.products.list(), client.admin.products.get(id)* - Uses RequestFn, PaginatedResponse<T>, RequestOptions from request.ts* - Uses Typelizer-generated Admin* types for response typing- * - Generates request param interfaces for create/update bodies+ * - Types create/update bodies with the request types `pnpm generate:params` writes*/import * as fs from 'node:fs'@@ -430,25 +430,15 @@ function schemaToTsType(schema: OpenApiSchema, indent = 2): string {return 'unknown'}-function generateRequestParamType(- resource: Resource,- action: 'create' | 'update',- operation: OpenApiOperation,-): { typeName: string; typeBody: string } | null {- // Find request body schema+// Request body types are generated from the same spec by `pnpm generate:params`+// (src/types/params/, re-exported from params.ts); a body names+// its type through its `$ref`.+function requestParamTypeName(operation: OpenApiOperation): string | null {const bodyParam = operation.parameters?.find((p) => p.name === 'body' && p.in === 'body')const bodySchema = (bodyParam as unknown as { schema?: OpenApiSchema })?.schema-- // Also check requestBody (OpenAPI 3.0 style)const requestBodySchema = operation.requestBody?.content?.['application/json']?.schema-- const schema = bodySchema || requestBodySchema- if (!schema?.properties) return null-- const typeName = `Admin${singularPascal(resource.name)}${action === 'create' ? 'Create' : 'Update'}Params`- const typeBody = schemaToTsType(schema)-- return { typeName, typeBody }+ const ref = (bodySchema || requestBodySchema)?.$ref+ return ref ? ref.replace('#/components/schemas/', '') : null}// ---------------------------------------------------------------------------@@ -532,10 +522,7 @@ function generateResourceMethods(resource: Resource, paramTypes: Map<string, str}case 'create': {- const createTypeName = `Admin${singularPascal(resource.name)}CreateParams`- const paramType = paramTypes.has(createTypeName)- ? createTypeName- : 'Record<string, unknown>'+ const paramType = paramTypes.get(`${resource.name}:create`) ?? 'Record<string, unknown>'if (jsdoc) lines.push(jsdoc)lines.push(` create: (`)lines.push(...parentParamDecls)@@ -550,10 +537,7 @@ function generateResourceMethods(resource: Resource, paramTypes: Map<string, str}case 'update': {- const updateTypeName = `Admin${singularPascal(resource.name)}UpdateParams`- const paramType = paramTypes.has(updateTypeName)- ? updateTypeName- : 'Record<string, unknown>'+ const paramType = paramTypes.get(`${resource.name}:update`) ?? 'Record<string, unknown>'if (jsdoc) lines.push(jsdoc)lines.push(` update: (`)lines.push(...parentParamDecls)@@ -607,24 +591,7 @@ function generateResourceMethods(resource: Resource, paramTypes: Map<string, strreturn lines.join('\n')}-function generateParamsFile(paramTypes: Map<string, string>): string {- const out: string[] = []-- out.push(`// This file is auto-generated by scripts/generate-admin-client.ts`)- out.push(`// Do not edit manually. Run: npm run generate:admin-client`)- out.push(``)- out.push(`// Request parameter types (generated from OpenAPI request bodies)`)- out.push(``)-- for (const [name, body] of paramTypes) {- out.push(`export interface ${name} ${body}`)- out.push(``)- }-- return out.join('\n')-}--function generateClient(spec: OpenApiSpec): { client: string; params: string } {+function generateClient(spec: OpenApiSpec): string {const resources = analyzeResources(spec)// Collect all param types from request bodies@@ -632,10 +599,8 @@ function generateClient(spec: OpenApiSpec): { client: string; params: string } {for (const resource of resources) {for (const endpoint of resource.endpoints) {if (endpoint.action === 'create' || endpoint.action === 'update') {- const result = generateRequestParamType(resource, endpoint.action, endpoint.operation)- if (result) {- paramTypes.set(result.typeName, result.typeBody)- }+ const typeName = requestParamTypeName(endpoint.operation)+ if (typeName) paramTypes.set(`${resource.name}:${endpoint.action}`, typeName)}}}@@ -653,7 +618,7 @@ function generateClient(spec: OpenApiSpec): { client: string; params: string } {// Build importsconst importedTypes = [...responseTypes].sort()- const paramTypeNames = [...paramTypes.keys()].sort()+ const paramTypeNames = [...new Set(paramTypes.values())].sort()// Build client outputconst out: string[] = []@@ -808,10 +773,7 @@ function generateClient(spec: OpenApiSpec): { client: string; params: string } {out.push(`}`)out.push(``)- return {- client: out.join('\n'),- params: generateParamsFile(paramTypes),- }+ return out.join('\n')}// ---------------------------------------------------------------------------@@ -820,7 +782,6 @@ function generateClient(spec: OpenApiSpec): { client: string; params: string } {const SPEC_PATH = path.resolve(import.meta.dirname, '../../../docs/api-reference/admin.yaml')const OUTPUT_PATH = path.resolve(import.meta.dirname, '../src/admin-client.ts')-const PARAMS_PATH = path.resolve(import.meta.dirname, '../src/params.ts')if (!fs.existsSync(SPEC_PATH)) {console.error(`Admin API spec not found at: ${SPEC_PATH}`)@@ -849,10 +810,7 @@ try {}}-const { client, params } = generateClient(spec)--fs.writeFileSync(PARAMS_PATH, params, 'utf-8')-console.log(`Generated: ${PARAMS_PATH}`)+const client = generateClient(spec)fs.writeFileSync(OUTPUT_PATH, client, 'utf-8')console.log(`Generated: ${OUTPUT_PATH}`)diff --git a/packages/admin-sdk/src/admin-client.ts b/packages/admin-sdk/src/admin-client.tsindex ceaac69f5c..a79c388db9 100644--- a/packages/admin-sdk/src/admin-client.ts+++ b/packages/admin-sdk/src/admin-client.ts@@ -195,7 +195,7 @@ export type ReportingCompare = 'previous_period' | 'previous_year'export type ReportingMetricFilterOp = 'eq' | 'gt' | 'gte' | 'lt' | 'lte'-export interface ReportingQuery {+export type ReportingQuery = {/** Registered metric names — discover via `reporting.schema()`. */metrics: string[]dimensions?: Array<@@ -396,6 +396,7 @@ import type {AllowedOriginUpdateParams,ApiKeyCreateParams,ApiKeyUpdateParams,+ BulkTagsParams,CatalogAssignParams,CatalogOrderMinimumParams,CatalogParams,@@ -403,9 +404,13 @@ import type {CategoryCreateParams,CategoryRepositionParams,CategoryUpdateParams,+ ChannelAddProductsParams,ChannelCreateParams,+ ChannelRemoveProductsParams,ChannelUpdateParams,+ ClaimCancelParams,ClaimCreateParams,+ ClaimDenyParams,ClaimResolveParams,ClaimUpdateParams,CollectionCreateParams,@@ -417,6 +422,7 @@ import type {CompanyMembershipCreateParams,CompanyParams,CustomerAddressParams,+ CustomerBulkGroupsParams,CustomerCreateParams,CustomerGroupCreateParams,CustomerGroupUpdateParams,@@ -432,6 +438,8 @@ import type {DeliveryCreateParams,DeliveryMarkDeliveredParams,DeliveryMethodParams,+ DeliveryMethodRuleCreateParams,+ DeliveryMethodRuleUpdateParams,DeliveryOriginGroupParams,DeliveryProfileParams,DeliveryUpdateParams,@@ -439,16 +447,22 @@ import type {DigitalAssetCreateParams,DigitalAssetProvider,DigitalAssetUpdateParams,+ DiscountCodeApplyParams,+ DiscountCreateParams,+ DiscountUpdateParams,EmailTemplateDraftParams,EmailTemplateLanguageParams,EmailTemplatePreviewParams,EmailTemplateRestoreParams,EmailTemplateVersionParams,+ ExchangeCancelParams,ExchangeCreateParams,ExchangeFulfillParams,ExchangeReceiveParams,ExchangeUpdateParams,ExportCreateParams,+ FeeCreateParams,+ FeeUpdateParams,FulfillmentCreateParams,FulfillmentFulfillParams,FulfillmentMarkDeliveredParams,@@ -471,6 +485,7 @@ import type {MarketUpdateParams,MediaCreateParams,MediaLibraryCreateParams,+ MediaLibraryUpdateParams,MediaUpdateParams,MediaUsageReference,MeUpdateParams,@@ -492,13 +507,20 @@ import type {PaymentMethodUpdateParams,PolicyCreateParams,PolicyUpdateParams,- PriceBulkUpsertRow,+ PriceBulkDestroyParams,+ PriceBulkUpsertParams,PriceCreateParams,PriceListCreateParams,PriceListUpdateParams,PriceUpdateParams,+ ProductBulkCategoriesParams,+ ProductBulkChannelsParams,+ ProductBulkCollectionsParams,+ ProductBulkDestroyParams,+ ProductBulkStatusParams,ProductCreateParams,ProductMembershipRepositionParams,+ ProductRejectParams,ProductTypeApplyToProductsResponse,ProductTypeCreateParams,ProductTypeUpdateParams,@@ -510,6 +532,7 @@ import type {PromotionRuleCreateParams,PromotionRuleUpdateParams,PromotionUpdateParams,+ PurchaseOrderCancelParams,PurchaseOrderCreateParams,PurchaseOrderUpdateParams,ReasonCreateParams,@@ -517,6 +540,7 @@ import type {ReceivableCloseParams,RefundCreateParams,ResourceTypeDefinition,+ ReturnCancelParams,ReturnCreateParams,ReturnReceiveParams,ReturnRefundParams,@@ -529,6 +553,7 @@ import type {SellerCreateParams,SellerInviteParams,SellerOnboarding,+ SellerPayoutCompleteParams,SellerRejectParams,SellerReopenOnboardingParams,SellerRequirementCreateParams,@@ -542,13 +567,14 @@ import type {SetupParams,SetupStatus,ShippingLabelCreateParams,- StockLevelBulkUpsertRow,+ StockLevelBulkUpsertParams,StockLevelUpdateParams,StockLocationCreateParams,StockLocationUpdateParams,StockReceiptCreateParams,StockTransferCancelParams,StockTransferCreateParams,+ StockTransferMarkInTransitParams,StockTransferUpdateParams,StoreCreditApplyParams,StoreCreditListResponse,@@ -1277,7 +1303,7 @@ export class AdminClient {*/reject: (id: string,- params?: { reason?: string },+ params?: ProductRejectParams,options?: RequestOptions,): Promise<Product> =>this.request<Product>('PATCH', `/products/${id}/reject`, { ...options, body: params }),@@ -1287,21 +1313,21 @@ export class AdminClient {* against the product status enum and reindexes affected products.*/bulkStatusUpdate: (- params: { ids: string[]; status: 'draft' | 'active' | 'archived' },+ params: ProductBulkStatusParams,options?: RequestOptions,): Promise<{ product_count: number; status: string }> =>this.request('POST', '/products/bulk_status_update', { ...options, body: params }),/** Attach every product in `ids` to every category in `category_ids`. */bulkAddToCategories: (- params: { ids: string[]; category_ids: string[] },+ params: ProductBulkCategoriesParams,options?: RequestOptions,): Promise<{ product_count: number; category_count: number }> =>this.request('POST', '/products/bulk_add_to_categories', { ...options, body: params }),/** Detach every product in `ids` from every category in `category_ids`. */bulkRemoveFromCategories: (- params: { ids: string[]; category_ids: string[] },+ params: ProductBulkCategoriesParams,options?: RequestOptions,): Promise<{ product_count: number; category_count: number }> =>this.request('POST', '/products/bulk_remove_from_categories', { ...options, body: params }),@@ -1312,49 +1338,49 @@ export class AdminClient {* `collection_count` reports how many were actually applied.*/bulkAddToCollections: (- params: { ids: string[]; collection_ids: string[] },+ params: ProductBulkCollectionsParams,options?: RequestOptions,): Promise<{ product_count: number; collection_count: number }> =>this.request('POST', '/products/bulk_add_to_collections', { ...options, body: params }),/** Detach every product in `ids` from every collection in `collection_ids`. */bulkRemoveFromCollections: (- params: { ids: string[]; collection_ids: string[] },+ params: ProductBulkCollectionsParams,options?: RequestOptions,): Promise<{ product_count: number; collection_count: number }> =>this.request('POST', '/products/bulk_remove_from_collections', { ...options, body: params }),/** Publish every product in `ids` on every channel in `channel_ids`. */bulkAddToChannels: (- params: { ids: string[]; channel_ids: string[] },+ params: ProductBulkChannelsParams,options?: RequestOptions,): Promise<{ product_count: number; channel_count: number }> =>this.request('POST', '/products/bulk_add_to_channels', { ...options, body: params }),/** Unpublish every product in `ids` from every channel in `channel_ids`. */bulkRemoveFromChannels: (- params: { ids: string[]; channel_ids: string[] },+ params: ProductBulkChannelsParams,options?: RequestOptions,): Promise<{ product_count: number; channel_count: number; removed: number }> =>this.request('POST', '/products/bulk_remove_from_channels', { ...options, body: params }),/** Add each tag name to every product. Tags are upserted by name. */bulkAddTags: (- params: { ids: string[]; tags: string[] },+ params: BulkTagsParams,options?: RequestOptions,): Promise<{ product_count: number; tag_count: number }> =>this.request('POST', '/products/bulk_add_tags', { ...options, body: params }),/** Remove each tag name from every product. No-op for non-tagged. */bulkRemoveTags: (- params: { ids: string[]; tags: string[] },+ params: BulkTagsParams,options?: RequestOptions,): Promise<{ product_count: number; tag_count: number }> =>this.request('POST', '/products/bulk_remove_tags', { ...options, body: params }),/** Soft-delete a list of products. */bulkDestroy: (- params: { ids: string[] },+ params: ProductBulkDestroyParams,options?: RequestOptions,): Promise<{ product_count: number }> =>this.request('DELETE', '/products/bulk_destroy', { ...options, body: params }),@@ -1599,11 +1625,7 @@ export class AdminClient {create: (params: OrderCreateParams, options?: RequestOptions): Promise<Order> =>this.request<Order>('POST', '/orders', { ...options, body: params }),- update: (- id: string,- params: OrderUpdateParams | Record<string, unknown>,- options?: RequestOptions,- ): Promise<Order> =>+ update: (id: string, params: OrderUpdateParams, options?: RequestOptions): Promise<Order> =>this.request<Order>('PATCH', `/orders/${id}`, { ...options, body: params }),delete: (id: string, options?: RequestOptions): Promise<void> =>@@ -2034,7 +2056,7 @@ export class AdminClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ReturnCancelParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('PATCH', `/orders/${orderId}/returns/${id}/cancel`, {@@ -2184,7 +2206,7 @@ export class AdminClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ExchangeCancelParams,options?: RequestOptions,): Promise<Exchange> =>this.request<Exchange>('PATCH', `/orders/${orderId}/exchanges/${id}/cancel`, {@@ -2253,7 +2275,7 @@ export class AdminClient {deny: (orderId: string,id: string,- params?: { reason?: string },+ params?: ClaimDenyParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('PATCH', `/orders/${orderId}/claims/${id}/deny`, {@@ -2264,7 +2286,7 @@ export class AdminClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ClaimCancelParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('PATCH', `/orders/${orderId}/claims/${id}/cancel`, {@@ -2364,12 +2386,7 @@ export class AdminClient {*/create: (orderId: string,- params: {- label: string- value: string- value_type?: 'flat' | 'percent'- line_item_id?: string- },+ params: DiscountCreateParams,options?: RequestOptions,): Promise<{ data: Discount[] }> =>this.request<{ data: Discount[] }>('POST', `/orders/${orderId}/discounts`, {@@ -2381,7 +2398,7 @@ export class AdminClient {update: (orderId: string,id: string,- params: { label?: string; amount?: string | number },+ params: DiscountUpdateParams,options?: RequestOptions,): Promise<Discount> =>this.request<Discount>('PATCH', `/orders/${orderId}/discounts/${id}`, {@@ -2403,7 +2420,7 @@ export class AdminClient {discountCodes: {create: (orderId: string,- params: { code: string },+ params: DiscountCodeApplyParams,options?: RequestOptions,): Promise<Order> =>this.request<Order>('POST', `/orders/${orderId}/discount_codes`, {@@ -2434,23 +2451,13 @@ export class AdminClient {get: (orderId: string, id: string, options?: RequestOptions): Promise<Fee> =>this.request<Fee>('GET', `/orders/${orderId}/fees/${id}`, options),- create: (- orderId: string,- params: {- label: string- amount: string | number- kind?: string- line_item_id?: string- fulfillment_id?: string- },- options?: RequestOptions,- ): Promise<Fee> =>+ create: (orderId: string, params: FeeCreateParams, options?: RequestOptions): Promise<Fee> =>this.request<Fee>('POST', `/orders/${orderId}/fees`, { ...options, body: params }),update: (orderId: string,id: string,- params: { label?: string; amount?: string | number; kind?: string },+ params: FeeUpdateParams,options?: RequestOptions,): Promise<Fee> =>this.request<Fee>('PATCH', `/orders/${orderId}/fees/${id}`, { ...options, body: params }),@@ -2585,13 +2592,7 @@ export class AdminClient {create: (deliveryMethodId: string,- params: {- type: string- active?: boolean- preferences?: Record<string, unknown>- /** Prefixed product IDs — association-backed rules (excluded_products_rule). */- product_ids?: string[]- },+ params: DeliveryMethodRuleCreateParams,options?: RequestOptions,): Promise<DeliveryMethodRule> =>this.request<DeliveryMethodRule>('POST', `/delivery_methods/${deliveryMethodId}/rules`, {@@ -2602,12 +2603,7 @@ export class AdminClient {update: (deliveryMethodId: string,id: string,- params: {- active?: boolean- preferences?: Record<string, unknown>- /** Prefixed product IDs — association-backed rules (excluded_products_rule). */- product_ids?: string[]- },+ params: DeliveryMethodRuleUpdateParams,options?: RequestOptions,): Promise<DeliveryMethodRule> =>this.request<DeliveryMethodRule>(@@ -2657,10 +2653,7 @@ export class AdminClient {get: (id: string, options?: RequestOptions): Promise<DeliveryProfile> =>this.request<DeliveryProfile>('GET', `/delivery_profiles/${id}`, options),- create: (- params: DeliveryProfileParams & { name: string },- options?: RequestOptions,- ): Promise<DeliveryProfile> =>+ create: (params: DeliveryProfileParams, options?: RequestOptions): Promise<DeliveryProfile> =>this.request<DeliveryProfile>('POST', '/delivery_profiles', {...options,body: params,@@ -3006,13 +2999,13 @@ export class AdminClient {* number of rows the DB touched.*/bulkUpsert: (- params: { prices: PriceBulkUpsertRow[] },+ params: PriceBulkUpsertParams,options?: RequestOptions,): Promise<{ price_count: number }> =>this.request('POST', '/prices/bulk_upsert', { ...options, body: params }),bulkDestroy: (- params: { ids: string[] },+ params: PriceBulkDestroyParams,options?: RequestOptions,): Promise<{ price_count: number }> =>this.request('DELETE', '/prices/bulk_destroy', { ...options, body: params }),@@ -3647,7 +3640,7 @@ export class AdminClient {complete: (id: string,- data?: { reference?: string },+ data?: SellerPayoutCompleteParams,options?: RequestOptions,): Promise<SellerPayout> =>this.request<SellerPayout>('PATCH', `/seller_payouts/${id}/complete`, {@@ -4530,7 +4523,7 @@ export class AdminClient {* prefixed IDs; the server decodes them. Idempotent.*/bulkAddToGroups: (- params: { ids: string[]; customer_group_ids: string[] },+ params: CustomerBulkGroupsParams,options?: RequestOptions,): Promise<{ customer_count: number; customer_group_count: number }> =>this.request('POST', '/customers/bulk_add_to_groups', { ...options, body: params }),@@ -4540,21 +4533,21 @@ export class AdminClient {* non-members. Same shape as `bulkAddToGroups`.*/bulkRemoveFromGroups: (- params: { ids: string[]; customer_group_ids: string[] },+ params: CustomerBulkGroupsParams,options?: RequestOptions,): Promise<{ customer_count: number; customer_group_count: number }> =>this.request('POST', '/customers/bulk_remove_from_groups', { ...options, body: params }),/** Add each tag name to every customer. Tags are upserted by name. */bulkAddTags: (- params: { ids: string[]; tags: string[] },+ params: BulkTagsParams,options?: RequestOptions,): Promise<{ customer_count: number; tag_count: number }> =>this.request('POST', '/customers/bulk_add_tags', { ...options, body: params }),/** Remove each tag name from every customer. No-op for non-tagged. */bulkRemoveTags: (- params: { ids: string[]; tags: string[] },+ params: BulkTagsParams,options?: RequestOptions,): Promise<{ customer_count: number; tag_count: number }> =>this.request('POST', '/customers/bulk_remove_tags', { ...options, body: params }),@@ -4751,8 +4744,11 @@ export class AdminClient {create: (params: MediaLibraryCreateParams, options?: RequestOptions): Promise<Media> =>this.request<Media>('POST', '/media', { ...options, body: params }),- update: (id: string, params: MediaUpdateParams, options?: RequestOptions): Promise<Media> =>- this.request<Media>('PATCH', `/media/${id}`, { ...options, body: params }),+ update: (+ id: string,+ params: MediaLibraryUpdateParams,+ options?: RequestOptions,+ ): Promise<Media> => this.request<Media>('PATCH', `/media/${id}`, { ...options, body: params }),/*** Deletes the file. A file still in use is refused (422 with its usage)@@ -5200,11 +5196,7 @@ export class AdminClient {*/addProducts: (id: string,- params: {- product_ids: string[]- published_at?: string | null- unpublished_at?: string | null- },+ params: ChannelAddProductsParams,options?: RequestOptions,): Promise<{ product_count: number }> =>this.request<{ product_count: number }>('POST', `/channels/${id}/add_products`, {@@ -5215,7 +5207,7 @@ export class AdminClient {/** Unpublishes the listed products from this channel. */removeProducts: (id: string,- params: { product_ids: string[] },+ params: ChannelRemoveProductsParams,options?: RequestOptions,): Promise<{ product_count: number }> =>this.request<{ product_count: number }>('POST', `/channels/${id}/remove_products`, {@@ -5397,7 +5389,7 @@ export class AdminClient {* intact. Response is `{ stock_level_count }`.*/bulkUpsert: (- params: { stock_levels: StockLevelBulkUpsertRow[] },+ params: StockLevelBulkUpsertParams,options?: RequestOptions,): Promise<{ stock_level_count: number }> =>this.request('POST', '/stock_levels/bulk_upsert', { ...options, body: params }),@@ -5488,7 +5480,7 @@ export class AdminClient {*/markInTransit: (id: string,- params?: { force?: boolean },+ params?: StockTransferMarkInTransitParams,options?: RequestOptions,): Promise<StockTransfer> =>this.request<StockTransfer>('PATCH', `/stock_transfers/${id}/mark_in_transit`, {@@ -5701,7 +5693,7 @@ export class AdminClient {},cancel: (id: string,- params?: { reason?: string },+ params?: PurchaseOrderCancelParams,options?: RequestOptions,): Promise<PurchaseOrder> =>this.request<PurchaseOrder>('PATCH', `/purchase_orders/${id}/cancel`, {diff --git a/packages/admin-sdk/src/params.ts b/packages/admin-sdk/src/params.tsindex 2e0baf6e78..c4da541c36 100644--- a/packages/admin-sdk/src/params.ts+++ b/packages/admin-sdk/src/params.ts@@ -2,8 +2,26 @@// Based on the Admin API OpenAPI specificationimport type { PaginationMeta, PreferenceSchema } from '@spree/sdk-core'-import type { ReportingQuery } from './admin-client'import type { SellerRequirementStatus, StoreCredit } from './types'+import type {+ CollectionRuleParams,+ CommissionRuleDraftParams,+ ImportCompleteMappingParams,+ PriceBulkUpsertRowParams,+ PriceListRuleParams,+ PriceParams,+ ProductMediaParams,+ ProductPublicationParams,+ ProductVariantParams,+ PromotionActionDraftParams,+ PromotionRuleDraftParams,+ ShippingLabelCreateParams,+ StockLevelBulkUpsertRowParams,+ StockLevelParams,+ VariantOptionParams,+} from './types/params'++export type * from './types/params'/** One pricing or inventory engine a store can choose between. */export interface StoreDataSourceProvider {@@ -40,219 +58,6 @@ export interface StoreDataSources {failure_policies: string[]}-export interface StoreUpdateParams {- name?: string- admin_locale?: string- timezone?: string- weight_unit?: string- unit_system?: string- /**- * Store-wide default storefront posture: `public`, `prices_hidden`, or- * `login_required`. Channels fall back to this when they don't set their own.- */- storefront_access?: string- /** The storefront's public URL — base for customer-email links; saving it also completes the storefront setup task. */- storefront_url?: string | null- /** Store-wide default for guest checkout. Channels fall back to this. */- guest_checkout?: boolean- /** Always advertise a confirmation step in checkout, even when no payment method requires one. */- always_include_confirm_step?: boolean- /** Shows a company field on address forms. */- company_field_enabled?: boolean- /** Makes a phone number mandatory on customer addresses. */- address_requires_phone?: boolean- /** Store-wide default for when a customer is charged rather than only authorized. A payment method's own setting wins when set. */- capture_method?: 'checkout' | 'on_dispatch' | 'manual'- /** Calculates tax from the shipping address. When false, calculates tax from the billing address. */- tax_using_ship_address?: boolean- /** Counts on-hand quantities. Off means everything is treated as always available. */- track_inventory_levels?: boolean- /** Holds stock for shoppers while they check out, so the same item can't be sold twice. */- stock_reservations_enabled?: boolean- /** On-hand units at or below which a tracked variant counts as low stock on the home screen; 0 turns the warning off. */- low_stock_threshold?: number- /** Records price changes for the EU Omnibus lowest-price-in-30-days display. */- track_price_history?: boolean- /** Whether products with no price in the shopper's currency still appear in listings. */- show_products_without_price?: boolean- /** Lets more than one variant share the same SKU. */- disable_sku_validation?: boolean- /** How document numbers are produced: `sequential` or `random`. Applies to every numbered document. */- document_number_format?: string- /** Leads every order number, e.g. `R`. Uppercase letters, digits, dashes and # only. */- order_number_prefix?: string- /** Ends every order number. Uppercase letters, digits, dashes and # only. */- order_number_suffix?: string- /** First sequential order number. Only applies before the store's first order. */- order_number_sequence_start?: number- /** When false, buyers can download their files as often as they like. */- limit_digital_download_count?: boolean- /** Downloads allowed per purchased file, unless the file overrides it. */- digital_asset_authorized_clicks?: number- /** When false, download links never expire. */- limit_digital_download_days?: boolean- /** Days a download link stays valid, unless the file overrides it. */- digital_asset_authorized_days?: number- /** Sender address used on all transactional emails (required by the model). */- mail_from_address?: string- /** Customer-facing reply-to address shown in the storefront/email footer. */- customer_support_email?: string | null- /** Recipient of "new order placed" admin notifications. */- new_order_notifications_email?: string | null- /** When false, transactional consumer emails (order confirmation, etc.) are suppressed. */- send_consumer_transactional_emails?: boolean- /** Customer email buttons and links, as `#RRGGBB`. Blank keeps the outlined buttons emails ship with. */- email_accent_color?: string | null- /** Customer email page background, as `#RRGGBB`. */- email_background_color?: string | null- /** Customer email card behind the content, as `#RRGGBB`. */- email_card_color?: string | null- /** Customer email body text, as `#RRGGBB`. */- email_text_color?: string | null- /** Customer email headings and emphasized text, as `#RRGGBB`. */- email_heading_color?: string | null- /** Customer email font: `inter`, `system`, `helvetica`, `georgia`, `roboto`, `lato` or `merriweather`. */- email_font?: string | null- /** A `signed_id` from `files.upload()` for the store logo, or `null` to remove it. */- logo_signed_id?: string | null- /** A `signed_id` from `files.upload()` for the logo embedded in transactional emails, or `null` to remove it. */- mailer_logo_signed_id?: string | null- /** Where prices come from: a registered provider key, or `internal`. */- pricing_provider?: string- /** Where stock levels come from: a registered provider key, or `internal`. */- inventory_provider?: string- /** `strict` refuses to price when the provider cannot answer; `fallback` uses the catalog. */- pricing_provider_failure_policy?: 'strict' | 'fallback'- /** `fallback` sells on the local snapshot when the provider cannot answer; `strict` refuses. */- inventory_provider_failure_policy?: 'strict' | 'fallback'- /** Blank means the built-in provider: the marketplace settles by hand. */- payout_provider?: string- default_payouts_schedule_interval?: string- /** A decimal string in the store's currency, e.g. `"50.00"`. */- default_minimum_payout_amount?: string- /** Admits a seller as soon as they finish onboarding, with no operator review. */- auto_approve_sellers?: boolean- /** Puts a seller's product on sale the moment they submit it, with no review. */- auto_approve_seller_products?: boolean- /** When false, transactional seller emails (approval, payouts, etc.) are suppressed. */- send_seller_transactional_emails?: boolean- /** Tax charged on commission as a fraction (`"0.23"` is 23%), when neither the rate nor the tax provider names one. */- default_commission_tax_rate?: string-}--export interface OptionValueParams {- /** Present for existing rows. Omit to create a new value. */- id?: string- name?: string- label?: string- position?: number- /** Hex color (e.g. `#FF0000`). Only meaningful when the parent option type's `kind` is `color_swatch`. */- color_code?: string | null- /** A `signed_id` from `files.upload()`, or `null` to remove the image. */- image_signed_id?: string | null-}--export interface OptionTypeCreateParams {- name: string- label: string- position?: number- filterable?: boolean- /** `dropdown`, `color_swatch`, or `buttons`. */- kind?: string- /**- * Inline option values. Values omitted from the array on update are destroyed —- * send the full set every time you write.- */- option_values?: Array<OptionValueParams>-}--export interface OptionTypeUpdateParams {- name?: string- label?: string- position?: number- filterable?: boolean- kind?: string- option_values?: Array<OptionValueParams>-}--export interface LineItemCreateParams {- variant_id: string- quantity?: number- /**- * Negotiated unit price (decimal string). Stamps the line- * `price_source: 'manual'` so quantity changes and recalculation never- * re-price it. Draft (incomplete) orders only.- */- price?: string-}--export interface LineItemUpdateParams {- quantity?: number- /**- * Negotiated unit price (decimal string). Stamps the line- * `price_source: 'manual'`; an explicit `null` reverts the line to- * catalog pricing. Omit to leave pricing alone. Draft (incomplete)- * orders only.- */- price?: string | null-}--export interface PaymentCreateParams {- payment_method_id: string- /**- * Decimal amount as a canonical string (`"1234.56"`: period decimal, no- * grouping). The API does not parse localized input; normalize it first.- */- amount?: string- source_id?: string-}--export interface RefundCreateParams {- payment_id: string- /** Decimal amount; see `PaymentCreateParams.amount` for the string rationale. */- amount: string- /** Refund reason ID (`rr_…`). Omitted → the store's first refund reason. */- refund_reason_id?: string-}--export interface FulfillmentCreateParams {- /** Stock location the fulfillment ships from */- stock_location_id: string- /**- * The only fulfillment of this order (`ful_…`) to move units from, its- * exchange and claim replacements included — how a canceled replacement is- * sent again. Omitted, the customer's bought units are taken from every- * unshipped fulfillment.- */- source_fulfillment_id?: string- /**- * 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's tracking URL.- */- tracking?: string- /**- * Delivery method (carrier) attached as the selected rate. Defaults to the- * delivery method of the fully drained source fulfillment(s).- */- delivery_method_id?: string- /**- * Explicit shipping cost (e.g. the 3PL price) as a plain decimal string or- * number, e.g. `'7.42'` — malformed values are rejected with a 422.- * 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.- */- cost?: string- /** Pass 'shipped' to register an already-shipped external fulfillment */- status?: 'shipped'- /** Line item quantities to fulfill; omit to fulfill every not-yet-shipped unit */- items?: Array<{ item_id: string; quantity: number }>- metadata?: Record<string, unknown>-}-/** One entry from `trackingCarriers.list()`. */export interface TrackingCarrierOption {/** Registry slug — what `tracking_carrier` stores */@@ -261,524 +66,14 @@ export interface TrackingCarrierOption {name: string}-export interface FulfillmentUpdateParams {- /** Carrier tracking number or a full `https://` tracking link; see {@link FulfillmentCreateParams.tracking} */- tracking?: string- /**- * Which carrier the tracking number belongs to — a slug from- * `trackingCarriers.list()`. Left blank, Spree detects it from the number's- * format where it can.- */- tracking_carrier?: string- selected_delivery_rate_id?: string- /** Move the fulfillment to another origin (sloc_...); re-prices it against that location's rates. */- stock_location_id?: string-}--/**- * Ships some or all of a fulfillment. A fulfillment has one origin, one- * carrier and one tracking number, so shipping a subset splits it first: the- * chosen quantities move into a new fulfillment which is the one that ships,- * and the remainder stays behind, still open.- */-export interface FulfillmentFulfillParams {- /** Line item quantities to ship; omit to ship everything the fulfillment holds */- items?: Array<{ item_id: string; quantity: number }>- /** Carrier tracking number or a full `https://` tracking link, stored on the fulfillment that ships */- tracking?: string- /** Which carrier the number belongs to (a `trackingCarriers.list()` slug); detected from the number when omitted */- tracking_carrier?: string- /**- * Whether the customer gets the shipment email. Defaults to true; pass false- * to suppress it for this dispatch only (a correction, a re-ship, goods- * handed over in person). The store's own transactional-email preference- * still applies on top.- */- notify_customer?: boolean- /**- * Hand the goods over even though the order is unpaid or holds backordered- * units. Shipping against an invoice is ordinary trade, so this is the- * merchant's call rather than something the API decides for them.- */- force?: boolean-}--/** What a label records, whether it was bought or uploaded. */-interface ShippingLabelDetails {- /** Free text — a forwarder's name is as valid as a carrier slug. Detected from the number when omitted. */- carrier?: string- /** Carrier service the label was bought at. */- service?: string- /** What the merchant paid the carrier. Admin-only accounting data; it never touches the order's shipping charge. */- cost?: string- /** Currency of the cost. */- currency?: string- /** `pdf`, `png` or `zpl`; taken from the file when omitted. */- file_format?: string- /** Tracking page for the consignment the label mints. */- tracking_url?: string-}--/**- * Recording a label bought elsewhere. The number printed on it is required:- * a label with no tracking number mints no consignment, and the server- * refuses it.- */-export interface ShippingLabelUploadParams extends ShippingLabelDetails {- /** A `signed_id` from `files.upload()`. Its presence records an uploaded label instead of buying one. */- file_signed_id: string- /** The number printed on an uploaded label. */- tracking_number: string-}--/** Buying through the carrier. The carrier supplies the file and the number. */-export interface ShippingLabelPurchaseParams extends ShippingLabelDetails {- file_signed_id?: never- tracking_number?: never-}--/** Buying a label takes no body; recording an uploaded one takes at least a file and a number. */-export type ShippingLabelCreateParams = ShippingLabelUploadParams | ShippingLabelPurchaseParams--export interface DeliveryCreateParams {- /** A carrier tracking number, a freight PRO or container number, or a full tracking link. */- tracking_number: string- /** Free text; detected from the number's format when omitted. */- carrier?: string- service?: string- tracking_url?: string-}--/** A corrected tracking number resets the consignment's carrier status to `pending`. */-export interface DeliveryUpdateParams {- tracking_number?: string- carrier?: string- service?: string- tracking_url?: string-}--export interface DeliveryMarkDeliveredParams {- /** When it arrived. Defaults to now. */- delivered_at?: string- /** Whether the customer gets a delivery notification once the parcel completes. Defaults to true. */- notify_customer?: boolean-}+/** @deprecated Renamed to `ShippingLabelCreateParams`. */+export type ShippingLabelUploadParams = ShippingLabelCreateParams-/**- * Records that the customer received the goods — the end of the fulfillment- * lifecycle. Reached by a carrier reporting delivery, by staff who know the- * parcel arrived, or by a customer collecting a pickup order.- */-export interface FulfillmentMarkDeliveredParams {- /**- * When it arrived, as an ISO 8601 string. Defaults to now. Carriers report a- * delivery time that is usually earlier than the webhook announcing it, and- * return windows run from the real one.- */- delivered_at?: string- /** Whether the customer gets a delivery notification. Defaults to true. */- notify_customer?: boolean-}--/**- * Moves `quantity` units of one variant out of a fulfillment into a new one.- * Splitting is per variant — a fulfillment holding several variants needs one- * call each.- */-export interface FulfillmentSplitParams {- /** The variant being moved out (variant_...) */- variant_id: string- quantity: number- /** Origin of the new fulfillment (sloc_...); defaults to the source fulfillment's location. */- stock_location_id?: string-}--export interface ReturnCreateParams {- /** Fulfilled units coming back, and how many of each */- items: Array<{ fulfillment_item_id: string; quantity: number }>- /** Where the goods come back to; defaults to the location that shipped them */- stock_location_id?: string- reason_id?: string- memo?: string-}--export interface ReturnUpdateParams {- memo?: string- reason_id?: string- stock_location_id?: string- metadata?: Record<string, unknown>-}--export interface ReturnReceiveParams {- /**- * What actually arrived. Omit to receive everything as requested and- * resellable — pass explicit rows for a partial or damaged receipt, which- * is the normal case.- */- items?: Array<{- return_line_item_id: string- quantity: number- /** Non-resellable goods are received but never restocked */- resellable?: boolean- }>-}--export interface ExchangeCreateParams {- /** Items coming back, and what should go out in their place */- items: Array<{ fulfillment_item_id: string; new_variant_id: string; quantity: number }>- stock_location_id?: string- reason_id?: string- memo?: string-}--export interface ExchangeUpdateParams {- memo?: string- reason_id?: string- stock_location_id?: string- metadata?: Record<string, unknown>-}--export interface ExchangeReceiveParams {- /** Omit to receive everything as requested and resellable */- items?: Array<{- exchange_line_item_id: string- quantity: number- resellable?: boolean- }>-}--export interface ExchangeFulfillParams {- /**- * How a credit is returned when the replacements cost less than what came- * back. A balance the customer owes is left for the merchant to collect.- */- refund_method?: 'original_payment' | 'store_credit'-}--export interface ClaimCreateParams {- /** Affected items, and how each should be made right */- items: Array<{- line_item_id: string- quantity: number- description?: string- send_replacement?: boolean- replacement_variant_id?: string- refund_amount?: string- }>- reason_id?: string- memo?: string-}--export interface ClaimUpdateParams {- memo?: string- reason_id?: string- metadata?: Record<string, unknown>-}--export interface ClaimResolveParams {- /** Money back, a replacement shipment, or both */- resolution: 'refund' | 'replacement' | 'refund_and_replacement'- refund_method?: 'original_payment' | 'store_credit'- /** Decimal amount; defaults to the claim total */- amount?: string- /**- * Which claim lines to send a replacement for. Omit to keep whatever the- * claim was opened with — the merchant usually decides what to send when- * resolving, not when the customer first reported the problem.- */- replacement_line_item_ids?: string[]-}--export interface ReturnRefundParams {- /**- * Decimal amount; see `PaymentCreateParams.amount` for the string- * rationale. Defaults to the value of what was actually received.- */- amount?: string- /**- * `store_credit` issues credit immediately; `original_payment` refunds- * through the gateway that took the money.- */- refund_method?: 'original_payment' | 'store_credit'-}--export interface AddressInputParams {- first_name?: string- last_name?: string- address1?: string- address2?: string- city?: string- postal_code?: string- country_code?: string- state_code?: string- phone?: string- company?: string-}--export interface OrderCreateParams {- email?: string- customer_id?: string- use_customer_default_address?: boolean- currency?: string- market_id?: string- /** Channel ID. Defaults to the store primary channel when omitted. */- channel_id?: string- /**- * Company ID. Makes the order a company purchase, with that company's- * catalog prices and tax treatment.- */- company_id?: string- /**- * 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.- */- preferred_stock_location_id?: string- locale?: string- customer_note?: string- /**- * The buyer's own purchase-order reference. Searchable alongside the order- * number, and rendered on every order-facing document.- */- po_number?: string- /**- * The `signed_id` of the buyer's purchase order, from `files.upload()` with- * `visibility: 'private'`.- */- po_document_signed_id?: string- /** Rich text HTML. Reads come back as this plus `internal_note_html`. */- internal_note?: string- metadata?: Record<string, unknown>- shipping_address?: AddressInputParams- shipping_address_id?: string- billing_address?: AddressInputParams- billing_address_id?: string- items?: Array<{- variant_id: string- quantity: number- metadata?: Record<string, unknown>- /** Negotiated unit price (decimal string); stamps `price_source: 'manual'`. */- price?: string- }>- /** Optional. Applied non-fatally; invalid codes do not block creation. */- coupon_code?: string-}--export interface OrderUpdateParams {- external_references?: ExternalReferencesParams- email?: string- customer_id?: string- customer_note?: string- /**- * The buyer's own purchase-order reference. Correctable after placement —- * a plain attribute write, never an order change.- */- po_number?: string- /**- * See {@link OrderCreateParams.po_document_signed_id}. Null removes the- * document the order currently carries.- */- po_document_signed_id?: string | null- /**- * Company ID. See {@link OrderCreateParams.company_id}. Null makes the draft- * a plain customer order again.- */- company_id?: string | null- /** Rich text HTML. Reads come back as this plus `internal_note_html`. */- internal_note?: string- /**- * Replaces the order's shipping address. The legacy `ship_address` spelling- * is still accepted by the API; send only one of the two.- */- shipping_address?: AddressInputParams- /** Replaces the order's billing address. See {@link OrderUpdateParams.shipping_address}. */- billing_address?: AddressInputParams- /**- * Line items to upsert, keyed by variant. An entry sets that variant's- * quantity, creating the line item when the order has none; `quantity: 0`- * removes it. Only the variants you send are touched — omitting one leaves- * it alone — so a whole edited order can be submitted in a single request- * and applied in one transaction.- */- items?: Array<{- variant_id: string- quantity: number- metadata?: Record<string, unknown>- /**- * Negotiated unit price (decimal string); stamps- * `price_source: 'manual'`. An explicit `null` reverts the line to- * catalog pricing; omit to leave pricing alone. Draft orders only.- */- price?: string | null- }>-}--export interface OrderCompleteParams {- payment_pending?: boolean- notify_customer?: boolean-}--export interface OrderCancelParams {- /** Why the order was canceled — an id from the store's cancellation reasons. */- cancel_reason_id?: string- /** Staff-facing note shown on the order. */- cancel_note?: string- /**- * Whether this order's share of a payment shared across a split checkout is- * handed back. An ordinary order settles at the gateway either way.- */- refund_payments?: boolean- /**- * How much of that share to return, defaulting to all of it. Refused on an- * ordinary order, where the gateway returns the payment in full.- * Decimal amount; see `PaymentCreateParams.amount` for the string rationale.- */- refund_amount?: string- notify_customer?: boolean-}--export interface GiftCardApplyParams {- code: string-}--/**- * Admin-issued gift card. `code` is optional — the server auto-generates- * a unique code when omitted. `currency` defaults to the store's currency.- * `customer_id` (customer prefixed ID) attaches the card to a specific customer.- */-export interface GiftCardCreateParams {- amount: string- currency?: string- code?: string- expires_at?: string | null- customer_id?: string | null-}--export interface GiftCardUpdateParams {- amount?: string- expires_at?: string | null- customer_id?: string | null-}--/**- * Bulk-issue a `codes_count`-sized batch of gift cards. The server generates- * codes by suffixing random hex onto `prefix`. Small batches generate inline;- * large ones (over `gift_card_batch_web_limit`, default 500) enqueue a- * background job.- */-export interface GiftCardBatchCreateParams {- prefix: string- amount: string- codes_count: number- currency?: string- expires_at?: string | null-}--export interface StoreCreditApplyParams {- /** Decimal amount; see `PaymentCreateParams.amount` for the string rationale. */- amount?: string-}--export interface CustomerCreateParams {- email: string- first_name?: string- last_name?: string- phone?: string- accepts_email_marketing?: boolean- /** Rich text HTML. Reads come back as this plus `internal_note_html`. */- internal_note?: string- metadata?: Record<string, unknown>- tags?: string[]- /** Prefixed customer group IDs. Replaces the customer's group membership. */- customer_group_ids?: string[]-}--export interface CustomerUpdateParams {- email?: string- first_name?: string- last_name?: string- phone?: string- accepts_email_marketing?: boolean- /** Rich text HTML. Reads come back as this plus `internal_note_html`. */- internal_note?: string- metadata?: Record<string, unknown>- tags?: string[]- /** Prefixed customer group IDs. Replaces the customer's group membership. */- customer_group_ids?: string[]-}--export interface CustomerAddressParams {- firstname?: string- lastname?: string- first_name?: string- last_name?: string- address1?: string- address2?: string- city?: string- zipcode?: string- postal_code?: string- country_id?: string- state_id?: string- country_code?: string- state_code?: string- phone?: string- company?: string- label?: string- is_default_billing?: boolean- is_default_shipping?: boolean-}--export interface CustomerStoreCreditCreateParams {- /** Decimal amount; see `PaymentCreateParams.amount` for the string rationale. */- amount: string- currency: string- memo?: string-}--export interface CustomerStoreCreditUpdateParams {- /** Decimal amount; see `PaymentCreateParams.amount` for the string rationale. */- amount?: string- memo?: string-}+/** @deprecated Renamed to `ShippingLabelCreateParams`. */+export type ShippingLabelPurchaseParams = ShippingLabelCreateParamsexport type MediaType = 'image' | 'video' | 'external_video'-export interface MediaCreateParams {- alt?: string- position?: number- /** Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`. */- media_type?: MediaType- /** YouTube or Vimeo link. Required when `media_type` is `external_video`. */- external_video_url?: string- /** Fetch an image from this URL. Images only — an external video uses `external_video_url`. */- url?: string- /** Direct-upload signed id for the media file itself. */- signed_id?: string- /**- * Place a file that is already in the library. The new row shares the- * source's file rather than copying it, and takes its own alt, position and- * variant links from here.- */- source_media_id?: string- /** Direct-upload signed id for a video's poster frame. */- poster_signed_id?: string- focal_point_x?: number | null- focal_point_y?: number | null- // Prefixed or raw variant IDs to link this product-level media to. Variants- // not on the same product are silently dropped server-side.- variant_ids?: Array<string>-}--/** Creating a file in the library, before it is placed on anything. */-export interface MediaLibraryCreateParams {- alt?: string- media_type?: MediaType- external_video_url?: string- signed_id?: string- poster_signed_id?: string-}-/** Where one library file is in use. */export interface MediaUsageReference {/**@@ -795,24 +90,8 @@ export interface MediaUsageReference {field: string | null}-/**- * One entry in a product's inline `media` list. An entry carrying `id` patches- * that media row; one carrying `signed_id` creates from a fresh upload; an- * external video creates from its URL alone. Omitting a persisted entry leaves- * it untouched — removal goes through the media endpoint's DELETE.- */-export interface ProductMediaInput {- id?: string- signed_id?: string- alt?: string | null- position?: number- media_type?: MediaType- external_video_url?: string | null- poster_signed_id?: string- focal_point_x?: number | null- focal_point_y?: number | null- variant_ids?: Array<string>-}+/** @deprecated Renamed to `ProductMediaParams`. */+export type ProductMediaInput = ProductMediaParams/** One per-asset configuration field a provider declares. */export interface DigitalAssetProviderSettingField {@@ -835,216 +114,11 @@ export interface DigitalAssetProvider {settings_schema: DigitalAssetProviderSettingField[]}-export interface DigitalAssetCreateParams {- /** A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for a file- * asset (the default source); omitted for a provider-backed asset. */- signed_id?: string- /** Provider shorthand from the `providers` endpoint. Omit for an uploaded file (the default source). */- provider_type?: string- /** Values for the provider's `settings_schema`, keyed by field name. */- provider_settings?: Record<string, unknown>- /** Defaults to the product's default variant when omitted. */- variant_id?: string- /** Null (or omitted) means the store's download settings apply. */- authorized_clicks?: number | null- authorized_days?: number | null-}--export interface DigitalAssetUpdateParams {- /** Replaces the file for everyone who already bought it. */- signed_id?: string- provider_type?: string- provider_settings?: Record<string, unknown>- variant_id?: string- authorized_clicks?: number | null- authorized_days?: number | null-}--export interface MediaUpdateParams {- alt?: string- position?: number- media_type?: MediaType- external_video_url?: string- poster_signed_id?: string- focal_point_x?: number | null- focal_point_y?: number | null- // Replaces the full set of variants this media is linked to. Empty array- // clears all links; omit the field entirely to leave links untouched.- variant_ids?: Array<string>-}--export interface ProductPublicationInput {- channel_id: string- published_at?: string | null- unpublished_at?: string | null-}--export interface ProductCreateParams {- external_references?: ExternalReferencesParams- name: string- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- slug?: string- status?: 'draft' | 'active' | 'archived'- tax_category_id?: string- /**- * Product type this product is created from (pt_...). A creation-time- * template: its option types and categories seed onto the product and its- * custom-field definitions drive the product's form. Editing the type later- * never rewrites existing products.- */- product_type_id?: string | null- /** Fulfillment profile deciding how this product ships (fp_...); null falls back to the store default. */- delivery_profile_id?: string | null- category_ids?: Array<string>- /**- * Collections this product belongs to. Assigning an automatic collection- * persists, but its next rule regeneration overwrites the member list — so- * in practice only manual collections belong here.- */- collection_ids?: Array<string>- tags?: Array<string>- /** Shorthand for a simple (no-options) product: prices ship alongside- * `name`/`status` and forward to the product's sole variant, so callers- * don't have to construct a `variants` array. For products with options,- * use `variants` instead and set prices per variant. Don't pass both. */- prices?: VariantPrice[]- /** Every purchasable attribute (sku, prices, stock, weight, dimensions) lives- * on variants. Pass at least one variant to make the product purchasable. */- variants?: ProductVariantInput[]- /** Media created alongside the product — see {@link ProductMediaInput}. */- media?: ProductMediaInput[]- /** Downloadable files shipped inline with the product (create-time). Each- * entry carries a `signed_id` (an uploaded file, to private storage) or a- * `provider_type` (a provider-backed asset); it attaches to the default- * variant unless `variant_id` is given. Edits/deletes use the nested- * `products.digitalAssets` endpoints. */- digital_assets?: DigitalAssetCreateParams[]- product_publications?: ProductPublicationInput[]-}--export interface ProductUpdateParams {- external_references?: ExternalReferencesParams- name?: string- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- slug?: string- status?: 'draft' | 'active' | 'archived'- tax_category_id?: string- /** See `ProductCreateParams.product_type_id`. Reassigning is non-destructive. */- product_type_id?: string | null- /** See `ProductCreateParams.delivery_profile_id`. */- delivery_profile_id?: string | null- category_ids?: Array<string>- /** See `ProductCreateParams.collection_ids`. */- collection_ids?: Array<string>- tags?: Array<string>- /** Shorthand for a simple (no-options) product — see `ProductCreateParams.prices`. */- prices?: VariantPrice[]- variants?: ProductVariantInput[]- /** See {@link ProductMediaInput}. */- media?: ProductMediaInput[]- /** See `ProductCreateParams.digital_assets`. */- digital_assets?: DigitalAssetCreateParams[]- product_publications?: ProductPublicationInput[]-}--/**- * A variant entry nested inside a product create/update payload.- *- * A nested entry may omit `options`: an options-less entry upserts onto the- * product's default variant — the simple, no-options product case. Pass `id`- * to update an existing variant.- */-export interface ProductVariantInput {- id?: string- sku?: string- cost_price?: string- cost_currency?: string- weight?: number- height?: number- width?: number- depth?: number- weight_unit?: string- dimensions_unit?: string- track_inventory?: boolean- /** Sell this variant before it's in stock ("Pre-order"). This adds the- * pre-order label + ships-by promise; the cap comes from `backorder_limit`,- * an incoming stock count, or backorder. */- preorderable?: boolean- /** The "ships by" date shown to customers while the variant is a pre-order- * (ISO 8601). Once it passes, the variant is no longer treated as a- * pre-order. Null clears it. */- preorder_ships_at?: string | null- /** Maximum units sellable beyond available stock — caps backorders and- * pre-orders. Null = unlimited. */- backorder_limit?: number | null- tax_category_id?: string- /** The carton this variant is packed into — a `PackageType` of kind- * `carton`. Its dimensions are shared by every product packed the same- * way, so a corrected carton size fixes all of them at once. */- carton_package_type_id?: string | null- /** How many units fill one carton. */- units_per_carton?: number | null- /** What one packed carton weighs, in the variant's weight unit. */- carton_weight?: string | number | null- /** How many cartons stack on one pallet. */- cartons_per_pallet?: number | null- position?: number- barcode?: string- /** Omit for a simple no-options product (upserts onto the default variant). */- options?: VariantOptionPair[]- /** Per-currency prices. Upserted by currency. */- prices?: VariantPrice[]- /** Stock per location. Upserted by location; omitted locations are removed. */- stock_levels?: VariantStockLevel[]-}--export interface CategoryCreateParams {- external_references?: ExternalReferencesParams- name: string- /** Prefixed ID of the parent category. Omit or null for a top-level category. */- parent_id?: string | null- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- permalink?: string- meta_title?: string- meta_description?: string- meta_keywords?: string- /** A `signed_id` from `files.upload()` for the landscape image. */- image_signed_id?: string | null- /** A `signed_id` from `files.upload()` for the square image. */- square_image_signed_id?: string | null-}--export interface CategoryUpdateParams {- external_references?: ExternalReferencesParams- name?: string- /** Prefixed ID of the parent category, or null to move it to the top level. */- parent_id?: string | null- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- permalink?: string- meta_title?: string- meta_description?: string- meta_keywords?: string- /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */- image_signed_id?: string | null- /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */- square_image_signed_id?: string | null-}+/** @deprecated Renamed to `ProductPublicationParams`. */+export type ProductPublicationInput = ProductPublicationParams-export interface CategoryRepositionParams {- /** Prefixed ID of the new parent. Omit/null to move to the top level. */- new_parent_id?: string | null- /** 0-based index among the new parent's children. */- new_position: number-}--export interface ProductMembershipRepositionParams {- /** 0-based index among the parent's products. */- new_position: number-}+/** @deprecated Renamed to `ProductVariantParams`. */+export type ProductVariantInput = ProductVariantParams/*** Default product sort applied to a collection's storefront listing. A@@ -1073,267 +147,17 @@ export type CollectionRuleMatchPolicy =| 'contains'| 'does_not_contain'-/**- * One rule of an automatic collection. Sent as part of the full `rules` set- * on create/update — see `CollectionUpdateParams['rules']`.- */-export interface CollectionRuleParam {- /** Prefixed `crule_` ID. Omit to create a new rule. */- id?: string- type: CollectionRuleType- value: string- match_policy?: CollectionRuleMatchPolicy-}--export interface CollectionCreateParams {- name: string- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- permalink?: string- meta_title?: string- meta_description?: string- meta_keywords?: string- /** A `signed_id` from `files.upload()` for the landscape image. */- image_signed_id?: string | null- /** A `signed_id` from `files.upload()` for the square image. */- square_image_signed_id?: string | null- /** Default product sort for the storefront listing. Defaults to `manual`. */- sort_order?: CollectionSortOrder- /** When true, membership is materialized from `rules` instead of curated by hand. */- automatic?: boolean- /** Whether a product must match all rules or any of them. Defaults to `all`. */- rules_match_policy?: 'all' | 'any'- rules?: CollectionRuleParam[]-}--export interface CollectionUpdateParams {- name?: string- /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */- description?: string- permalink?: string- /**- * 1-based position among the store's collections, written straight to the- * `acts_as_list` column — the first collection is `1`, and the server shifts- * its siblings. Collections are a flat list, so reordering is a plain update- * rather than a separate reposition action (which is where the `new_position`- * params, unlike this one, are 0-based indexes).- */- position?: number- meta_title?: string- meta_description?: string- meta_keywords?: string- /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */- image_signed_id?: string | null- /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */- square_image_signed_id?: string | null- sort_order?: CollectionSortOrder- automatic?: boolean- rules_match_policy?: 'all' | 'any'- /**- * The complete desired rule set — this is a sync setter, not a patch.- * Entries with an `id` are updated, entries without one are created, and- * any existing rule left out of the array is removed.- */- rules?: CollectionRuleParam[]-}--export interface VariantOptionPair {- name: string- value: string-}--export interface VariantPrice {- currency: string- /**- * Decimal amount as a canonical string (`"1234.56"`: period decimal, no- * grouping). The API does not parse localized input; normalize it first.- */- amount: string- compare_at_amount?: string | null-}--/** Stock for one variant at one location. */-export interface VariantStockLevel {- /** Prefixed id of the location holding the stock, e.g. `sloc_1234567890`. */- stock_location_id: string- /**- * Units physically at the location, not units available to sell — stock- * promised to placed orders is still counted here until it ships. Sent as- * the count the shelf should end at; the API records the difference as an- * adjustment in the stock history.- */- count_on_hand: number- /** Whether this location sells the variant beyond what it holds. */- backorderable?: boolean-}+/** @deprecated Renamed to `CollectionRuleParams`. */+export type CollectionRuleParam = CollectionRuleParams-export interface VariantCreateParams {- external_references?: ExternalReferencesParams- sku?: string- /** Decimal amount; see `VariantPrice.amount` for the string rationale. */- cost_price?: string- cost_currency?: string- weight?: number- height?: number- width?: number- depth?: number- weight_unit?: string- dimensions_unit?: string- track_inventory?: boolean- preorderable?: boolean- preorder_ships_at?: string | null- backorder_limit?: number | null- tax_category_id?: string- /** The carton this variant is packed into — a `PackageType` of kind- * `carton`. Its dimensions are shared by every product packed the same- * way, so a corrected carton size fixes all of them at once. */- carton_package_type_id?: string | null- /** How many units fill one carton. */- units_per_carton?: number | null- /** What one packed carton weighs, in the variant's weight unit. */- carton_weight?: string | number | null- /** How many cartons stack on one pallet. */- cartons_per_pallet?: number | null- position?: number- barcode?: string- /**- * The variant's option pairs (e.g. size + color). The non-empty tuple type- * requires at least one at compile time. Option types and values are- * auto-created if missing.- */- options: [VariantOptionPair, ...VariantOptionPair[]]- /** Per-currency prices. Upserted by currency. */- prices?: VariantPrice[]- /** Stock per location. Upserted by location; omitted locations are removed. */- stock_levels?: VariantStockLevel[]-}+/** @deprecated Renamed to `VariantOptionParams`. */+export type VariantOptionPair = VariantOptionParams-export interface VariantUpdateParams {- external_references?: ExternalReferencesParams- sku?: string- /** Decimal amount; see `VariantPrice.amount` for the string rationale. */- cost_price?: string- cost_currency?: string- weight?: number- height?: number- width?: number- depth?: number- weight_unit?: string- dimensions_unit?: string- track_inventory?: boolean- preorderable?: boolean- preorder_ships_at?: string | null- backorder_limit?: number | null- tax_category_id?: string- /** The carton this variant is packed into — a `PackageType` of kind- * `carton`. Its dimensions are shared by every product packed the same- * way, so a corrected carton size fixes all of them at once. */- carton_package_type_id?: string | null- /** How many units fill one carton. */- units_per_carton?: number | null- /** What one packed carton weighs, in the variant's weight unit. */- carton_weight?: string | number | null- /** How many cartons stack on one pallet. */- cartons_per_pallet?: number | null- position?: number- barcode?: string- /** Partial update — omit to leave option values untouched. */- options?: VariantOptionPair[]- /** Per-currency prices. Upserted by currency. */- prices?: VariantPrice[]- /** Stock per location. Upserted by location; omitted locations are removed. */- stock_levels?: VariantStockLevel[]-}+/** @deprecated Renamed to `PriceParams`. */+export type VariantPrice = PriceParams-export interface CustomFieldCreateParams {- custom_field_definition_id: string- value: unknown-}--export interface CustomFieldUpdateParams {- value: unknown-}--export interface CustomFieldDefinitionCreateParams {- namespace?: string- key: string- label?: string- field_type: string- /** Shorthand of the resource the field attaches to, e.g. `product`. See `customFieldDefinitions.resourceTypes()`. */- resource_type: string- storefront_visible?: boolean- /**- * Include values in storefront product text search. Supported- * `field_type`s: `short_text`, `long_text`, `number`. Other types are- * rejected by the API with 422.- */- searchable?: boolean- /**- * Allow storefront product listings to sort by this field- * (`sort=cf_{namespace}_{key}`). Supported `field_type`s:- * `short_text`, `number`. Other types are rejected by the API with 422.- */- sortable?: boolean-}--export interface CustomFieldDefinitionUpdateParams {- namespace?: string- key?: string- label?: string- field_type?: string- storefront_visible?: boolean- /**- * Include values in storefront product text search. Supported- * `field_type`s: `short_text`, `long_text`, `number`. Other types are- * rejected by the API with 422.- */- searchable?: boolean- /**- * Allow storefront product listings to sort by this field- * (`sort=cf_{namespace}_{key}`). Supported `field_type`s:- * `short_text`, `number`. Other types are rejected by the API with 422.- */- sortable?: boolean-}--export interface ApiKeyCreateParams {- name: string- key_type: 'publishable' | 'secret'- /** Required for `key_type: 'secret'`. See `Spree::ApiKey::SCOPES` for the full list. */- scopes?: string[]- /**- * Prefixed channel ID (`ch_…`) to bind a **publishable** key to a single- * channel of the same store. Create-only and immutable afterwards; a bound- * key rejects requests for other channels. Omit for a store-wide key.- */- channel_id?: string-}--export interface ApiKeyUpdateParams {- /**- * Only `name` is editable. `key_type` and `scopes` are fixed at creation —- * to change authority, create a new key and revoke the old one.- */- name: string-}--export interface InvitationCreateParams {- email: string- /** Prefixed role ID (e.g. `role_xxx`). */- role_id: string-}--/**- * Body for accepting an invitation. Empty for existing accounts when no- * password change is needed; populated with `password` (and optionally- * `password_confirmation` + names) for new accounts being created on accept.- */-export interface InvitationAcceptParams {- password?: string- password_confirmation?: string- first_name?: string- last_name?: string-}+/** @deprecated Renamed to `StockLevelParams`. */+export type VariantStockLevel = StockLevelParams/** Response of the public first-run setup availability check. */export interface SetupStatus {@@ -1341,40 +165,6 @@ export interface SetupStatus {setup_required: boolean}-/**- * Body for completing first-run setup: creates the first admin account and- * names the store, authorized by the one-time setup token printed at install- * time.- */-export interface SetupParams {- setup_token: string- email: string- password: string- password_confirmation?: string- first_name?: string- last_name?: string- store_name?: string- /**- * ISO 3166-1 alpha-2 country the store sells from, e.g. `US`. Required: it- * determines the default market, the warehouse, the delivery zones and the- * store's currency.- */- country_code: string- /**- * Load the demo catalog, customers and orders in the background once the- * admin account exists. The load takes minutes and downloads product- * images, so the response does not wait for it.- */- sample_data?: boolean- /** Storefront locale. Defaults to the country's own language. */- locale?: string- /**- * ISO 4217 currency, e.g. `EUR`. Defaults to the country's own currency —- * pass one only when the store prices in something else.- */- currency?: string-}-/** A country the store can be set up in, with everything derived from it. */export interface SetupCountry {/** ISO 3166-1 alpha-2 code, e.g. `CH`. */@@ -1382,594 +172,21 @@ export interface SetupCountry {name: string/** ISO 4217 currency the store gets when this country is chosen, e.g. `CHF`. */currency: string | null- /** Official languages, e.g. `['de', 'fr', 'it', 'rm']`. */- locales: string[]-}--/** Response of the public first-run setup country list. */-export interface SetupCountries {- countries: SetupCountry[]-}--/** Body for requesting a password reset email. */-export interface PasswordResetRequestParams {- email: string- /**- * Page the emailed reset link should point at (the reset token is appended- * as a `token` query param). Must match one of the store's allowed origins,- * otherwise it is ignored and the server-side default is used.- */- redirect_url?: string-}--/** Body for consuming a password reset token and setting the new password. */-export interface PasswordResetParams {- password: string- password_confirmation: string-}--export interface AdminUserUpdateParams {- first_name?: string- last_name?: string- /** Prefixed role IDs scoped to the current store. Treated as a complete replacement. */- role_ids?: string[]-}--/** Self-service update of the signed-in admin's own profile (PATCH /me). */-export interface MeUpdateParams {- /** Admin UI display language code (e.g. `de`). */- selected_locale?: string- first_name?: string- last_name?: string- /**- * A `signed_id` from `files.upload()` to set the avatar, or `null` to- * remove it. Omit to leave the current photo unchanged.- */- avatar_signed_id?: string | null-}--export interface StockLocationCreateParams {- external_references?: ExternalReferencesParams- name: string- admin_name?: string | null- active?: boolean- default?: boolean- /** Built-in values: 'warehouse' | 'store' | 'fulfillment_center'. Open string — plugins can register custom kinds. */- kind?: string- propagate_all_variants?: boolean- backorderable_default?: boolean- address1?: string | null- address2?: string | null- city?: string | null- zipcode?: string | null- phone?: string | null- company?: string | null- /** ISO-3166 alpha-2 country code (e.g. 'US'). */- country_code?: string | null- /** State / province abbreviation (e.g. 'NY'). Resolved against the selected country's states. */- state_code?: string | null- /** Free-text state for countries that don't have a states list. */- state_name?: string | null- pickup_enabled?: boolean- /** 'local' = items at this location only; 'any' = transfer-eligible (ship-to-store). */- pickup_stock_policy?: 'local' | 'any'- pickup_ready_in_minutes?: number | null- pickup_instructions?: string | null-}--export interface StockLocationUpdateParams {- external_references?: ExternalReferencesParams- name?: string- admin_name?: string | null- active?: boolean- default?: boolean- kind?: string- propagate_all_variants?: boolean- backorderable_default?: boolean- address1?: string | null- address2?: string | null- city?: string | null- zipcode?: string | null- phone?: string | null- company?: string | null- country_code?: string | null- state_code?: string | null- state_name?: string | null- pickup_enabled?: boolean- pickup_stock_policy?: 'local' | 'any'- pickup_ready_in_minutes?: number | null- pickup_instructions?: string | null-}--/** Corrects one stock level. */-export interface StockLevelUpdateParams {- external_references?: ExternalReferencesParams- /**- * The count the shelf should end at. The API records the difference as an- * `adjusted` movement rather than writing the column, so the correction- * appears in the stock history with everything else. Must be a whole number- * of zero or more.- */- count_on_hand?: number- /**- * A signed change to the shelf instead of a target count — "three more",- * "two fewer" — applied by the API to the count it holds at that moment.- * Recorded as an `adjusted` movement the same way. Must be a whole number;- * a fraction is refused. Cannot be sent together with `count_on_hand`.- */- adjustment?: number- /** Whether this location sells the variant beyond what it holds. */- backorderable?: boolean- /** Labels the correction in the stock history. Defaults to "Manual adjustment". */- reason?: string- metadata?: Record<string, unknown>-}--/**- * Identities a record has in external systems, keyed by system — the same- * `{ system: external_id }` map the Admin API renders, so what you read can be- * sent straight back. Systems you do not name keep the reference they have.- * A list of `{ system, external_id }` entries is accepted too.- */-export type ExternalReferencesParams =- | Record<string, string>- | Array<{ system: string; external_id: string }>--export interface StockLevelBulkUpsertRow {- variant_id: string- stock_location_id: string- /** The absolute level the external system reports. */- count_on_hand?: number- /** A relative change, for feeds that report movements rather than levels. */- adjustment?: number- backorderable?: boolean-}--export interface StockTransferItemParams {- variant_id: string- quantity_shipped: number-}--export interface StockTransferCreateParams {- source_location_id: string- destination_location_id: string- /** The merchant's own label for the trip. `null` clears it. */- reference?: string | null- notes?: string | null- /**- * A draft may open empty and gain lines as the merchant packs. Sending the- * list replaces whatever the draft currently holds.- */- items?: StockTransferItemParams[]- metadata?: Record<string, unknown>-}--export type StockTransferUpdateParams = Partial<StockTransferCreateParams>--/**- * One delivery against a transfer or a purchase order. Quantities are what- * this delivery brought — a second delivery adds to the first, it does not- * restate it.- */-export interface StockReceiptCreateParams {- /** The supplier's delivery note, or the carrier's reference. */- reference?: string | null- /** When the goods were counted in. Defaults to now. */- received_at?: string | null- notes?: string | null- /**- * Omit to book in everything still outstanding, intact. Naming lines — even- * none — records exactly what the dock counted. `quantity_accepted` reaches- * the shelf; `quantity_rejected` is refused, recorded with a- * `rejection_reason` and never stocked.- */- items?: StockReceiptItemParams[]-}--export interface StockReceiptItemParams {- /** The purchase order or transfer line. */- id: string- quantity_accepted?: number- quantity_rejected?: number- rejection_reason?: 'damaged' | 'wrong_item' | 'expired' | 'other' | null- notes?: string | null-}--/** Closing a transfer or an order short: why the balance is not coming. */-export interface ReceivableCloseParams {- reason?: string | null-}--export interface StockTransferCancelParams {- /**- * Required once the units have left the source: either they come back- * (`restock`) or they are written off as lost.- */- on_in_transit?: 'restock' | 'write_off'- reason?: string-}--export interface SupplierCreateParams {- name: string- contact_name?: string- email?: string- phone?: string- notes?: string- address1?: string- address2?: string- city?: string- state_name?: string- state_code?: string- country_code?: string- postal_code?: string- metadata?: Record<string, unknown>-}--export type SupplierUpdateParams = Partial<SupplierCreateParams>--export interface PurchaseOrderItemParams {- variant_id: string- quantity_ordered: number- /** What the merchant agreed to pay per unit, as a decimal string. */- unit_cost?: string-}--export interface PurchaseOrderCreateParams {- supplier_id: string- destination_location_id: string- /** Defaults to the store's currency; set it for a foreign-currency order. */- currency?: string- /** The day the supplier promised, as `yyyy-mm-dd`. `null` clears it. */- expected_at?: string | null- /** The day after which the goods are no longer wanted, as `yyyy-mm-dd`. `null` clears it. */- cancel_by?: string | null- /** The supplier's own order number. `null` clears it. */- reference?: string | null- notes?: string | null- items?: PurchaseOrderItemParams[]- metadata?: Record<string, unknown>-}--export type PurchaseOrderUpdateParams = Partial<PurchaseOrderCreateParams>--export interface RoleCreateParams {- /** Unique role name (machine identifier shown capitalized in the UI). */- name: string- /** Optional human description shown in the roles list. */- description?: string | null- /**- * Catalog permission keys (`read_orders`, `write_products`, …) — discover- * them via `client.permissions.list()`. A caller may only grant keys they- * effectively hold.- */- permissions?: string[]-}--export interface RoleUpdateParams {- name?: string- description?: string | null- permissions?: string[]-}--export interface AllowedOriginCreateParams {- /**- * Origin to allow in admin CORS preflight checks. Must be a bare- * `scheme://host[:port]` (no path, query, or fragment) and use `http` or- * `https`.- */- origin: string-}--export interface AllowedOriginUpdateParams {- origin?: string-}--export interface WebhookEndpointCreateParams {- /** Optional human label shown in the admin list view. */- name?: string | null- /** HTTPS destination URL. Cannot resolve to a private IP outside development. */- url: string- /** Defaults to true on create. Toggle with `disable`/`enable` for audit clarity. */- active?: boolean- /**- * Event names this endpoint should receive. Empty array or `['*']` subscribes- * to all events; otherwise list exact event names (e.g. `order.completed`) or- * patterns (e.g. `order.*`).- */- subscriptions?: string[]-}--export interface WebhookEndpointUpdateParams {- name?: string | null- url?: string- active?: boolean- subscriptions?: string[]-}--export interface WebhookEndpointDisableParams {- /** Optional human-readable reason shown next to the disabled indicator. */- reason?: string-}--/** How one custom field definition is used by a product type. */-export interface ProductTypeCustomFieldDefinitionParams {- /** Prefixed id of the custom field definition (`cfdef_…`). */- id: string- required?: boolean- sort_order?: number-}--/**- * Creates a product type. Associations are a template for products created- * with this type — they never mutate products that already carry it. Use- * `productTypes.applyToProducts` to backfill those.- */-export interface ProductTypeCreateParams {- name: string- /** Fulfillment profile stamped onto products created with this type (fp_...); null leaves them on the store default. */- delivery_profile_id?: string | null- /**- * Option types seeded onto products that get this type. Editing them never- * changes existing products — use `applyToProducts` for that.- */- option_type_ids?: string[]- /** Categories seeded onto products that get this type. */- category_ids?: string[]- /** Replace-set: definitions not listed are removed from the type. */- custom_field_definitions?: ProductTypeCustomFieldDefinitionParams[]-}--/**- * Updates a product type. `option_type_ids`, `category_ids` and- * `custom_field_definitions` are replace-sets: whatever is sent becomes the- * complete list, and anything omitted is removed from the type. Editing them- * leaves existing products untouched.- */-export interface ProductTypeUpdateParams {- name?: string- delivery_profile_id?: string | null- option_type_ids?: string[]- category_ids?: string[]- custom_field_definitions?: ProductTypeCustomFieldDefinitionParams[]-}--/** Result of enqueueing a backfill of a type's associations onto its products. */-export interface ProductTypeApplyToProductsResponse {- products_count: number-}--/**- * A policy document. `body` takes HTML and is sanitized server-side; the- * `body_html` on reads is the rendering of what was stored.- */-export interface PolicyCreateParams {- name: string- slug?: string- body?: string | null-}--export interface PolicyUpdateParams {- name?: string- slug?: string- body?: string | null-}--export interface TaxCategoryCreateParams {- name: string- tax_code?: string | null- description?: string | null- is_default?: boolean-}--export interface TaxCategoryUpdateParams {- name?: string- tax_code?: string | null- description?: string | null- is_default?: boolean-}--/**- * Return, claim and refund reasons share the same shape — a name and whether- * it is offered on new records.- */-export interface ReasonCreateParams {- name: string- active?: boolean-}--export interface ReasonUpdateParams {- name?: string- active?: boolean-}--export interface MarketCreateParams {- /** Display name (unique per store, e.g. "Europe"). */- name: string- /** ISO 4217 currency code (e.g. "EUR"). */- currency: string- /** IETF locale tag used as the market default (e.g. "de"). Always included in `supported_locales`. */- default_locale: string- /** Additional supported locales — the default is always implicitly present. */- supported_locales?: string[]- /** Display prices with tax included. */- tax_inclusive?: boolean- /** Setting `true` demotes the previous default in the store. */- default?: boolean- /** Sort order within the store; lower = first. */- position?: number- /** 2-letter ISO country codes assigned to this market. At least one is required. */- country_codes: string[]- /**- * Shorthand of the tax engine that prices this market (`internal`), from- * `taxProviders.list()`. `null` uses the installation default.- */- tax_provider?: string | null-}--export interface MarketUpdateParams {- name?: string- currency?: string- default_locale?: string- supported_locales?: string[]- tax_inclusive?: boolean- default?: boolean- position?: number- country_codes?: string[]- tax_provider?: string | null-}--export interface CustomerGroupCreateParams {- name: string- description?: string | null- customer_ids?: string[]-}--export interface ChannelCreateParams {- name: string- /**- * URL-safe slug. Optional — the backend derives it from +name+ when omitted- * (e.g. "Point of Sale" → "point-of-sale").- */- code?: string- active?: boolean- default?: boolean- /**- * Order routing strategy shorthand (built-in: `rules`), or `null` to- * inherit the store-level preference.- */- order_routing_strategy?: string | null- /**- * Storefront access posture: `public`, `prices_hidden`, or `login_required`.- * `null` (or an empty string) inherits the store-level preference.- */- storefront_access?: string | null- /**- * Whether guest checkout is allowed on this channel. `null` inherits the- * store-level preference.- */- guest_checkout?: boolean | null- /**- * Catalog (cat_...) shown to shoppers not covered by a company or customer- * group catalog. `null` means every product published on the channel.- */- default_catalog_id?: string | null- /** Fulfillment-origin allowlist (sloc_...); replaces the full set. Empty means every store location serves this channel. */- stock_location_ids?: string[]-}--export interface ChannelUpdateParams {- name?: string- code?: string- active?: boolean- default?: boolean- order_routing_strategy?: string | null- /**- * Storefront access posture: `public`, `prices_hidden`, or `login_required`.- * `null` (or an empty string) inherits the store-level preference.- */- storefront_access?: string | null- /**- * Whether guest checkout is allowed on this channel. `null` inherits the- * store-level preference.- */- guest_checkout?: boolean | null- /**- * Catalog (cat_...) shown to shoppers not covered by a company or customer- * group catalog. `null` means every product published on the channel.- */- default_catalog_id?: string | null- /** Fulfillment-origin allowlist (sloc_...); replaces the full set. Empty means every store location serves this channel. */- stock_location_ids?: string[]-}--export interface CustomerGroupUpdateParams {- name?: string- description?: string | null- customer_ids?: string[]-}--/**- * A marketplace seller. `status` is absent by design — a seller moves- * through its lifecycle via the invite/approve/suspend/reject actions,- * never through a plain update.- */-export interface SellerCreateParams {- name: string- /** URL-safe slug; derived from `name` when omitted. */- slug?: string- contact_email?: string | null- billing_email?: string | null- /** Sanitized HTML — the seller's public description. */- about?: string | null- /**- * Branding images. Pass a `signed_id` from `files.upload()` to set one,- * `null` to remove it, or omit the key to leave it untouched.- */- logo_signed_id?: string | null- square_logo_signed_id?: string | null- cover_photo_signed_id?: string | null- tax_remittance?: 'seller' | 'platform'- payouts_schedule_interval?: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'manual' | null- minimum_payout_amount?: string | null- /** Set while the seller is away: the catalog stays but stops selling. */- holiday_mode_until?: string | null- /**- * Written as nested attributes, never by id — an address has no store of- * its own, so an id would reference a row belonging to someone else.- */- billing_address?: SellerAddressParams- metadata?: Record<string, unknown>-}--/**- * The seller's own billing address. Their returns address is not written here- * — it lives on the stock location returns route to, so it is written through- * the stock locations endpoint.- */-export interface SellerAddressParams {- first_name?: string- last_name?: string- company?: string- address1?: string- address2?: string- city?: string- postal_code?: string- zipcode?: string- phone?: string- country_code?: string- state_code?: string- state_name?: string- label?: string-}--export type SellerUpdateParams = Partial<SellerCreateParams>--export interface SellerInviteParams {- email: string- /** A role the seller owns; defaults to the seller's own admin role. */- role_id?: string-}--export interface SellerSuspendParams {- reason?: string+ /** Official languages, e.g. `['de', 'fr', 'it', 'rm']`. */+ locales: string[]}-export interface SellerRejectParams {- reason?: string+/** Response of the public first-run setup country list. */+export interface SetupCountries {+ countries: SetupCountry[]}-/**- * Admitting a seller. `override_requirements` admits one whose onboarding- * checklist is unfinished — the operator's deliberate exception, which the- * seller.approved event records along with what was outstanding.- */-export interface SellerApproveParams {- override_requirements?: boolean-}+/** @deprecated Renamed to `StockLevelBulkUpsertRowParams`. */+export type StockLevelBulkUpsertRow = StockLevelBulkUpsertRowParams-/** Sending a seller back to onboarding, with what they have to fix. */-export interface SellerReopenOnboardingParams {- note?: string+/** Result of enqueueing a backfill of a type's associations onto its products. */+export interface ProductTypeApplyToProductsResponse {+ products_count: number}/** A resource a custom field definition can be attached to. */@@ -1980,33 +197,6 @@ export interface CustomFieldResourceType {name: string}-/** One configured entry on the marketplace's seller onboarding checklist. */-export interface SellerRequirementCreateParams {- /** The kind, from `sellerRequirements.types()` — e.g. `document`. */- type: string- /** Custom field definitions this requirement asks the seller to fill in. */- custom_field_definition_ids?: string[]- name?: string- description?: string- position?: number- active?: boolean- required?: boolean- preferences?: Record<string, unknown>- metadata?: Record<string, unknown>-}--/** `type` is absent: a saved row's kind never changes. */-export interface SellerRequirementUpdateParams {- custom_field_definition_ids?: string[]- name?: string- description?: string- position?: number- active?: boolean- required?: boolean- preferences?: Record<string, unknown>- metadata?: Record<string, unknown>-}-/** A requirement kind an operator can add, and the shape of its form. */export interface SellerRequirementType {type: string@@ -2045,87 +235,8 @@ export interface SellerOnboarding {requirements: SellerRequirementStatus[]}-/**- * One condition on a commission rate.- *- * Every rule must hold for the rate to apply, and a rule naming several- * records means any of them — so "(Cameras OR Audio) AND that seller" is a- * category rule holding two ids beside a seller rule holding one. A rate with- * no rules charges every sale.- *- * Kinds come from `commissionRates.ruleTypes()`; `preferences` are whatever- * that kind's schema declares. Catalog-scale references (products) ride- * alongside as their own field rather than inside preferences.- */-export interface CommissionRuleDraft {- /** Present for an existing rule. Omit to create one. */- id?: string | null- /** Wire shorthand for the kind — e.g. `seller_rule`, `item_total_rule`. */- type: string- /** Kind-specific configuration, coerced server-side by typed setters. */- preferences?: Record<string, unknown>- /** Prefixed product ids, for kinds that name products. */- product_ids?: string[]-}--export interface CommissionRateCreateParams {- name: string- /** Optional operator-facing identifier; unique per store. */- code?: string | null- enabled?: boolean- /**- * Place in the list, which IS the resolution order: rates are walked- * top-down and the first whose targeting matches the sale wins, so 1 is- * tried first.- *- * Omit on create — a new rate is placed at the top, ahead of anything more- * general already there. Send it to move an existing rate.- *- * Note that a rate with no `rules` matches every sale, so anything below it- * is unreachable; the marketplace default belongs at the bottom.- */- position?: number- /** `percentage` charges a share of the sale; `fixed` charges a flat fee. */- kind: 'percentage' | 'fixed'- /** A percentage (e.g. `10` for 10%) or a flat amount, per `kind`. */- value: string- /**- * What a flat fee charges, keyed by currency: `{ USD: '5.00', GBP: '4.00' }`.- * A rate is skipped for a currency it states no amount in, so that sale- * falls through to the next matching rate rather than being charged a- * converted figure nobody set. Replaces the whole set on write.- */- amounts?: Record<string, string>- /**- * Charge on the item's gross price rather than its net one. Off by default:- * in the EU the fee is a separate supply from the sale, so it is charged on- * the seller's net revenue and taxed on top.- */- tax_inclusive?: boolean- /**- * Also charge commission on the seller's delivery revenue. Percentage rates- * only — a flat fee already charges for the sale a parcel belongs to.- */- include_shipping?: boolean- /**- * The floor and cap a percentage charges within, keyed by currency:- * `{ USD: { min_amount: 1, max_amount: 50 } }`. Each holds only in its own- * currency; a sale in a currency with no bounds is charged unbounded rather- * than against a converted figure nobody set. Replaces the whole set on- * write, and never disturbs `amounts`.- */- bounds?: Record<string, { min_amount?: string | null; max_amount?: string | null }>- /**- * VAT on the commission itself, as a fraction (e.g. `0.21`). Leave null to- * let the store's tax engine answer for the seller's own jurisdiction.- */- commission_tax_rate?: string | null- /** The rate's full targeting; the server replaces what it holds with this. */- rules?: CommissionRuleDraft[]- metadata?: Record<string, unknown>-}--export type CommissionRateUpdateParams = Partial<CommissionRateCreateParams>+/** @deprecated Renamed to `CommissionRuleDraftParams`. */+export type CommissionRuleDraft = CommissionRuleDraftParams/*** Mask token the server applies to `:password`-typed preferences before@@ -2185,198 +296,15 @@ export interface ResourceTypeDefinition {// Price Lists// ----------------------------------------------------------------------------/**- * Nested-rule payload accepted by both create and update. Existing rules- * are matched by `id` and updated, new rules build, anything not in the- * array is destroyed — mirrors the Promotions editor's "save the whole- * thing in one PATCH" flow.- */-export interface PriceListRuleDraft {- /** Present for existing rules. Omit to create a new one. */- id?: string | null- /** Wire shorthand for the STI subclass — e.g. `volume_rule`, `market_rule`. */- type: string- /** Subclass-specific configuration; coerced server-side via typed preference setters. */- preferences?: Record<string, unknown>-}--/**- * One band of a price list's percentage adjustment: from this quantity up,- * the list adjusts base prices by this percentage instead of its own- * `price_adjustment_percentage`. The payload is the whole ladder — a band- * you leave out is a band you removed.- */-export interface PriceAdjustmentTierParams {- /** Above 1; quantity 1 is the list's own `price_adjustment_percentage`. */- min_quantity: number- /** Signed: negative discounts, positive marks up. */- percentage: string | number-}--export interface PriceListCreateParams {- name: string- description?: string | null- /**- * ISO 8601 timestamp. Pair with `ends_at` to schedule the list — an- * activated list with a future `starts_at` is auto-marked `scheduled`- * (mirrors the legacy admin).- */- starts_at?: string | null- ends_at?: string | null- /** `all` — every rule must match. `any` — first match wins. */- match_policy?: 'all' | 'any'- position?: number- /** Optional nested rules — reconciled on save. */- rules?: PriceListRuleDraft[]- /**- * Server-to-server shape. Each row upserts on- * `(variant_id, currency, price_list_id, min_quantity)`, 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[]- /** Quantity bands on this list's percentage adjustment. */- price_adjustment_tiers?: PriceAdjustmentTierParams[]-}--export interface PriceListUpdateParams {- name?: string- description?: string | null- starts_at?: string | null- ends_at?: string | null- match_policy?: 'all' | 'any'- position?: number- 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. Product membership is- * managed through `client.priceLists.products` instead.- */- prices?: PriceListPriceOverrideParams[]- /** Quantity bands on this list's percentage adjustment. */- price_adjustment_tiers?: PriceAdjustmentTierParams[]-}--/**- * One row in the inline `prices: [...]` array carried by- * `PriceListCreateParams` / `PriceListUpdateParams`. The server upserts- * on the unique key `(variant_id, currency, price_list_id, min_quantity)`,- * so the row matches by that key — `id` is only useful when echoing back- * rows read from a previous response. For first-time creates ship- * `variant_id` + `currency` + `amount` directly.- */-export interface PriceListPriceOverrideParams {- id?: string- variant_id: string- currency: string- /** The rung of the variant's ladder. Omit for the bottom rung. */- min_quantity?: number- amount?: string | null- compare_at_amount?: string | null-}+/** @deprecated Renamed to `PriceListRuleParams`. */+export type PriceListRuleDraft = PriceListRuleParams// ---------------------------------------------------------------------------// Prices (generic — base prices AND price-list overrides)// ----------------------------------------------------------------------------/**- * Create or update a single Spree::Price. Set `price_list_id: null`- * (or omit it) for a base price on the variant; pass a prefixed- * `pl_…` to attach the row to a price list.- */-export interface PriceCreateParams {- variant_id: string- currency: string- /**- * The quantity a line must reach for this price to apply. Omit for the- * ladder's bottom rung. Anything above 1 requires a `price_list_id`.- */- min_quantity?: number- amount: string | null- compare_at_amount?: string | null- /** Omit / null for a base price; prefixed `pl_…` for a list override. */- price_list_id?: string | null-}--export interface PriceUpdateParams {- /** Mutating these would re-key the row against the unique- * `(variant_id, currency, price_list_id, min_quantity)` index — not- * supported. Move a rung by deleting it and creating the new one. */- // variant_id, currency, price_list_id, min_quantity intentionally omitted.- amount?: string | null- compare_at_amount?: string | null-}--/**- * One row in the `POST /admin/prices/bulk_upsert` payload.- *- * Two modes, picked by whether `id` is set:- *- * - `id` present → updates that row (404s if it doesn't exist or- * is out of the caller's store scope).- * - `id` absent → upserts by- * `(variant_id, currency, price_list_id, min_quantity)`. The unique- * index on `spree_prices` decides update-vs-create.- *- * Useful for the spreadsheet (mostly updates) and for ad-hoc seeding- * a fresh currency across many variants (mostly creates).- */-export interface PriceBulkUpsertRow {- /** Present → update by id. Absent → upsert by the unique key. */- id?: string- /** Required when `id` is absent. */- variant_id?: string- /** Required when `id` is absent. */- currency?: string- /** Null / omitted = base price; prefixed `pl_…` = list override. */- price_list_id?: string | null- /**- * The rung of the variant's ladder this row is. Omit for the bottom rung;- * anything above 1 requires a `price_list_id`. A variant carries at most- * ten rungs on one list per currency.- */- min_quantity?: number- amount?: string | null- compare_at_amount?: string | null-}--export interface PaymentMethodCreateParams {- /**- * Wire shorthand (`Spree::PaymentMethod.api_type`), not the Ruby class- * name — e.g. `'check'`, not `'Spree::PaymentMethod::Check'`. Discover the- * available values from `paymentMethods.types()`.- */- type: string- name: string- description?: string | null- active?: boolean- /** `false` → admin-only; `true` → also on the storefront. */- storefront_visible?: boolean- /** @deprecated Use `capture_method`; removed in 6.1. */- auto_capture?: boolean | null- /** When customers are charged for this method. `null` inherits the store setting. */- capture_method?: 'checkout' | 'on_dispatch' | 'manual' | null- position?: number- metadata?: Record<string, unknown>- /** Provider-specific configuration; values are coerced via the typed setters. */- preferences?: Record<string, unknown>-}--export interface PaymentMethodUpdateParams {- name?: string- description?: string | null- active?: boolean- /** `false` → admin-only; `true` → also on the storefront. */- storefront_visible?: boolean- /** @deprecated Use `capture_method`; removed in 6.1. */- auto_capture?: boolean | null- /** When customers are charged for this method. `null` inherits the store setting. */- capture_method?: 'checkout' | 'on_dispatch' | 'manual' | null- position?: number- metadata?: Record<string, unknown>- preferences?: Record<string, unknown>-}+/** @deprecated Renamed to `PriceBulkUpsertRowParams`. */+export type PriceBulkUpsertRow = PriceBulkUpsertRowParams/*** One entry returned by `GET /payment_methods/types` — the registered list@@ -2419,23 +347,6 @@ export interface IntegrationTypeDefinition {schema: PreferenceSchema}-export interface IntegrationCreateParams {- /** Wire shorthand from `integrations.types()`. */- type: string- /** Activation runs the connection check server-side and 422s on failure. */- active?: boolean- /**- * Credential values; secret (`password`-typed) preferences come back- * masked, and submitting a masked value back keeps the stored secret.- */- preferences?: Record<string, unknown>-}--export interface IntegrationUpdateParams {- active?: boolean- preferences?: Record<string, unknown>-}-/*** API shorthand for an export type (`Spree::Export.api_type`), not the Ruby* class name. The server validates `type` against the configured allowlist@@ -2454,29 +365,6 @@ export type ExportType =| 'price_list_prices'| (string & {})-export interface ExportCreateParams {- /** Which dataset to export. Server validates against `Spree::Export.available_types`. */- type: ExportType- /**- * Ransack query hash. Same predicate shape used on list endpoints- * (`{ name_cont: 'shirt', price_gt: 10 }`). Ignored when `record_selection`- * is `'all'`. Use `filtersToRansack(filters, columns)` from the SPA helper- * to turn the toolbar filter state into this shape.- */- search_params?: Record<string, unknown>- /**- * `'filtered'` (default) keeps `search_params`; `'all'` clears them on the- * server and exports every record in scope.- */- record_selection?: 'filtered' | 'all'- /**- * Absolute URL of your admin's 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.- */- results_url?: string-}-/*** API shorthand for an import type (`Spree::Import.api_type`), not the Ruby* class name.@@ -2488,41 +376,8 @@ export type ImportType =| 'price_list_prices'| (string & {})-export interface ImportCreateParams {- /** Which dataset to import. Server validates against `Spree::Import.available_types`. */- type: ImportType- /** The `signed_id` of the uploaded CSV, from `files.upload()` with `visibility: 'private'`. */- attachment_signed_id: string- /** CSV column separator. Defaults to a comma on the server. */- delimiter?: ',' | ';' | '|' | '\t'- /**- * For `price_list_prices` imports: the price list the rows are merged- * into. Must belong to the current store (404 otherwise); ignored by- * every other type.- */- price_list_id?: string- /**- * Absolute URL of the dashboard's 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.- */- results_url?: string-}--export interface ImportMappingParam {- /** Canonical schema field name (see `Import.schema_fields[].name`). */- schema_field: string- /** CSV header to read the field from; `null` unmaps the field. */- file_column: string | null-}--export interface ImportCompleteMappingParams {- /**- * Column assignments to apply before processing starts. Omit to accept- * the auto-assigned mappings from the create response.- */- mappings?: ImportMappingParam[]-}+/** @deprecated Use `ImportCompleteMappingParams['mappings']` entries. */+export type ImportMappingParam = NonNullable<ImportCompleteMappingParams['mappings']>[number]/*** Owner type passed to the generic `client.customFields(ownerType, ownerId)`@@ -2542,114 +397,11 @@ export type CustomFieldOwnerType =export type PromotionKind = 'coupon_code' | 'automatic'-export interface PromotionCreateParams {- name: string- description?: string | null- starts_at?: string | null- expires_at?: string | null- /** Required for single-code coupon promotions. Ignored when `multi_codes` is true. */- code?: string | null- usage_limit?: number | null- match_policy?: 'all' | 'any'- path?: string | null- promotion_category_id?: string | null- /** `coupon_code` requires a code (or multi_codes); `automatic` triggers without one. */- kind?: PromotionKind- /** When true, server auto-generates `number_of_codes` codes prefixed with `code_prefix`. */- multi_codes?: boolean- number_of_codes?: number | null- code_prefix?: string | null- metadata?: Record<string, unknown>- /** Optional rules to create alongside the promotion. Sent as a desired-set on update. */- rules?: PromotionRuleDraft[]- /** Optional actions to create alongside the promotion. */- actions?: PromotionActionDraft[]-}--export interface PromotionUpdateParams {- name?: string- description?: string | null- starts_at?: string | null- expires_at?: string | null- code?: string | null- usage_limit?: number | null- match_policy?: 'all' | 'any'- path?: string | null- promotion_category_id?: string | null- kind?: PromotionKind- multi_codes?: boolean- number_of_codes?: number | null- code_prefix?: string | null- metadata?: Record<string, unknown>- /** Replaces the rule set: rows with `id` update, rows without build, missing rows are removed. */- rules?: PromotionRuleDraft[]- /** Same desired-set semantic as `rules`. */- actions?: PromotionActionDraft[]-}--/**- * One entry in a `Promotion#rules`/`#actions` payload. `id` is optional —- * supply it on updates to match an existing row, omit for new rows. The- * server reconciles to the desired set: anything not in the array is- * removed.- */-export interface PromotionRuleDraft {- id?: string- /**- * Wire shorthand for the rule subclass (e.g. `'currency'`, `'item_total'`,- * `'product'`, `'category'`). Returned by `GET /promotion_rules/types`.- */- type: string- preferences?: Record<string, unknown>- /** For the `product` rule. */- product_ids?: string[]- /** For the `category` rule. */- category_ids?: string[]- /** For the `user` rule — customers who qualify for the promotion. */- customer_ids?: string[]-}--export interface PromotionActionDraft {- id?: string- /**- * Wire shorthand for the action subclass (e.g. `'free_shipping'`,- * `'create_item_adjustments'`, `'create_adjustment'`). Returned by- * `GET /promotion_actions/types`.- */- type: string- preferences?: Record<string, unknown>- /** For adjustment actions. */- calculator?: PromotionActionCalculatorParams- /** For `create_line_items`. */- line_items?: PromotionActionLineItemParams[]-}--/**- * Nested calculator payload for adjustment actions. Sent on- * `create_adjustment` and `create_item_adjustments`.- *- * - `type` — wire shorthand for the calculator subclass (e.g. `'flat_rate'`,- * `'flat_percent_item_total'`, `'percent_on_line_item'`); changing the- * type swaps the underlying calculator record.- * - `preferences` — per-calculator preference values (`amount`,- * `flat_percent`, `currency`, …). Keys are coerced via the typed- * setters server-side.- */-export interface PromotionActionCalculatorParams {- type?: string- preferences?: Record<string, unknown>-}+/** @deprecated Renamed to `PromotionRuleDraftParams`. */+export type PromotionRuleDraft = PromotionRuleDraftParams-/**- * Nested promotion-action line item — one row in the "give the customer- * variant X with quantity N" payload for `CreateLineItems`. The submitted- * list is the *desired* set: variants not present are removed, variants- * present are upserted by `(promotion_action_id, variant_id)`.- */-export interface PromotionActionLineItemParams {- variant_id: string- quantity: number-}+/** @deprecated Renamed to `PromotionActionDraftParams`. */+export type PromotionActionDraft = PromotionActionDraftParams/*** One entry returned by `GET /promotion_actions/calculators?type=…` — a@@ -2663,426 +415,10 @@ export interface PromotionActionCalculator {schema: PreferenceSchema}-export interface PromotionActionCreateParams {- /** Wire shorthand for the action subclass (e.g. `'free_shipping'`). */- type: string- preferences?: Record<string, unknown>- /** For adjustment actions — calculator subclass + its preference values. */- calculator?: PromotionActionCalculatorParams- /** For `CreateLineItems` — desired set of variants + quantities. */- line_items?: PromotionActionLineItemParams[]-}--export interface PromotionActionUpdateParams {- preferences?: Record<string, unknown>- calculator?: PromotionActionCalculatorParams- line_items?: PromotionActionLineItemParams[]-}--export interface OrderRoutingRuleCreateParams {- /** Wire shorthand for the rule subclass (e.g. `'preferred_location'`), from `GET /order_routing_rules/types`. */- type: string- active?: boolean- /** 1-based priority in the channel's rule list. Omit to append at the end. */- position?: number- preferences?: Record<string, unknown>-}--export interface OrderRoutingRuleUpdateParams {- active?: boolean- /** Assigning a new position reorders the rest of the channel's list around it. */- position?: number- preferences?: Record<string, unknown>-}--export interface PromotionRuleCreateParams {- /** Wire shorthand for the rule subclass (e.g. `'currency'`, `'item_total'`). */- type: string- preferences?: Record<string, unknown>- /** For the `product` rule — prefixed product IDs to associate with this rule. */- product_ids?: string[]- /** For the `category` rule — prefixed category IDs. */- category_ids?: string[]- /** For the `user` rule — prefixed customer IDs. */- customer_ids?: string[]-}--export interface PromotionRuleUpdateParams {- preferences?: Record<string, unknown>- product_ids?: string[]- category_ids?: string[]- customer_ids?: string[]-}--/**- * Creates or updates a delivery profile — the grouping that decides how a- * set of products ships (origins, zones, methods). `stock_location_ids` is a- * replace-set; empty means every store location.- */-export interface DeliveryProfileParams {- name?: string- /** Registered profile kind (`shipping`, `digital`, extension kinds); create-only, defaults to shipping. */- kind?: string- /** Promotes this profile to the store default; the previous default is demoted. */- default?: boolean- position?: number- /** Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location. */- stock_location_ids?: string[]-}--/**- * Creates or updates an origin group — the partition of a profile's- * fulfillment origins that its zones and methods hang off. `stock_location_ids`- * is a replace-set; empty means every store location.- */-export interface DeliveryOriginGroupParams {- name?: string | null- position?: number- /** Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location. */- stock_location_ids?: string[]-}--export interface DeliveryMethodParams {- name?: string- admin_name?: string | null- code?: string | null- /** Fulfillment provider shorthand (see `deliveryMethods.fulfillmentProviders()`), e.g. `manual`. */- fulfillment_provider?: string- /** Delivery profile this method belongs to (fp_...); defaults to the store default profile. */- delivery_profile_id?: string- /** Origin group offering this method (og_...); defaults to the zone's group, else the profile's default group. */- delivery_origin_group_id?: string- pickup_point_provider?: string | null- /**- * Rate provider shorthand (see `deliveryMethods.rateProviders()`), e.g. `easy_post`.- * Omit or send null for the built-in Internal provider, which prices- * through the method's calculator.- */- rate_provider?: string | null- storefront_visible?: boolean- /**- * Marketplace only: whether a seller's packages may be quoted by this- * method. Off by default — sharing shipping is a decision, not a starting- * point — and refused on a method that belongs to a seller.- */- available_to_sellers?: boolean- tracking_url?: string | null- estimated_transit_business_days_min?: number | null- estimated_transit_business_days_max?: number | null- /** Prefixed tax category ID (`taxcat_...`), or null to clear. */- tax_category_id?: string | null- /**- * How the method prices a shipment: the calculator's wire shorthand, e.g.- * `'flat_rate'` (see `deliveryMethods.calculators()`), and its preferences,- * which must match the `schema` that list carries.- */- calculator?: { type?: string; preferences?: Record<string, unknown> }- /** Prefixed delivery zone ID (`dz_...`) narrowing destinations, or null for no restriction. Must belong to the method's profile. */- delivery_zone_id?: string | null- /**- * Method-level percentage handling fee added on top of provider-quoted- * rates. Ignored for calculator-priced methods.- */- markup_percent?: string | null- /** Method-level flat handling fee added on top of provider-quoted rates. */- markup_flat?: string | null- /**- * Carrier service rows: which provider services this method offers, each- * with an optional display label and markup override. Replaces the full- * set — omitted rows are removed; no rows means every service the- * provider returns is offered.- */- services?: DeliveryMethodServiceParams[]-}--/** One carrier service row on a delivery method. */-export interface DeliveryMethodServiceParams {- /** Prefixed row ID (`dms_...`) when updating an existing row. */- id?: string- /** Carrier identifier as the provider's API knows it, e.g. `UPS`. */- carrier: string- /** Service identifier as the provider's API knows it, e.g. `Ground`. */- service: string- /** Display label shown to customers instead of the carrier-derived name. */- label?: string | null- /** Overrides the method-level flat markup for this service. */- markup_flat?: string | null- /** Overrides the method-level percentage markup for this service. */- markup_percent?: string | null- position?: number-}--export interface DeliveryZoneMemberParams {- member_type: 'country' | 'state' | 'postal_code'- country_code?: string- state_code?: string- postal_code_prefix?: string- postal_code_from?: string- postal_code_to?: string-}--export interface DeliveryZoneParams {- name?: string- description?: string | null- /** Fulfillment profile this zone belongs to (fp_...); create-only, defaults to the store default profile. */- delivery_profile_id?: string- /** Replaces the zone's full member set atomically. */- members?: DeliveryZoneMemberParams[]-}--export interface PackageTypeCreateParams {- /** Unique within the store. */- name: string- /** What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale order leaves on. */- kind: 'box' | 'envelope' | 'carton' | 'pallet' | 'container'- length?: number | null- width?: number | null- height?: number | null- /** Unit the three dimensions are in; falls back to the store's unit system. */- dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft' | null- /** The empty package's own weight, added to content weight on every quote. */- weight?: number | null- /** What the package can hold — not the same as its own weight. */- max_weight?: number | null- weight_unit?: 'g' | 'kg' | 'lb' | 'oz' | null- /** The box every parcel quote is built on. Setting this demotes whichever row held it. */- default?: boolean- metadata?: Record<string, unknown>-}--/** Every field is optional: correcting one measurement is a valid update. */-export type PackageTypeUpdateParams = Partial<PackageTypeCreateParams>--export interface CompanyParams {- name?: string- /**- * `company` = legal entity (may hold tax registrations), `division` =- * organizational unit. Roots must be `company`.- */- kind?: 'company' | 'division'- /** The parent node (comp_...). Omit or null for a root. */- parent_id?: string | null- /**- * Whether this buyer's own procurement process demands a PO reference on- * every order — checkout asks for one and refuses to complete without it.- */- po_number_required?: boolean- external_references?: ExternalReferencesParams- metadata?: Record<string, unknown>-}--/** Address fields, created inline and owned by the address-book entry. */-export interface CompanyAddressFieldsParams {- first_name?: string- last_name?: string- company?: string- address1?: string- address2?: string- city?: string- postal_code?: string- zipcode?: string- phone?: string- country_code?: string- state_code?: string- state_name?: string-}--/**- * An address book entry is the address itself, so its fields sit alongside the- * label rather than under an `address` key. Send only what changes on update.- */-export interface CompanyAddressParams extends CompanyAddressFieldsParams {- /** 'Headquarters', 'Plant 2 dock', ... */- label?: string | null- /** The node points at one address per kind, so promoting moves the pointer. */- default_billing?: boolean- default_shipping?: boolean-}--export interface CompanyMembershipCreateParams {- /**- * The person's email. An existing customer becomes a member immediately;- * an unknown email becomes an invitation and the response is a- * CompanyInvitation instead of a CompanyMembership.- */- customer_email: string- metadata?: Record<string, unknown>-}--export interface CatalogParams {- name?: string- /**- * The catalog-wide quantity terms — the middle of the three levels a- * buyer's rules resolve through (variant base -> this -> a per-variant- * override). Null on either leaves that field to the variant's own rule.- */- minimum_order_quantity?: number | null- order_multiple?: number | null- /**- * The whole audience, saved with the catalog. An entry absent from the- * array is withdrawn; omitting the key leaves the audience alone.- */- assignments?: Array<{ assignable_type: 'company' | 'customer_group'; assignable_id: string }>- /**- * The whole order-minimum set, saved with the catalog. A currency absent- * from the array has its minimum lifted; omitting the key leaves them- * alone.- */- order_minimums?: Array<{ currency: string; amount: string | number }>- /** Internal note on what the agreement is — never shown to shoppers. */- description?: string | null- active?: boolean- position?: number- /**- * The price list this catalog prices through, written inline: an object- * creates the owned list or updates the one already there. An explicit- * `null` **deletes** that list — an owned list is matched by its catalog- * rather than by an audience of its own, so releasing it into general- * matching would price every shopper; it is a soft delete, so the prices- * stay recoverable. Omit the key, or send `{}`, to leave the pricing- * alone.- *- * A catalog with an EMPTY assortment is a pricing-only overlay — its list- * applies and nothing is hidden; curate products (or call importProducts)- * to make it restrictive.- */- price_list?: CatalogPriceListParams | null- metadata?: Record<string, unknown>-}--/** The owned list's attributes, as accepted on catalog create and update. */-export interface CatalogPriceListParams {- name?: string- description?: string | null- status?: string- match_policy?: string- starts_at?: string | null- ends_at?: string | null- /** Signed: negative discounts off base prices, positive marks up. */- price_adjustment_percentage?: string | null- adjust_compare_at?: boolean- /**- * Contextual rules for the owned list — in practice a `volume_rule`, which- * is what turns a percentage into an automatic volume discount.- *- * This payload speaks only for those: the catalog's assignments already- * decide who the agreement is for, so audience rules on the list are left- * exactly as they are, and an empty array clears the contextual rules- * without touching them.- */- rules?: Array<PriceListRuleDraft>- /**- * Explicit per-variant amounts. An empty array clears them, which is what- * switching from hand-entered prices to a percentage sends.- */- prices?: Array<PriceListPriceOverrideParams>- /**- * Quantity bands on the percentage — "5% off, 10% from ten, 20% from- * fifty" as one agreement. The payload is the whole ladder, so an empty- * array clears it.- */- price_adjustment_tiers?: Array<PriceAdjustmentTierParams>-}--/**- * A catalog's quantity terms for ONE variant — the narrowest of the three- * levels. Both fields are independently optional, but a row must state at- * least one: an override that overrides nothing is a half-filled form.- */-export interface CatalogQuantityRuleParams {- /** Prefixed variant id (variant_...). Required on create. */- variant_id?: string- minimum_order_quantity?: number | null- order_multiple?: number | null-}--/**- * The least a whole order must come to under this agreement, in ONE- * currency. One row per currency — Spree holds no exchange rates, so a- * threshold is never stated once and converted.- */-export interface CatalogOrderMinimumParams {- /** ISO 4217 code. Required on create; unique per catalog. */- currency?: string- amount?: string-}--/**- * Per-product quantity terms, keyed by prefixed product id. Both fields null- * clears that product's terms; a product not in the assortment is added.- */-export interface CatalogProductTermsParams {- terms: Record<string, { minimum_order_quantity?: number | null; order_multiple?: number | null }>-}--/** The whole order-minimum set. A currency left out has its minimum lifted. */-export interface CatalogOrderMinimumsParams {- order_minimums: Array<{ currency: string; amount: string | number }>-}--/** The whole audience. An entry left out is withdrawn. */-export interface CatalogAssignmentsParams {- assignments: Array<{ assignable_type: 'company' | 'customer_group'; assignable_id: string }>-}--export interface CatalogAssignParams {- /**- * Who sees the catalog — buyer audiences only. A company assignment covers- * the node's subtree; a channel's catalog is its `default_catalog_id`.- */- assignable_type: 'customer_group' | 'company'- assignable_id: string-}--export interface TaxIdentifierParams {- /** The regime the number belongs to, e.g. `eu_vat`, `gb_vat`. */- kind?: string- value?: string-}--export interface TaxExemptionCertificateParams {- certificate_number?: string- /** Becomes the tax provider's entity use code, e.g. `resale`. */- reason_code?: string- /** Where the certificate holds. Omit both for one valid everywhere. */- country_code?: string | null- state_code?: string | null- issued_at?: string | null- expires_at?: string | null- issuing_authority?: string | null- /** A `signed_id` from `files.upload()` with `visibility: 'private'`. */- document_signed_id?: string- metadata?: Record<string, unknown>-}--export interface TaxRateParams {- name?: string- /** The rate as a fraction in a decimal string, e.g. `"0.23"`. Send this or `rate_percent`. */- rate?: string- /** The rate as a percentage in a decimal string, e.g. `"23"`. */- rate_percent?: string- /** Where the rate applies. A rate naming no country taxes everywhere. */- country_code?: string | null- state_code?: string | null- tax_category_id?: string- included_in_price?: boolean- show_rate_in_label?: boolean- calculator_type?: string-}-// ============================================// Saved reports (semantic reporting layer)// ============================================-export interface SavedReportCreateParams {- name: string- description?: string | null- /** A reporting contract query — validated against the registry on save. */- query: ReportingQuery-}--export type SavedReportUpdateParams = Partial<SavedReportCreateParams>-/*** The outstanding balance for one currency, summed over the filter the list* request used. Amounts are decimal strings written with the currency's@@ -3114,46 +450,3 @@ export type EmailTemplateLanguageParams = {/** A language code, or `any` (the default) for the version every language uses. */language?: string}--export type EmailTemplateVersionParams = EmailTemplateLanguageParams & {- /** The draft's `lock_version` as last seen. A draft saved since is refused with 409. */- lock_version?: number-}--export interface EmailTemplateDraftParams extends EmailTemplateLanguageParams {- subject?: string | null- body?: string- /**- * The `lock_version` the draft was loaded with, or `null` when there was no- * draft; a save from an older copy is refused with 409. Omit it to save- * without checking.- */- lock_version?: number | null- /** Marks the draft as based on Spree's current default, after reviewing what changed in it. */- rebase?: boolean-}--export interface EmailTemplatePreviewParams extends EmailTemplateLanguageParams {- /** An unsaved subject, in place of the current one. */- subject?: string | null- /** An unsaved body, in place of the current one. */- body?: string- /** The record to build sample data from; the store's latest matching record otherwise. */- record_id?: string- /** For the layout or a partial, the email to show it in. */- email_key?: string- /** Unsaved colors and font to preview, named like the store's `email_*` settings. */- branding?: {- accent_color?: string | null- background_color?: string | null- card_color?: string | null- text_color?: string | null- heading_color?: string | null- font?: string | null- }-}--export interface EmailTemplateRestoreParams extends EmailTemplateLanguageParams {- /** The open draft's `lock_version`, or `null` when there is none; checked as when saving. */- lock_version?: number | null-}diff --git a/packages/admin-sdk/src/types/generated/Media.ts b/packages/admin-sdk/src/types/generated/Media.tsindex edc489b401..ca7467d1c3 100644--- a/packages/admin-sdk/src/types/generated/Media.ts+++ b/packages/admin-sdk/src/types/generated/Media.ts@@ -1,4 +1,4 @@-// Typelizer digest adcd1c0740ae13b2942aa78daf1eb56d+// Typelizer digest f44abcf127cfb2adc2d34feffe5748cb//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -9,9 +9,9 @@ interface Media {position: number;alt: string | null;media_type: 'image' | 'video' | 'external_video';+ external_video_url: string | null;focal_point_x: number | null;focal_point_y: number | null;- external_video_url: string | null;video_provider: string | null;video_embed_url: string | null;video_url: string | null;diff --git a/packages/admin-sdk/src/types/generated/Order.ts b/packages/admin-sdk/src/types/generated/Order.tsindex 48710a7d7c..cd565f2d56 100644--- a/packages/admin-sdk/src/types/generated/Order.ts+++ b/packages/admin-sdk/src/types/generated/Order.ts@@ -1,4 +1,4 @@-// Typelizer digest de9cc84b17060d325d0e4173a3f28fc8+// Typelizer digest 839c6ea3758a8da6f47a867daae55b52//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {FreightSummary, LineItem, Fulfillment, Payment, Address, GiftCard, Market, Seller, Actor, AppliedPromotion, PaymentSplit, Cart, Channel, StockLocation, PaymentMethod, Customer, OrderCancellationReason, Return, Exchange, Claim, ActorKind} from '@/types'@@ -50,7 +50,7 @@ interface Order {last_ip_address: string | null;considered_risky: boolean;confirmation_delivered: boolean;- store_owner_notification_delivered: boolean;+ store_owner_notification_delivered: boolean | null;metadata: Record<string, unknown>;cancel_note: string | null;canceled_at: string | null;diff --git a/packages/admin-sdk/src/types/generated/Store.ts b/packages/admin-sdk/src/types/generated/Store.tsindex d92b9497ca..28fed2a189 100644--- a/packages/admin-sdk/src/types/generated/Store.ts+++ b/packages/admin-sdk/src/types/generated/Store.ts@@ -1,4 +1,4 @@-// Typelizer digest 3a555a09b00095bd8b2223e026a5b1ac+// Typelizer digest a759a5bc2842ad75a22725199d78443d//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {SetupTask} from '@/types'@@ -24,7 +24,7 @@ interface Store {timezone: string;storefront_url: string | null;weight_unit: 'g' | 'kg' | 'lb' | 'oz';- unit_system: string;+ unit_system: 'metric' | 'imperial';storefront_access: 'public' | 'prices_hidden' | 'login_required';guest_checkout: boolean;always_include_confirm_step: boolean;diff --git a/packages/admin-sdk/src/types/params/AddressInputParams.ts b/packages/admin-sdk/src/types/params/AddressInputParams.tsnew file mode 100644index 0000000000..2511025c69--- /dev/null+++ b/packages/admin-sdk/src/types/params/AddressInputParams.ts@@ -0,0 +1,24 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AddressInputParams = {+ first_name?: string+ last_name?: string+ /** Legacy spelling of `first_name` / `last_name`; send only one of the two. */+ firstname?: string+ /** Legacy spelling of `first_name` / `last_name`; send only one of the two. */+ lastname?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ /** Legacy spelling of `postal_code`; send only one of the two. */+ zipcode?: string+ country_code?: string+ state_code?: string+ /** For countries without states in the database. */+ state_name?: string+ phone?: string+ alternative_phone?: string+ company?: string+ label?: string+}diff --git a/packages/admin-sdk/src/types/params/AdminUserUpdateParams.ts b/packages/admin-sdk/src/types/params/AdminUserUpdateParams.tsnew file mode 100644index 0000000000..ed51024872--- /dev/null+++ b/packages/admin-sdk/src/types/params/AdminUserUpdateParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AdminUserUpdateParams = {+ first_name?: string+ last_name?: string+ /**+ * Role IDs of the current store the user should hold. Replaces the user's roles on this store; an+ * empty list removes them all.+ */+ role_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/AllowedOriginCreateParams.ts b/packages/admin-sdk/src/types/params/AllowedOriginCreateParams.tsnew file mode 100644index 0000000000..a125309408--- /dev/null+++ b/packages/admin-sdk/src/types/params/AllowedOriginCreateParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AllowedOriginCreateParams = {+ /**+ * Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]` (no path, query+ * or fragment) using `http` or `https`.+ */+ origin: string+}diff --git a/packages/admin-sdk/src/types/params/AllowedOriginUpdateParams.ts b/packages/admin-sdk/src/types/params/AllowedOriginUpdateParams.tsnew file mode 100644index 0000000000..600f35d0e9--- /dev/null+++ b/packages/admin-sdk/src/types/params/AllowedOriginUpdateParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AllowedOriginUpdateParams = {+ /**+ * Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]` (no path, query+ * or fragment) using `http` or `https`.+ */+ origin?: string+}diff --git a/packages/admin-sdk/src/types/params/ApiKeyCreateParams.ts b/packages/admin-sdk/src/types/params/ApiKeyCreateParams.tsnew file mode 100644index 0000000000..eb88c71474--- /dev/null+++ b/packages/admin-sdk/src/types/params/ApiKeyCreateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ApiKeyCreateParams = {+ name: string+ key_type: 'publishable' | 'secret'+ /**+ * Required for secret keys. You can only grant scopes you hold yourself. Fixed once created: to+ * change them, create a new key and revoke the old one.+ */+ scopes?: string[]+ /**+ * Binds a publishable key to one channel of the store (`ch_...`), so it rejects requests for+ * other channels. Fixed once created; omit it for a store-wide key.+ */+ channel_id?: string+}diff --git a/packages/admin-sdk/src/types/params/ApiKeyUpdateParams.ts b/packages/admin-sdk/src/types/params/ApiKeyUpdateParams.tsnew file mode 100644index 0000000000..dd9057dd7b--- /dev/null+++ b/packages/admin-sdk/src/types/params/ApiKeyUpdateParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ApiKeyUpdateParams = {+ name: string+}diff --git a/packages/admin-sdk/src/types/params/BulkTagsParams.ts b/packages/admin-sdk/src/types/params/BulkTagsParams.tsnew file mode 100644index 0000000000..5d0257a495--- /dev/null+++ b/packages/admin-sdk/src/types/params/BulkTagsParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type BulkTagsParams = {+ /**+ * The records to change. Records the caller cannot update are skipped; an empty list changes+ * nothing.+ */+ ids: string[]+ tags: string[]+}diff --git a/packages/admin-sdk/src/types/params/CatalogAssignParams.ts b/packages/admin-sdk/src/types/params/CatalogAssignParams.tsnew file mode 100644index 0000000000..0c2337a872--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogAssignParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CatalogAssignParams = {+ /** Buyer audiences only. A company assignment covers its subtree. */+ assignable_type: 'customer_group' | 'company'+ assignable_id: string+}diff --git a/packages/admin-sdk/src/types/params/CatalogAssignmentParams.ts b/packages/admin-sdk/src/types/params/CatalogAssignmentParams.tsnew file mode 100644index 0000000000..b88eee87c7--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogAssignmentParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CatalogAssignmentParams = {+ /** Buyer audiences only. A company assignment covers its subtree. */+ assignable_type: 'customer_group' | 'company'+ assignable_id: string+}diff --git a/packages/admin-sdk/src/types/params/CatalogOrderMinimumParams.ts b/packages/admin-sdk/src/types/params/CatalogOrderMinimumParams.tsnew file mode 100644index 0000000000..54a0327f60--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogOrderMinimumParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CatalogOrderMinimumParams = {+ /** ISO 4217 code. Required on create; one minimum per currency. */+ currency?: string+ amount?: string+}diff --git a/packages/admin-sdk/src/types/params/CatalogParams.ts b/packages/admin-sdk/src/types/params/CatalogParams.tsnew file mode 100644index 0000000000..adafd248b9--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogParams.ts@@ -0,0 +1,40 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CatalogAssignmentParams } from './CatalogAssignmentParams'+import type { CatalogOrderMinimumParams } from './CatalogOrderMinimumParams'+import type { CatalogPriceListParams } from './CatalogPriceListParams'++export type CatalogParams = {+ name?: string+ /** Internal note on what the agreement is, never shown to shoppers. */+ description?: string | null+ active?: boolean+ position?: number+ /**+ * The catalog-wide quantity terms, between a variant's own rule and a per-variant override. Null+ * leaves the field to the variant's own rule.+ */+ minimum_order_quantity?: number | null+ /**+ * The catalog-wide quantity terms, between a variant's own rule and a per-variant override. Null+ * leaves the field to the variant's own rule.+ */+ order_multiple?: number | null+ metadata?: Record<string, unknown>+ /**+ * The whole audience. An entry left out is withdrawn; omitting the key leaves the audience alone.+ */+ assignments?: CatalogAssignmentParams[]+ /**+ * The whole order-minimum set. A currency left out has its minimum lifted; omitting the key+ * leaves them alone.+ */+ order_minimums?: CatalogOrderMinimumParams[]+ /**+ * The price list this catalog prices through, written inline: an object creates the owned list or+ * updates it. Null deletes the list (a soft delete). Omit the key, or send `{}`, to leave the+ * pricing alone. A catalog with an empty assortment prices without hiding anything; curate or+ * import products to make it restrictive.+ */+ price_list?: CatalogPriceListParams | null+}diff --git a/packages/admin-sdk/src/types/params/CatalogPriceListParams.ts b/packages/admin-sdk/src/types/params/CatalogPriceListParams.tsnew file mode 100644index 0000000000..6d512dd8bb--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogPriceListParams.ts@@ -0,0 +1,31 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceAdjustmentTierParams } from './PriceAdjustmentTierParams'+import type { PriceListPriceOverrideParams } from './PriceListPriceOverrideParams'+import type { PriceListRuleParams } from './PriceListRuleParams'++export type CatalogPriceListParams = {+ name?: string+ description?: string | null+ status?: string+ match_policy?: string+ starts_at?: string | null+ ends_at?: string | null+ /** Signed: negative discounts off base prices, positive marks up. */+ price_adjustment_percentage?: string | null+ adjust_compare_at?: boolean+ /**+ * Contextual rules, in practice a `volume_rule`. Audience rules are left as they are, and an+ * empty list clears the contextual rules.+ */+ rules?: PriceListRuleParams[]+ /**+ * Explicit per-variant amounts. An empty list clears them, which is what switching to a+ * percentage sends.+ */+ prices?: PriceListPriceOverrideParams[]+ /**+ * Quantity bands on the percentage. The payload is the whole ladder, so an empty list clears it.+ */+ price_adjustment_tiers?: PriceAdjustmentTierParams[]+}diff --git a/packages/admin-sdk/src/types/params/CatalogProductTermsParams.ts b/packages/admin-sdk/src/types/params/CatalogProductTermsParams.tsnew file mode 100644index 0000000000..cedadf317e--- /dev/null+++ b/packages/admin-sdk/src/types/params/CatalogProductTermsParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CatalogProductTermsParams = {+ /**+ * Quantity terms keyed by product: `{ minimum_order_quantity, order_multiple }`, each a whole+ * number or null. A product whose pair is both null has its terms cleared; a product not yet in+ * the assortment is added.+ */+ terms: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/CategoryCreateParams.ts b/packages/admin-sdk/src/types/params/CategoryCreateParams.tsnew file mode 100644index 0000000000..d6a0f1a8d4--- /dev/null+++ b/packages/admin-sdk/src/types/params/CategoryCreateParams.ts@@ -0,0 +1,31 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'++export type CategoryCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name: string+ /**+ * The parent category. Omitted or null, a new category goes to the top level and an existing one+ * keeps its parent: moving one to the top level is the reposition endpoint.+ */+ parent_id?: string | null+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ permalink?: string+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */+ image_signed_id?: string | null+ /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */+ square_image_signed_id?: string | null+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/CategoryRepositionParams.ts b/packages/admin-sdk/src/types/params/CategoryRepositionParams.tsnew file mode 100644index 0000000000..7f8a555d43--- /dev/null+++ b/packages/admin-sdk/src/types/params/CategoryRepositionParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CategoryRepositionParams = {+ /** The new parent. Omit or null to move the category to the top level. */+ new_parent_id?: string | null+ /** 0-based index among the new parent's children. */+ new_position: number+}diff --git a/packages/admin-sdk/src/types/params/CategoryUpdateParams.ts b/packages/admin-sdk/src/types/params/CategoryUpdateParams.tsnew file mode 100644index 0000000000..7f57ecb3b5--- /dev/null+++ b/packages/admin-sdk/src/types/params/CategoryUpdateParams.ts@@ -0,0 +1,31 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'++export type CategoryUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name?: string+ /**+ * The parent category. Omitted or null, a new category goes to the top level and an existing one+ * keeps its parent: moving one to the top level is the reposition endpoint.+ */+ parent_id?: string | null+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ permalink?: string+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */+ image_signed_id?: string | null+ /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */+ square_image_signed_id?: string | null+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/ChannelAddProductsParams.ts b/packages/admin-sdk/src/types/params/ChannelAddProductsParams.tsnew file mode 100644index 0000000000..5bfd1b16c2--- /dev/null+++ b/packages/admin-sdk/src/types/params/ChannelAddProductsParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ChannelAddProductsParams = {+ product_ids: string[]+ /** When the publications go live. Null means immediately. */+ published_at?: string | null+ /** When the publications come down. Null means never. */+ unpublished_at?: string | null+}diff --git a/packages/admin-sdk/src/types/params/ChannelCreateParams.ts b/packages/admin-sdk/src/types/params/ChannelCreateParams.tsnew file mode 100644index 0000000000..558c89e393--- /dev/null+++ b/packages/admin-sdk/src/types/params/ChannelCreateParams.ts@@ -0,0 +1,25 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ChannelCreateParams = {+ name: string+ /** URL-safe slug, derived from `name` when blank (`Point of Sale` becomes `point-of-sale`). */+ code?: string+ active?: boolean+ default?: boolean+ /** Order routing strategy shorthand (built-in: `rules`). Null inherits the store setting. */+ order_routing_strategy?: string | null+ /** What anonymous visitors can see. Null inherits the store setting. */+ storefront_access?: 'public' | 'prices_hidden' | 'login_required' | null+ /** Whether guests can check out without an account. Null inherits the store setting. */+ guest_checkout?: boolean | null+ /**+ * Catalog (`cat_...`) shown to shoppers no company or customer group catalog covers. Null means+ * every product published on the channel.+ */+ default_catalog_id?: string | null+ /**+ * Stock locations (`sloc_...`) that fulfill this channel. Replaces the whole set; an empty list+ * means every location of the store.+ */+ stock_location_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/ChannelRemoveProductsParams.ts b/packages/admin-sdk/src/types/params/ChannelRemoveProductsParams.tsnew file mode 100644index 0000000000..55aa1c94ab--- /dev/null+++ b/packages/admin-sdk/src/types/params/ChannelRemoveProductsParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ChannelRemoveProductsParams = {+ product_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ChannelUpdateParams.ts b/packages/admin-sdk/src/types/params/ChannelUpdateParams.tsnew file mode 100644index 0000000000..b1f1e9ebdd--- /dev/null+++ b/packages/admin-sdk/src/types/params/ChannelUpdateParams.ts@@ -0,0 +1,25 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ChannelUpdateParams = {+ name?: string+ /** URL-safe slug, derived from `name` when blank (`Point of Sale` becomes `point-of-sale`). */+ code?: string+ active?: boolean+ default?: boolean+ /** Order routing strategy shorthand (built-in: `rules`). Null inherits the store setting. */+ order_routing_strategy?: string | null+ /** What anonymous visitors can see. Null inherits the store setting. */+ storefront_access?: 'public' | 'prices_hidden' | 'login_required' | null+ /** Whether guests can check out without an account. Null inherits the store setting. */+ guest_checkout?: boolean | null+ /**+ * Catalog (`cat_...`) shown to shoppers no company or customer group catalog covers. Null means+ * every product published on the channel.+ */+ default_catalog_id?: string | null+ /**+ * Stock locations (`sloc_...`) that fulfill this channel. Replaces the whole set; an empty list+ * means every location of the store.+ */+ stock_location_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/ClaimCancelParams.ts b/packages/admin-sdk/src/types/params/ClaimCancelParams.tsnew file mode 100644index 0000000000..abf118988b--- /dev/null+++ b/packages/admin-sdk/src/types/params/ClaimCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimCancelParams = {+ /** A note on why the claim was canceled. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/ClaimCreateParams.ts b/packages/admin-sdk/src/types/params/ClaimCreateParams.tsnew file mode 100644index 0000000000..b7b6b2c194--- /dev/null+++ b/packages/admin-sdk/src/types/params/ClaimCreateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimCreateParams = {+ /** Affected items, and how each should be made right. */+ items: {+ line_item_id: string+ quantity: number+ description?: string+ send_replacement?: boolean+ /** Defaults to the variant that was bought. */+ replacement_variant_id?: string+ refund_amount?: string+ }[]+ /** One of the store's claim reasons. */+ reason_id?: string+ memo?: string+}diff --git a/packages/admin-sdk/src/types/params/ClaimDenyParams.ts b/packages/admin-sdk/src/types/params/ClaimDenyParams.tsnew file mode 100644index 0000000000..45cb4e1e8f--- /dev/null+++ b/packages/admin-sdk/src/types/params/ClaimDenyParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimDenyParams = {+ /** Recorded on the claim for the customer. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/ClaimResolveParams.ts b/packages/admin-sdk/src/types/params/ClaimResolveParams.tsnew file mode 100644index 0000000000..cd918880c8--- /dev/null+++ b/packages/admin-sdk/src/types/params/ClaimResolveParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimResolveParams = {+ /** Money back, a replacement shipment, or both. */+ resolution: 'refund' | 'replacement' | 'refund_and_replacement'+ /** Defaults to `store_credit`. */+ refund_method?: 'original_payment' | 'store_credit'+ /** Defaults to the claim total. */+ amount?: string+ /** Which claim lines to send a replacement for. Omit to keep what the claim was opened with. */+ replacement_line_item_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/ClaimUpdateParams.ts b/packages/admin-sdk/src/types/params/ClaimUpdateParams.tsnew file mode 100644index 0000000000..4a7f1a8b31--- /dev/null+++ b/packages/admin-sdk/src/types/params/ClaimUpdateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimUpdateParams = {+ /** One of the store's claim reasons. */+ reason_id?: string+ memo?: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/CollectionCreateParams.ts b/packages/admin-sdk/src/types/params/CollectionCreateParams.tsnew file mode 100644index 0000000000..0a840791c3--- /dev/null+++ b/packages/admin-sdk/src/types/params/CollectionCreateParams.ts@@ -0,0 +1,39 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CollectionRuleParams } from './CollectionRuleParams'+import type { CustomFieldValueParams } from './CustomFieldValueParams'++export type CollectionCreateParams = {+ name: string+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ permalink?: string+ /**+ * 1-based position among the store's collections; the server shifts its siblings. The nested+ * products reposition endpoints, unlike this, take 0-based indexes.+ */+ position?: number+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */+ image_signed_id?: string | null+ /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */+ square_image_signed_id?: string | null+ /** When true, membership is materialized from `rules` instead of curated by hand. */+ automatic?: boolean+ /** Whether a product must match all rules or any of them. Defaults to `all`. */+ rules_match_policy?: 'all' | 'any'+ /**+ * Default product sort for the storefront listing; a shopper's own sort wins. Defaults to+ * `manual`.+ */+ sort_order?: 'manual' | 'best_selling' | 'price asc' | 'price desc' | 'available_on desc' | 'available_on asc' | 'name asc' | 'name desc'+ /**+ * The complete desired rule set. Entries with an `id` update, entries without one are created,+ * and existing rules left out are removed.+ */+ rules?: CollectionRuleParams[]+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/CollectionRuleParams.ts b/packages/admin-sdk/src/types/params/CollectionRuleParams.tsnew file mode 100644index 0000000000..0b23e4a09d--- /dev/null+++ b/packages/admin-sdk/src/types/params/CollectionRuleParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CollectionRuleParams = {+ /** Omit to create a new rule. */+ id?: string+ /** Wire shorthand for the rule kind, from the collection rule types endpoint. */+ type?: string+ value?: string+ match_policy?: 'is_equal_to' | 'is_not_equal_to' | 'contains' | 'does_not_contain'+}diff --git a/packages/admin-sdk/src/types/params/CollectionUpdateParams.ts b/packages/admin-sdk/src/types/params/CollectionUpdateParams.tsnew file mode 100644index 0000000000..5a520114df--- /dev/null+++ b/packages/admin-sdk/src/types/params/CollectionUpdateParams.ts@@ -0,0 +1,39 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CollectionRuleParams } from './CollectionRuleParams'+import type { CustomFieldValueParams } from './CustomFieldValueParams'++export type CollectionUpdateParams = {+ name?: string+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ permalink?: string+ /**+ * 1-based position among the store's collections; the server shifts its siblings. The nested+ * products reposition endpoints, unlike this, take 0-based indexes.+ */+ position?: number+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ /** A `signed_id` from `files.upload()` for the landscape image, or null to remove it. */+ image_signed_id?: string | null+ /** A `signed_id` from `files.upload()` for the square image, or null to remove it. */+ square_image_signed_id?: string | null+ /** When true, membership is materialized from `rules` instead of curated by hand. */+ automatic?: boolean+ /** Whether a product must match all rules or any of them. Defaults to `all`. */+ rules_match_policy?: 'all' | 'any'+ /**+ * Default product sort for the storefront listing; a shopper's own sort wins. Defaults to+ * `manual`.+ */+ sort_order?: 'manual' | 'best_selling' | 'price asc' | 'price desc' | 'available_on desc' | 'available_on asc' | 'name asc' | 'name desc'+ /**+ * The complete desired rule set. Entries with an `id` update, entries without one are created,+ * and existing rules left out are removed.+ */+ rules?: CollectionRuleParams[]+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/CommissionRateCreateParams.ts b/packages/admin-sdk/src/types/params/CommissionRateCreateParams.tsnew file mode 100644index 0000000000..d904b0f29b--- /dev/null+++ b/packages/admin-sdk/src/types/params/CommissionRateCreateParams.ts@@ -0,0 +1,46 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CommissionRuleDraftParams } from './CommissionRuleDraftParams'++export type CommissionRateCreateParams = {+ name: string+ /** Your own identifier for this rate; unique per store. */+ code?: string | null+ enabled?: boolean+ /**+ * Place in the list. Rates resolve top-down and the first whose rules match wins, so 1 is tried+ * first. New rates are created at the top; send this to move one. A rate with no rules matches+ * every sale, so the marketplace default belongs at the bottom.+ */+ position?: number+ /** `percentage` charges a share of the sale; `fixed` charges a flat fee. */+ kind: 'percentage' | 'fixed'+ /** A percentage (10 = 10%) or a flat amount, per `kind`. */+ value: string+ /**+ * 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.+ */+ tax_inclusive?: boolean+ /** Also charge commission on the seller's delivery revenue. Percentage rates only. */+ include_shipping?: boolean+ /**+ * VAT on the commission itself, as a fraction rather than a percentage. Null lets the store's tax+ * engine answer for the seller's jurisdiction.+ */+ commission_tax_rate?: string | null+ metadata?: Record<string, unknown>+ /**+ * What a flat fee charges, keyed by currency, as decimal strings. A sale in a currency with no+ * amount falls to the next matching rate. Replaces the whole set.+ */+ amounts?: Record<string, unknown>+ /**+ * The floor and cap a percentage charges within, keyed by currency: `{ min_amount, max_amount }`+ * decimal strings. A sale in a currency with no bounds is charged unbounded. Replaces the whole+ * set.+ */+ bounds?: Record<string, unknown>+ /** The full targeting; what you send replaces what the rate holds. */+ rules?: CommissionRuleDraftParams[]+}diff --git a/packages/admin-sdk/src/types/params/CommissionRateUpdateParams.ts b/packages/admin-sdk/src/types/params/CommissionRateUpdateParams.tsnew file mode 100644index 0000000000..c7d47816e0--- /dev/null+++ b/packages/admin-sdk/src/types/params/CommissionRateUpdateParams.ts@@ -0,0 +1,46 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CommissionRuleDraftParams } from './CommissionRuleDraftParams'++export type CommissionRateUpdateParams = {+ name?: string+ /** Your own identifier for this rate; unique per store. */+ code?: string | null+ enabled?: boolean+ /**+ * Place in the list. Rates resolve top-down and the first whose rules match wins, so 1 is tried+ * first. New rates are created at the top; send this to move one. A rate with no rules matches+ * every sale, so the marketplace default belongs at the bottom.+ */+ position?: number+ /** `percentage` charges a share of the sale; `fixed` charges a flat fee. */+ kind?: 'percentage' | 'fixed'+ /** A percentage (10 = 10%) or a flat amount, per `kind`. */+ value?: string+ /**+ * 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.+ */+ tax_inclusive?: boolean+ /** Also charge commission on the seller's delivery revenue. Percentage rates only. */+ include_shipping?: boolean+ /**+ * VAT on the commission itself, as a fraction rather than a percentage. Null lets the store's tax+ * engine answer for the seller's jurisdiction.+ */+ commission_tax_rate?: string | null+ metadata?: Record<string, unknown>+ /**+ * What a flat fee charges, keyed by currency, as decimal strings. A sale in a currency with no+ * amount falls to the next matching rate. Replaces the whole set.+ */+ amounts?: Record<string, unknown>+ /**+ * The floor and cap a percentage charges within, keyed by currency: `{ min_amount, max_amount }`+ * decimal strings. A sale in a currency with no bounds is charged unbounded. Replaces the whole+ * set.+ */+ bounds?: Record<string, unknown>+ /** The full targeting; what you send replaces what the rate holds. */+ rules?: CommissionRuleDraftParams[]+}diff --git a/packages/admin-sdk/src/types/params/CommissionRuleDraftParams.ts b/packages/admin-sdk/src/types/params/CommissionRuleDraftParams.tsnew file mode 100644index 0000000000..23f05987cb--- /dev/null+++ b/packages/admin-sdk/src/types/params/CommissionRuleDraftParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CommissionRuleDraftParams = {+ /** Present for an existing rule; omit to create one. */+ id?: string | null+ /** A kind from `GET /commission_rates/rule_types`. */+ type: string+ /** Configuration for the kind, per its type's `schema`. */+ preferences?: Record<string, unknown>+ /** For kinds that name products, which are kept outside preferences. */+ product_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/CompanyAddressParams.ts b/packages/admin-sdk/src/types/params/CompanyAddressParams.tsnew file mode 100644index 0000000000..861dcaa9b2--- /dev/null+++ b/packages/admin-sdk/src/types/params/CompanyAddressParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompanyAddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ state_name?: string+ label?: string+ /** ISO 3166-1 alpha-2 code, such as `US`. */+ country_code?: string+ /** The state or province abbreviation, such as `NY`. */+ state_code?: string+ /**+ * True makes this the default address of that kind, false gives the slot up, and leaving it out+ * keeps the current default.+ */+ default_billing?: boolean+ /**+ * True makes this the default address of that kind, false gives the slot up, and leaving it out+ * keeps the current default.+ */+ default_shipping?: boolean+}diff --git a/packages/admin-sdk/src/types/params/CompanyMembershipCreateParams.ts b/packages/admin-sdk/src/types/params/CompanyMembershipCreateParams.tsnew file mode 100644index 0000000000..197d2177be--- /dev/null+++ b/packages/admin-sdk/src/types/params/CompanyMembershipCreateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompanyMembershipCreateParams = {+ /**+ * An existing customer becomes a member immediately; an unknown email becomes an invitation, and+ * the response is an invitation instead of a membership.+ */+ customer_email: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/CompanyParams.ts b/packages/admin-sdk/src/types/params/CompanyParams.tsnew file mode 100644index 0000000000..42853201af--- /dev/null+++ b/packages/admin-sdk/src/types/params/CompanyParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompanyParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ /** Required when creating. */+ name?: string+ /**+ * `company` is a legal entity (may hold tax registrations), `division` an organizational unit.+ * Roots must be `company`.+ */+ kind?: 'company' | 'division'+ /** The parent node. Omit or null for a root. */+ parent_id?: string | null+ /**+ * Whether this buyer's own procurement process demands a PO reference on every order: checkout+ * asks for one and refuses to complete without it.+ */+ po_number_required?: boolean+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/CustomFieldCreateParams.ts b/packages/admin-sdk/src/types/params/CustomFieldCreateParams.tsnew file mode 100644index 0000000000..6fe6e3ebe8--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomFieldCreateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldCreateParams = {+ custom_field_definition_id: string+ /**+ * A value matching the definition's `field_type`: a scalar for text, number and boolean fields; a+ * list or a hash for JSON fields.+ */+ value: unknown+}diff --git a/packages/admin-sdk/src/types/params/CustomFieldDefinitionCreateParams.ts b/packages/admin-sdk/src/types/params/CustomFieldDefinitionCreateParams.tsnew file mode 100644index 0000000000..a465ec67eb--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomFieldDefinitionCreateParams.ts@@ -0,0 +1,28 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldDefinitionCreateParams = {+ /** Defaults to `custom`. */+ namespace?: string+ key: string+ /** Human-readable name; defaults to the titleized `key`. */+ label?: string+ /**+ * Custom field type token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension+ * type that has no token is named by its registered class instead.+ */+ field_type: string+ /** Shorthand of the resource the field attaches to, from the resource types endpoint. */+ resource_type: string+ /** When false, the definition is admin-only and never exposed in the Store API. */+ storefront_visible?: boolean+ /**+ * Include values in storefront product text search. Supported for `short_text`, `long_text` and+ * `number` fields; other types are refused.+ */+ searchable?: boolean+ /**+ * Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`).+ * Supported for `short_text` and `number` fields; other types are refused.+ */+ sortable?: boolean+}diff --git a/packages/admin-sdk/src/types/params/CustomFieldDefinitionUpdateParams.ts b/packages/admin-sdk/src/types/params/CustomFieldDefinitionUpdateParams.tsnew file mode 100644index 0000000000..f200b8ff0b--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomFieldDefinitionUpdateParams.ts@@ -0,0 +1,28 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldDefinitionUpdateParams = {+ /** Defaults to `custom`. */+ namespace?: string+ key?: string+ /** Human-readable name; defaults to the titleized `key`. */+ label?: string+ /**+ * Custom field type token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension+ * type that has no token is named by its registered class instead.+ */+ field_type?: string+ /** Shorthand of the resource the field attaches to, from the resource types endpoint. */+ resource_type?: string+ /** When false, the definition is admin-only and never exposed in the Store API. */+ storefront_visible?: boolean+ /**+ * Include values in storefront product text search. Supported for `short_text`, `long_text` and+ * `number` fields; other types are refused.+ */+ searchable?: boolean+ /**+ * Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`).+ * Supported for `short_text` and `number` fields; other types are refused.+ */+ sortable?: boolean+}diff --git a/packages/admin-sdk/src/types/params/CustomFieldUpdateParams.ts b/packages/admin-sdk/src/types/params/CustomFieldUpdateParams.tsnew file mode 100644index 0000000000..60d8df632e--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomFieldUpdateParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldUpdateParams = {+ /**+ * A value matching the definition's `field_type`: a scalar for text, number and boolean fields; a+ * list or a hash for JSON fields.+ */+ value: unknown+}diff --git a/packages/admin-sdk/src/types/params/CustomFieldValueParams.ts b/packages/admin-sdk/src/types/params/CustomFieldValueParams.tsnew file mode 100644index 0000000000..47417a8abc--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomFieldValueParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldValueParams = {+ id?: string+ custom_field_definition_id?: string+ /** A scalar for text, number and boolean fields; a list or a hash for JSON fields. */+ value?: unknown+}diff --git a/packages/admin-sdk/src/types/params/CustomerAddressParams.ts b/packages/admin-sdk/src/types/params/CustomerAddressParams.tsnew file mode 100644index 0000000000..8cd7ebe75d--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerAddressParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerAddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ state_name?: string+ label?: string+ /** ISO 3166-1 alpha-2 code, such as `US`. */+ country_code?: string+ /** The state or province abbreviation, such as `NY`. */+ state_code?: string+ /** Older spellings of `first_name` and `last_name`. */+ firstname?: string+ /** Older spellings of `first_name` and `last_name`. */+ lastname?: string+ alternative_phone?: string+ quick_checkout?: boolean+ /** Makes this the customer's default address of that kind. */+ is_default_billing?: boolean+ /** Makes this the customer's default address of that kind. */+ is_default_shipping?: boolean+}diff --git a/packages/admin-sdk/src/types/params/CustomerBulkGroupsParams.ts b/packages/admin-sdk/src/types/params/CustomerBulkGroupsParams.tsnew file mode 100644index 0000000000..4714e5298c--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerBulkGroupsParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerBulkGroupsParams = {+ ids: string[]+ /** Groups from other stores are ignored. */+ customer_group_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/CustomerCreateParams.ts b/packages/admin-sdk/src/types/params/CustomerCreateParams.tsnew file mode 100644index 0000000000..0b42095ec2--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerCreateParams.ts@@ -0,0 +1,22 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerCreateParams = {+ email: string+ first_name?: string+ last_name?: string+ phone?: string+ /** Optional: a customer created without one claims the account through a password reset. */+ password?: string+ /** Optional: a customer created without one claims the account through a password reset. */+ password_confirmation?: string+ selected_locale?: string+ /** A `signed_id` from `files.upload()`. */+ avatar_signed_id?: string+ accepts_email_marketing?: boolean+ /** Rich text HTML. Reads come back as this plus `internal_note_html`. */+ internal_note?: string+ metadata?: Record<string, unknown>+ tags?: string[]+ /** Replaces the customer's group membership. */+ customer_group_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/CustomerGroupCreateParams.ts b/packages/admin-sdk/src/types/params/CustomerGroupCreateParams.tsnew file mode 100644index 0000000000..456ad20d28--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerGroupCreateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerGroupCreateParams = {+ name: string+ description?: string | null+ /** Replaces the group's members. */+ customer_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/CustomerGroupUpdateParams.ts b/packages/admin-sdk/src/types/params/CustomerGroupUpdateParams.tsnew file mode 100644index 0000000000..24d887d42d--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerGroupUpdateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerGroupUpdateParams = {+ name?: string+ description?: string | null+ /** Replaces the group's members. */+ customer_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/CustomerStoreCreditCreateParams.ts b/packages/admin-sdk/src/types/params/CustomerStoreCreditCreateParams.tsnew file mode 100644index 0000000000..aa34149889--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerStoreCreditCreateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerStoreCreditCreateParams = {+ amount: string+ currency: string+ memo?: string+}diff --git a/packages/admin-sdk/src/types/params/CustomerStoreCreditUpdateParams.ts b/packages/admin-sdk/src/types/params/CustomerStoreCreditUpdateParams.tsnew file mode 100644index 0000000000..c0418a3442--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerStoreCreditUpdateParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerStoreCreditUpdateParams = {+ amount?: string+ memo?: string+}diff --git a/packages/admin-sdk/src/types/params/CustomerUpdateParams.ts b/packages/admin-sdk/src/types/params/CustomerUpdateParams.tsnew file mode 100644index 0000000000..278177f36d--- /dev/null+++ b/packages/admin-sdk/src/types/params/CustomerUpdateParams.ts@@ -0,0 +1,22 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomerUpdateParams = {+ email?: string+ first_name?: string+ last_name?: string+ phone?: string+ /** Optional: a customer created without one claims the account through a password reset. */+ password?: string+ /** Optional: a customer created without one claims the account through a password reset. */+ password_confirmation?: string+ selected_locale?: string+ /** A `signed_id` from `files.upload()`. */+ avatar_signed_id?: string+ accepts_email_marketing?: boolean+ /** Rich text HTML. Reads come back as this plus `internal_note_html`. */+ internal_note?: string+ metadata?: Record<string, unknown>+ tags?: string[]+ /** Replaces the customer's group membership. */+ customer_group_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/DataRequestCreateParams.ts b/packages/admin-sdk/src/types/params/DataRequestCreateParams.tsnew file mode 100644index 0000000000..ebf5813b20--- /dev/null+++ b/packages/admin-sdk/src/types/params/DataRequestCreateParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DataRequestCreateParams = {+ customer_id: string+ /**+ * `access` asks for a copy of the customer's personal data; `erasure` asks for it to be erased.+ */+ kind: 'access' | 'erasure'+}diff --git a/packages/admin-sdk/src/types/params/DeliveryCreateParams.ts b/packages/admin-sdk/src/types/params/DeliveryCreateParams.tsnew file mode 100644index 0000000000..057a9e0b0f--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryCreateParams = {+ /**+ * A carrier tracking number, a freight PRO or container number, or a full tracking link. A+ * corrected number resets the carrier status to `pending`.+ */+ tracking_number: string+ /** Free text; detected from the number's format when omitted. */+ carrier?: string+ service?: string+ tracking_url?: string+}diff --git a/packages/admin-sdk/src/types/params/DeliveryMarkDeliveredParams.ts b/packages/admin-sdk/src/types/params/DeliveryMarkDeliveredParams.tsnew file mode 100644index 0000000000..75cfd22039--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryMarkDeliveredParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryMarkDeliveredParams = {+ /** When it arrived. Defaults to now. */+ delivered_at?: string+ /**+ * Whether the customer gets a delivery notification once the parcel completes. Defaults to true.+ */+ notify_customer?: boolean+}diff --git a/packages/admin-sdk/src/types/params/DeliveryMethodParams.ts b/packages/admin-sdk/src/types/params/DeliveryMethodParams.tsnew file mode 100644index 0000000000..70c78d4233--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryMethodParams.ts@@ -0,0 +1,72 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { DeliveryMethodServiceParams } from './DeliveryMethodServiceParams'++export type DeliveryMethodParams = {+ name?: string+ admin_name?: string | null+ code?: string | null+ /** Fulfillment provider shorthand (see the fulfillment providers endpoint), e.g. `manual`. */+ fulfillment_provider?: string+ pickup_point_provider?: string | null+ /**+ * Rate provider shorthand (see the rate providers endpoint), e.g. `easy_post`. Omit or send null+ * for the built-in provider, which prices through the method's calculator.+ */+ rate_provider?: string | null+ storefront_visible?: boolean+ /**+ * Marketplace only: whether a seller's packages may be quoted by this method. Off by default, and+ * refused on a method that belongs to a seller.+ */+ available_to_sellers?: boolean+ tracking_url?: string | null+ estimated_transit_business_days_min?: number | null+ estimated_transit_business_days_max?: number | null+ /** Prefixed tax category ID (`taxcat_...`), or null to clear. */+ tax_category_id?: string | null+ /** Method-level flat handling fee added on top of provider-quoted rates. */+ markup_flat?: string | null+ /**+ * Method-level percentage handling fee added on top of provider-quoted rates. Ignored for+ * calculator-priced methods.+ */+ markup_percent?: string | null+ /** Delivery profile this method belongs to (`fp_...`); defaults to the store default profile. */+ delivery_profile_id?: string+ /**+ * Origin group offering this method (`og_...`); defaults to the zone's group, else the profile's+ * default group.+ */+ delivery_origin_group_id?: string+ /**+ * Delivery zone narrowing destinations (`dz_...`), or null for no restriction. Must belong to the+ * method's profile.+ */+ delivery_zone_id?: string | null+ /** Pickup locations (`sloc_...`); replaces the full set. */+ stock_location_ids?: string[]+ /**+ * How the method prices a shipment: a type from the calculators endpoint and its preferences,+ * matching that type's `schema`.+ */+ calculator?: {+ type?: string+ preferences?: Record<string, unknown>+ }+ /** Eligibility rules. Replaces the full set: omitted rules are removed. */+ rules?: {+ id?: string+ /** A rule kind from the delivery method rule types endpoint. */+ type?: string+ active?: boolean+ preferences?: Record<string, unknown>+ /** Products an association-backed rule (`excluded_products_rule`) applies to. */+ product_ids?: string[]+ }[]+ /**+ * Carrier service rows: which provider services this method offers. Replaces the full set:+ * omitted rows are removed; no rows means every service the provider returns is offered.+ */+ services?: DeliveryMethodServiceParams[]+}diff --git a/packages/admin-sdk/src/types/params/DeliveryMethodRuleCreateParams.ts b/packages/admin-sdk/src/types/params/DeliveryMethodRuleCreateParams.tsnew file mode 100644index 0000000000..09b12b4916--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryMethodRuleCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryMethodRuleCreateParams = {+ /** A rule kind from the delivery method rule types endpoint. */+ type: string+ /** Defaults to true on create. */+ active?: boolean+ /** Values for the rule kind's preference schema. */+ preferences?: Record<string, unknown>+ /**+ * Products an association-backed rule (`excluded_products_rule`) applies to. An empty list clears+ * them.+ */+ product_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/DeliveryMethodRuleUpdateParams.ts b/packages/admin-sdk/src/types/params/DeliveryMethodRuleUpdateParams.tsnew file mode 100644index 0000000000..8ef32e0f65--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryMethodRuleUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryMethodRuleUpdateParams = {+ /** Defaults to true on create. */+ active?: boolean+ /** Values for the rule kind's preference schema. */+ preferences?: Record<string, unknown>+ /**+ * Products an association-backed rule (`excluded_products_rule`) applies to. An empty list clears+ * them.+ */+ product_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/DeliveryMethodServiceParams.ts b/packages/admin-sdk/src/types/params/DeliveryMethodServiceParams.tsnew file mode 100644index 0000000000..72e3f2ec59--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryMethodServiceParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryMethodServiceParams = {+ /** Prefixed row ID (`dms_...`) when updating an existing row. */+ id?: string+ /** Carrier identifier as the provider's API knows it. */+ carrier: string+ /** Service identifier as the provider's API knows it. */+ service: string+ /** Display label shown to customers instead of the carrier-derived name. */+ label?: string | null+ /** Overrides the method-level flat markup for this service. */+ markup_flat?: string | null+ /** Overrides the method-level percentage markup for this service. */+ markup_percent?: string | null+ position?: number+}diff --git a/packages/admin-sdk/src/types/params/DeliveryOriginGroupParams.ts b/packages/admin-sdk/src/types/params/DeliveryOriginGroupParams.tsnew file mode 100644index 0000000000..957cdf0667--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryOriginGroupParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryOriginGroupParams = {+ name?: string | null+ position?: number+ /**+ * Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store+ * location.+ */+ stock_location_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/DeliveryProfileParams.ts b/packages/admin-sdk/src/types/params/DeliveryProfileParams.tsnew file mode 100644index 0000000000..506fc94c3f--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryProfileParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryProfileParams = {+ name?: string+ /**+ * Registered profile kind (`shipping`, `digital`, extension kinds) from the kinds endpoint. Read+ * on create only; defaults to shipping.+ */+ kind?: string+ /** Promotes this profile to the store default; the previous default is demoted. */+ default?: boolean+ position?: number+ /**+ * Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store+ * location.+ */+ stock_location_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/DeliveryUpdateParams.ts b/packages/admin-sdk/src/types/params/DeliveryUpdateParams.tsnew file mode 100644index 0000000000..fd7c1ab316--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryUpdateParams = {+ /**+ * A carrier tracking number, a freight PRO or container number, or a full tracking link. A+ * corrected number resets the carrier status to `pending`.+ */+ tracking_number?: string+ /** Free text; detected from the number's format when omitted. */+ carrier?: string+ service?: string+ tracking_url?: string+}diff --git a/packages/admin-sdk/src/types/params/DeliveryZoneMemberParams.ts b/packages/admin-sdk/src/types/params/DeliveryZoneMemberParams.tsnew file mode 100644index 0000000000..9a0cceb5fd--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryZoneMemberParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryZoneMemberParams = {+ member_type: 'country' | 'state' | 'postal_code'+ country_code?: string+ /**+ * A subdivision code or name. Without `country_code` the country is inferred when only one+ * country matches.+ */+ state_code?: string+ postal_code_prefix?: string+ postal_code_from?: string+ postal_code_to?: string+}diff --git a/packages/admin-sdk/src/types/params/DeliveryZoneParams.ts b/packages/admin-sdk/src/types/params/DeliveryZoneParams.tsnew file mode 100644index 0000000000..dba712b3d4--- /dev/null+++ b/packages/admin-sdk/src/types/params/DeliveryZoneParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { DeliveryZoneMemberParams } from './DeliveryZoneMemberParams'++export type DeliveryZoneParams = {+ name?: string+ description?: string | null+ /** Delivery profile this zone belongs to (`fp_...`); defaults to the store default profile. */+ delivery_profile_id?: string+ /** Origin group this zone belongs to (`og_...`). */+ delivery_origin_group_id?: string+ /** Replaces the zone's full member set atomically. */+ members?: DeliveryZoneMemberParams[]+}diff --git a/packages/admin-sdk/src/types/params/DigitalAssetCreateParams.ts b/packages/admin-sdk/src/types/params/DigitalAssetCreateParams.tsnew file mode 100644index 0000000000..c69cd92c28--- /dev/null+++ b/packages/admin-sdk/src/types/params/DigitalAssetCreateParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DigitalAssetCreateParams = {+ /**+ * A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for an uploaded+ * file, omitted for a provider-backed asset. On update it replaces the file for everyone who+ * already bought it.+ */+ signed_id?: string+ /** Defaults to the product's default variant when omitted. */+ variant_id?: string+ /** A provider shorthand from the providers endpoint. Omit for an uploaded file. */+ provider_type?: string+ /** Values for the provider's settings schema, keyed by field name. */+ provider_settings?: Record<string, unknown>+ /** Null means the store's download settings apply. */+ authorized_clicks?: number | null+ /** Null means the store's download settings apply. */+ authorized_days?: number | null+}diff --git a/packages/admin-sdk/src/types/params/DigitalAssetUpdateParams.ts b/packages/admin-sdk/src/types/params/DigitalAssetUpdateParams.tsnew file mode 100644index 0000000000..f14d1b0e40--- /dev/null+++ b/packages/admin-sdk/src/types/params/DigitalAssetUpdateParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DigitalAssetUpdateParams = {+ /**+ * A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for an uploaded+ * file, omitted for a provider-backed asset. On update it replaces the file for everyone who+ * already bought it.+ */+ signed_id?: string+ /** Defaults to the product's default variant when omitted. */+ variant_id?: string+ /** A provider shorthand from the providers endpoint. Omit for an uploaded file. */+ provider_type?: string+ /** Values for the provider's settings schema, keyed by field name. */+ provider_settings?: Record<string, unknown>+ /** Null means the store's download settings apply. */+ authorized_clicks?: number | null+ /** Null means the store's download settings apply. */+ authorized_days?: number | null+}diff --git a/packages/admin-sdk/src/types/params/DiscountCodeApplyParams.ts b/packages/admin-sdk/src/types/params/DiscountCodeApplyParams.tsnew file mode 100644index 0000000000..8adf36bc0d--- /dev/null+++ b/packages/admin-sdk/src/types/params/DiscountCodeApplyParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DiscountCodeApplyParams = {+ code: string+}diff --git a/packages/admin-sdk/src/types/params/DiscountCreateParams.ts b/packages/admin-sdk/src/types/params/DiscountCreateParams.tsnew file mode 100644index 0000000000..bd91df0569--- /dev/null+++ b/packages/admin-sdk/src/types/params/DiscountCreateParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DiscountCreateParams = {+ label: string+ /** An amount in the order currency for a `flat` discount, or a percentage for a `percent` one. */+ value?: string+ /**+ * On create, an older spelling of `value`, read when `value` is absent. On update, the new amount+ * of the row.+ */+ amount?: string+ /** Defaults to `flat`. */+ value_type?: 'flat' | 'percent'+ /**+ * The line item the discount applies to. Omitted, the value is distributed across the line items.+ */+ line_item_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/DiscountUpdateParams.ts b/packages/admin-sdk/src/types/params/DiscountUpdateParams.tsnew file mode 100644index 0000000000..7f2ad88c57--- /dev/null+++ b/packages/admin-sdk/src/types/params/DiscountUpdateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DiscountUpdateParams = {+ label?: string+ /**+ * On create, an older spelling of `value`, read when `value` is absent. On update, the new amount+ * of the row.+ */+ amount?: string+}diff --git a/packages/admin-sdk/src/types/params/EmailTemplateDraftParams.ts b/packages/admin-sdk/src/types/params/EmailTemplateDraftParams.tsnew file mode 100644index 0000000000..98d9be31ae--- /dev/null+++ b/packages/admin-sdk/src/types/params/EmailTemplateDraftParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type EmailTemplateDraftParams = {+ /** A language code, or `any` (the default) for the version every language uses. */+ language?: string+ subject?: string | null+ body?: string+ /**+ * The `lock_version` the draft was loaded with, or null when there was no draft; a save from an+ * older copy is refused with 409. Omit it to save without checking.+ */+ lock_version?: number | null+ /** Marks the draft as based on Spree's current default, after reviewing what changed in it. */+ rebase?: boolean+}diff --git a/packages/admin-sdk/src/types/params/EmailTemplatePreviewParams.ts b/packages/admin-sdk/src/types/params/EmailTemplatePreviewParams.tsnew file mode 100644index 0000000000..8c2e1cf827--- /dev/null+++ b/packages/admin-sdk/src/types/params/EmailTemplatePreviewParams.ts@@ -0,0 +1,23 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type EmailTemplatePreviewParams = {+ /** A language code, or `any` (the default) for the version every language uses. */+ language?: string+ /** An unsaved subject, in place of the current one. */+ subject?: string | null+ /** An unsaved body, in place of the current one. */+ body?: string+ /** The record to build sample data from; the store's latest matching record otherwise. */+ record_id?: string+ /** For the layout or a partial, the email to show it in. */+ email_key?: string+ /** Unsaved colors and font to preview, named like the store's `email_*` settings. */+ branding?: {+ accent_color?: string | null+ background_color?: string | null+ card_color?: string | null+ text_color?: string | null+ heading_color?: string | null+ font?: 'inter' | 'system' | 'helvetica' | 'georgia' | 'roboto' | 'lato' | 'merriweather' | null+ }+}diff --git a/packages/admin-sdk/src/types/params/EmailTemplateRestoreParams.ts b/packages/admin-sdk/src/types/params/EmailTemplateRestoreParams.tsnew file mode 100644index 0000000000..eebcda9cec--- /dev/null+++ b/packages/admin-sdk/src/types/params/EmailTemplateRestoreParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type EmailTemplateRestoreParams = {+ /** A language code, or `any` (the default) for the version every language uses. */+ language?: string+ /** The open draft's `lock_version`, or null when there is none; checked as when saving. */+ lock_version?: number | null+}diff --git a/packages/admin-sdk/src/types/params/EmailTemplateVersionParams.ts b/packages/admin-sdk/src/types/params/EmailTemplateVersionParams.tsnew file mode 100644index 0000000000..916ff61763--- /dev/null+++ b/packages/admin-sdk/src/types/params/EmailTemplateVersionParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type EmailTemplateVersionParams = {+ /** A language code, or `any` (the default) for the version every language uses. */+ language?: string+ /** The draft's `lock_version` as reviewed. A draft saved since is refused with 409. */+ lock_version?: number+}diff --git a/packages/admin-sdk/src/types/params/ExchangeCancelParams.ts b/packages/admin-sdk/src/types/params/ExchangeCancelParams.tsnew file mode 100644index 0000000000..29ed0e3de7--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExchangeCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeCancelParams = {+ /** A note on why the exchange was canceled. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/ExchangeCreateParams.ts b/packages/admin-sdk/src/types/params/ExchangeCreateParams.tsnew file mode 100644index 0000000000..4ed3e03983--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExchangeCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeCreateParams = {+ /** Items coming back, and what goes out in their place. */+ items: {+ fulfillment_item_id: string+ new_variant_id: string+ quantity: number+ }[]+ /** Where the goods come back to. */+ stock_location_id?: string+ /** One of the store's return reasons. */+ reason_id?: string+ memo?: string+}diff --git a/packages/admin-sdk/src/types/params/ExchangeFulfillParams.ts b/packages/admin-sdk/src/types/params/ExchangeFulfillParams.tsnew file mode 100644index 0000000000..990db631a7--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExchangeFulfillParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeFulfillParams = {+ /**+ * How a credit is returned when the replacements cost less than what came back. Defaults to+ * `store_credit`. A balance the customer owes is left for the merchant to collect.+ */+ refund_method?: 'original_payment' | 'store_credit'+}diff --git a/packages/admin-sdk/src/types/params/ExchangeReceiveParams.ts b/packages/admin-sdk/src/types/params/ExchangeReceiveParams.tsnew file mode 100644index 0000000000..055ff8708f--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExchangeReceiveParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeReceiveParams = {+ /** What actually arrived. Omit to receive everything as requested and resellable. */+ items?: {+ exchange_line_item_id: string+ quantity: number+ /** Goods that cannot be resold are received but never restocked. Defaults to true. */+ resellable?: boolean+ }[]+}diff --git a/packages/admin-sdk/src/types/params/ExchangeUpdateParams.ts b/packages/admin-sdk/src/types/params/ExchangeUpdateParams.tsnew file mode 100644index 0000000000..bf24619fc9--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExchangeUpdateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeUpdateParams = {+ /** Where the goods come back to. */+ stock_location_id?: string+ /** One of the store's return reasons. */+ reason_id?: string+ memo?: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/ExportCreateParams.ts b/packages/admin-sdk/src/types/params/ExportCreateParams.tsnew file mode 100644index 0000000000..79d5553742--- /dev/null+++ b/packages/admin-sdk/src/types/params/ExportCreateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExportCreateParams = {+ /**+ * Which dataset to export, as its shorthand: `products`, `orders`, `customers`,+ * `product_translations`, `gift_cards`, `coupon_codes`, `newsletter_subscribers`,+ * `price_list_prices`, `purchase_orders`, or a type an extension registers.+ */+ type: string+ /**+ * `filtered` (the default) keeps `search_params`; `all` ignores them and exports every record in+ * scope.+ */+ record_selection?: 'filtered' | 'all'+ /**+ * 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 allowed origins.+ */+ results_url?: string+ /**+ * A Ransack query, with the predicates the list endpoint accepts. A `price_list_prices` export+ * requires `price_list_id_eq` naming a price list of the current store, and refuses+ * `record_selection: "all"`.+ */+ search_params?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/FeeCreateParams.ts b/packages/admin-sdk/src/types/params/FeeCreateParams.tsnew file mode 100644index 0000000000..b273a56cb4--- /dev/null+++ b/packages/admin-sdk/src/types/params/FeeCreateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FeeCreateParams = {+ label: string+ amount: string+ /** Defaults to `surcharge`. */+ kind?: 'surcharge' | 'handling' | 'gift_wrap' | 'cod' | 'payment' | 'duty' | 'exchange'+ /** The line item or fulfillment the fee belongs to. Omitted, the fee is order-level. */+ line_item_id?: string | null+ /** The line item or fulfillment the fee belongs to. Omitted, the fee is order-level. */+ fulfillment_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/FeeUpdateParams.ts b/packages/admin-sdk/src/types/params/FeeUpdateParams.tsnew file mode 100644index 0000000000..dcde968e72--- /dev/null+++ b/packages/admin-sdk/src/types/params/FeeUpdateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FeeUpdateParams = {+ label?: string+ amount?: string+ /** Defaults to `surcharge`. */+ kind?: 'surcharge' | 'handling' | 'gift_wrap' | 'cod' | 'payment' | 'duty' | 'exchange'+}diff --git a/packages/admin-sdk/src/types/params/FileUploadCreateParams.ts b/packages/admin-sdk/src/types/params/FileUploadCreateParams.tsnew file mode 100644index 0000000000..3cebabf795--- /dev/null+++ b/packages/admin-sdk/src/types/params/FileUploadCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FileUploadCreateParams = {+ filename: string+ content_type: string+ byte_size?: number+ /** Base64-encoded MD5 digest of the file; the storage service checks the bytes against it. */+ checksum?: string+ /** `public` (the default) for images and videos customers see, `private` for anything else. */+ visibility?: 'public' | 'private'+ /** The bytes, for a multipart upload. */+ file?: string+}diff --git a/packages/admin-sdk/src/types/params/FulfillmentCreateParams.ts b/packages/admin-sdk/src/types/params/FulfillmentCreateParams.tsnew file mode 100644index 0000000000..14485fd2e0--- /dev/null+++ b/packages/admin-sdk/src/types/params/FulfillmentCreateParams.ts@@ -0,0 +1,39 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentCreateParams = {+ /**+ * The location the fulfillment ships from. On update, moving it re-prices the fulfillment against+ * that location's rates.+ */+ stock_location_id: string+ /**+ * The only fulfillment of this order to move units from, its exchange and claim replacements+ * included: how a canceled replacement is sent again. Omitted, the customer's bought units are+ * taken from every unshipped fulfillment.+ */+ source_fulfillment_id?: string+ /**+ * Carrier tracking number, or a full `https://` tracking link, which is served back as+ * `tracking_url` unchanged.+ */+ tracking?: string+ /**+ * Delivery method attached as the selected rate. Defaults to the delivery method of the fully+ * drained source fulfillments.+ */+ delivery_method_id?: string+ /**+ * Explicit shipping cost, such as the 3PL price. Defaults to the summed cost of the fully drained+ * source fulfillments, which keeps the order total unchanged. Persists only with+ * `status: shipped`; pending fulfillments are re-priced by the rate engine.+ */+ cost?: string+ /** Pass `shipped` to register an already-shipped external fulfillment. */+ status?: 'shipped'+ metadata?: Record<string, unknown>+ /** Line item quantities to fulfill. Omit to fulfill every unit not yet shipped. */+ items?: {+ item_id: string+ quantity: number+ }[]+}diff --git a/packages/admin-sdk/src/types/params/FulfillmentFulfillParams.ts b/packages/admin-sdk/src/types/params/FulfillmentFulfillParams.tsnew file mode 100644index 0000000000..d6aaacab3c--- /dev/null+++ b/packages/admin-sdk/src/types/params/FulfillmentFulfillParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentFulfillParams = {+ /**+ * Line item quantities to ship. Omit to ship everything the fulfillment holds; a subset is split+ * onto a new fulfillment, which is the one that ships.+ */+ items?: {+ item_id: string+ quantity: number+ }[]+ /**+ * Carrier tracking number or a full `https://` tracking link, stored on the fulfillment that+ * ships.+ */+ tracking?: string+ /** Which carrier the number belongs to; detected from the number when omitted. */+ tracking_carrier?: string+ /**+ * Whether the customer gets the shipment email. Defaults to true; pass false to suppress it for+ * this dispatch only.+ */+ notify_customer?: boolean+ /** Hand the goods over even though the order is unpaid or holds backordered units. */+ force?: boolean+}diff --git a/packages/admin-sdk/src/types/params/FulfillmentMarkDeliveredParams.ts b/packages/admin-sdk/src/types/params/FulfillmentMarkDeliveredParams.tsnew file mode 100644index 0000000000..e6ac9cb17e--- /dev/null+++ b/packages/admin-sdk/src/types/params/FulfillmentMarkDeliveredParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentMarkDeliveredParams = {+ /** When it arrived. Defaults to now; return windows run from this time. */+ delivered_at?: string+ /** Whether the customer gets a delivery notification. Defaults to true. */+ notify_customer?: boolean+}diff --git a/packages/admin-sdk/src/types/params/FulfillmentSplitParams.ts b/packages/admin-sdk/src/types/params/FulfillmentSplitParams.tsnew file mode 100644index 0000000000..15c5080f22--- /dev/null+++ b/packages/admin-sdk/src/types/params/FulfillmentSplitParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentSplitParams = {+ /** The variant being moved out. */+ variant_id: string+ quantity: number+ /** Origin of the new fulfillment. Defaults to the source fulfillment's location. */+ stock_location_id?: string+}diff --git a/packages/admin-sdk/src/types/params/FulfillmentUpdateParams.ts b/packages/admin-sdk/src/types/params/FulfillmentUpdateParams.tsnew file mode 100644index 0000000000..9c4173e1ad--- /dev/null+++ b/packages/admin-sdk/src/types/params/FulfillmentUpdateParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentUpdateParams = {+ /**+ * The location the fulfillment ships from. On update, moving it re-prices the fulfillment against+ * that location's rates.+ */+ stock_location_id?: string+ /**+ * Carrier tracking number, or a full `https://` tracking link, which is served back as+ * `tracking_url` unchanged.+ */+ tracking?: string+ /**+ * Which carrier the tracking number belongs to: a slug from the tracking carriers endpoint. Left+ * blank, it is detected from the number's format where possible.+ */+ tracking_carrier?: string+ selected_delivery_rate_id?: string+}diff --git a/packages/admin-sdk/src/types/params/GiftCardApplyParams.ts b/packages/admin-sdk/src/types/params/GiftCardApplyParams.tsnew file mode 100644index 0000000000..16f2f59376--- /dev/null+++ b/packages/admin-sdk/src/types/params/GiftCardApplyParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type GiftCardApplyParams = {+ /** The gift card code; matched case-insensitively. */+ code: string+}diff --git a/packages/admin-sdk/src/types/params/GiftCardBatchCreateParams.ts b/packages/admin-sdk/src/types/params/GiftCardBatchCreateParams.tsnew file mode 100644index 0000000000..85a0d421cd--- /dev/null+++ b/packages/admin-sdk/src/types/params/GiftCardBatchCreateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type GiftCardBatchCreateParams = {+ /** Lowercased and prepended to every generated code. */+ prefix: string+ /** The amount of each card, greater than zero. */+ amount: string+ /**+ * How many cards to generate. Capped at `gift_card_batch_limit`; batches over+ * `gift_card_batch_web_limit` generate in the background.+ */+ codes_count: number+ /** ISO 4217 currency code. Defaults to the store currency. */+ currency?: string+ expires_at?: string | null+}diff --git a/packages/admin-sdk/src/types/params/GiftCardCreateParams.ts b/packages/admin-sdk/src/types/params/GiftCardCreateParams.tsnew file mode 100644index 0000000000..3e3f239986--- /dev/null+++ b/packages/admin-sdk/src/types/params/GiftCardCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type GiftCardCreateParams = {+ /** Greater than zero. */+ amount: string+ /** ISO 4217 currency code. Defaults to the store currency. */+ currency?: string+ /** Generated when omitted. */+ code?: string+ expires_at?: string | null+ /** The customer the card belongs to. Needs the `read_customers` permission; null detaches it. */+ customer_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/GiftCardUpdateParams.ts b/packages/admin-sdk/src/types/params/GiftCardUpdateParams.tsnew file mode 100644index 0000000000..412a636929--- /dev/null+++ b/packages/admin-sdk/src/types/params/GiftCardUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type GiftCardUpdateParams = {+ /** Greater than zero. */+ amount?: string+ /** ISO 4217 currency code. Defaults to the store currency. */+ currency?: string+ /** Generated when omitted. */+ code?: string+ expires_at?: string | null+ /** The customer the card belongs to. Needs the `read_customers` permission; null detaches it. */+ customer_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/ImportCompleteMappingParams.ts b/packages/admin-sdk/src/types/params/ImportCompleteMappingParams.tsnew file mode 100644index 0000000000..eb703e00c9--- /dev/null+++ b/packages/admin-sdk/src/types/params/ImportCompleteMappingParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ImportCompleteMappingParams = {+ /**+ * Column assignments to apply before processing starts. Omit to accept the ones assigned on+ * create.+ */+ mappings?: {+ /** A schema field name from the import's `schema_fields`. */+ schema_field: string+ /** The CSV header to read the field from; null unmaps the field. */+ file_column?: string | null+ }[]+}diff --git a/packages/admin-sdk/src/types/params/ImportCreateParams.ts b/packages/admin-sdk/src/types/params/ImportCreateParams.tsnew file mode 100644index 0000000000..933fe64a13--- /dev/null+++ b/packages/admin-sdk/src/types/params/ImportCreateParams.ts@@ -0,0 +1,23 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ImportCreateParams = {+ /**+ * Which dataset to import, as its shorthand: `products`, `customers`, `product_translations`,+ * `price_list_prices`, `purchase_orders`, or a type an extension registers.+ */+ type: string+ /** The `signed_id` of the uploaded CSV, from `files.upload()` with `visibility: "private"`. */+ attachment_signed_id: string+ /** CSV column separator. Defaults to a comma. */+ delimiter?: ',' | ';' | '|' | ' '+ /**+ * 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 allowed origins.+ */+ results_url?: string+ /**+ * For `price_list_prices` imports: the price list the rows are merged into. Must belong to the+ * current store; other types ignore it.+ */+ price_list_id?: string+}diff --git a/packages/admin-sdk/src/types/params/IntegrationCreateParams.ts b/packages/admin-sdk/src/types/params/IntegrationCreateParams.tsnew file mode 100644index 0000000000..ba8026c964--- /dev/null+++ b/packages/admin-sdk/src/types/params/IntegrationCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type IntegrationCreateParams = {+ /** Wire shorthand from the integration types endpoint. */+ type: string+ /** Activating runs the connection check, and a failed check is a 422. */+ active?: boolean+ /**+ * Credential values. Secret preferences come back masked, and sending a masked value back keeps+ * the stored secret.+ */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/IntegrationUpdateParams.ts b/packages/admin-sdk/src/types/params/IntegrationUpdateParams.tsnew file mode 100644index 0000000000..4457af8446--- /dev/null+++ b/packages/admin-sdk/src/types/params/IntegrationUpdateParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type IntegrationUpdateParams = {+ /** Activating runs the connection check, and a failed check is a 422. */+ active?: boolean+ /**+ * Credential values. Secret preferences come back masked, and sending a masked value back keeps+ * the stored secret.+ */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/InvitationAcceptParams.ts b/packages/admin-sdk/src/types/params/InvitationAcceptParams.tsnew file mode 100644index 0000000000..777882deb0--- /dev/null+++ b/packages/admin-sdk/src/types/params/InvitationAcceptParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type InvitationAcceptParams = {+ /**+ * Required when the invitee has no account yet: it creates one. An existing account signs in+ * without it.+ */+ password?: string+ password_confirmation?: string+ first_name?: string+ last_name?: string+}diff --git a/packages/admin-sdk/src/types/params/InvitationCreateParams.ts b/packages/admin-sdk/src/types/params/InvitationCreateParams.tsnew file mode 100644index 0000000000..4bc01b679d--- /dev/null+++ b/packages/admin-sdk/src/types/params/InvitationCreateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type InvitationCreateParams = {+ email: string+ /** The role (`role_...`) the invitee gets on accepting. */+ role_id: string+}diff --git a/packages/admin-sdk/src/types/params/LineItemCreateParams.ts b/packages/admin-sdk/src/types/params/LineItemCreateParams.tsnew file mode 100644index 0000000000..221890429a--- /dev/null+++ b/packages/admin-sdk/src/types/params/LineItemCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type LineItemCreateParams = {+ variant_id: string+ /** Defaults to 1 when adding an item. */+ quantity?: number+ /**+ * Negotiated unit price. Stamps the line `price_source: 'manual'`, so quantity changes and+ * recalculation never re-price it; an explicit null reverts the line to catalog pricing. Omit to+ * leave pricing alone. Draft (incomplete) orders only.+ */+ price?: string | null+ options?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/LineItemUpdateParams.ts b/packages/admin-sdk/src/types/params/LineItemUpdateParams.tsnew file mode 100644index 0000000000..61d3576963--- /dev/null+++ b/packages/admin-sdk/src/types/params/LineItemUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type LineItemUpdateParams = {+ /** Defaults to 1 when adding an item. */+ quantity?: number+ /**+ * Negotiated unit price. Stamps the line `price_source: 'manual'`, so quantity changes and+ * recalculation never re-price it; an explicit null reverts the line to catalog pricing. Omit to+ * leave pricing alone. Draft (incomplete) orders only.+ */+ price?: string | null+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/MarketCreateParams.ts b/packages/admin-sdk/src/types/params/MarketCreateParams.tsnew file mode 100644index 0000000000..b33aaf95fe--- /dev/null+++ b/packages/admin-sdk/src/types/params/MarketCreateParams.ts@@ -0,0 +1,25 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MarketCreateParams = {+ /** Display name, unique within the store. */+ name: string+ /** ISO 4217 currency code. */+ currency: string+ /** Locale used as the market default. Always part of `supported_locales`. */+ default_locale: string+ /** Display prices with tax included. */+ tax_inclusive?: boolean+ /**+ * Shorthand of the tax engine that prices this market, from the tax providers endpoint. Null uses+ * the installation default.+ */+ tax_provider?: string | null+ /** Setting true demotes the previous default market of the store. */+ default?: boolean+ /** Sort order within the store; lower comes first. */+ position?: number+ /** Locales available in this market. The default locale is always included. */+ supported_locales?: string[]+ /** ISO 3166-1 alpha-2 codes of the countries in this market. At least one is required. */+ country_codes: string[]+}diff --git a/packages/admin-sdk/src/types/params/MarketUpdateParams.ts b/packages/admin-sdk/src/types/params/MarketUpdateParams.tsnew file mode 100644index 0000000000..854ad76994--- /dev/null+++ b/packages/admin-sdk/src/types/params/MarketUpdateParams.ts@@ -0,0 +1,25 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MarketUpdateParams = {+ /** Display name, unique within the store. */+ name?: string+ /** ISO 4217 currency code. */+ currency?: string+ /** Locale used as the market default. Always part of `supported_locales`. */+ default_locale?: string+ /** Display prices with tax included. */+ tax_inclusive?: boolean+ /**+ * Shorthand of the tax engine that prices this market, from the tax providers endpoint. Null uses+ * the installation default.+ */+ tax_provider?: string | null+ /** Setting true demotes the previous default market of the store. */+ default?: boolean+ /** Sort order within the store; lower comes first. */+ position?: number+ /** Locales available in this market. The default locale is always included. */+ supported_locales?: string[]+ /** ISO 3166-1 alpha-2 codes of the countries in this market. At least one is required. */+ country_codes?: string[]+}diff --git a/packages/admin-sdk/src/types/params/MeUpdateParams.ts b/packages/admin-sdk/src/types/params/MeUpdateParams.tsnew file mode 100644index 0000000000..d0df577a86--- /dev/null+++ b/packages/admin-sdk/src/types/params/MeUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MeUpdateParams = {+ /** The dashboard display language. */+ selected_locale?: string+ first_name?: string+ last_name?: string+ /**+ * A `signed_id` from `files.upload()` to set the avatar, or null to remove it. Omit it to keep+ * the current photo.+ */+ avatar_signed_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/MediaCreateParams.ts b/packages/admin-sdk/src/types/params/MediaCreateParams.tsnew file mode 100644index 0000000000..92ee37f3c9--- /dev/null+++ b/packages/admin-sdk/src/types/params/MediaCreateParams.ts@@ -0,0 +1,42 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MediaCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ alt?: string | null+ position?: number+ /**+ * Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an+ * `external_video_url`.+ */+ media_type?: 'image' | 'video' | 'external_video'+ /** YouTube or Vimeo link. Required when `media_type` is `external_video`. */+ external_video_url?: string | null+ /** A `signed_id` from `files.upload()` for a video's poster frame. */+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /**+ * The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`.+ */+ attachment?: string+ /**+ * Fetch an image from this URL, in the background. Images only: an external video uses+ * `external_video_url`.+ */+ url?: string+ /** A `signed_id` from `files.upload()` for the media file itself. */+ signed_id?: string+ /**+ * Place a file that is already in the library. The new row shares the source file rather than+ * copying it, and takes its own alt, position and variant links from here.+ */+ source_media_id?: string+ /** Variants to link this product-level media to. Variants of other products are dropped. */+ variant_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/MediaLibraryCreateParams.ts b/packages/admin-sdk/src/types/params/MediaLibraryCreateParams.tsnew file mode 100644index 0000000000..71cf7b63da--- /dev/null+++ b/packages/admin-sdk/src/types/params/MediaLibraryCreateParams.ts@@ -0,0 +1,42 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MediaLibraryCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ alt?: string | null+ position?: number+ /**+ * Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an+ * `external_video_url`.+ */+ media_type?: 'image' | 'video' | 'external_video'+ /** YouTube or Vimeo link. Required when `media_type` is `external_video`. */+ external_video_url?: string | null+ /** A `signed_id` from `files.upload()` for a video's poster frame. */+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /**+ * The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`.+ */+ attachment?: string+ /**+ * Fetch an image from this URL, in the background. Images only: an external video uses+ * `external_video_url`.+ */+ url?: string+ /** A `signed_id` from `files.upload()` for the media file itself. */+ signed_id?: string+ /**+ * Place a file that is already in the library. The new row shares the source file rather than+ * copying it, and takes its own alt, position and variant links from here.+ */+ source_media_id?: string+ /** Variants to link this product-level media to. Variants of other products are dropped. */+ variant_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/MediaLibraryUpdateParams.ts b/packages/admin-sdk/src/types/params/MediaLibraryUpdateParams.tsnew file mode 100644index 0000000000..47afd372be--- /dev/null+++ b/packages/admin-sdk/src/types/params/MediaLibraryUpdateParams.ts@@ -0,0 +1,42 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MediaLibraryUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ alt?: string | null+ position?: number+ /**+ * Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an+ * `external_video_url`.+ */+ media_type?: 'image' | 'video' | 'external_video'+ /** YouTube or Vimeo link. Required when `media_type` is `external_video`. */+ external_video_url?: string | null+ /** A `signed_id` from `files.upload()` for a video's poster frame. */+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /**+ * The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`.+ */+ attachment?: string+ /**+ * Fetch an image from this URL, in the background. Images only: an external video uses+ * `external_video_url`.+ */+ url?: string+ /** A `signed_id` from `files.upload()` for the media file itself. */+ signed_id?: string+ /**+ * Place a file that is already in the library. The new row shares the source file rather than+ * copying it, and takes its own alt, position and variant links from here.+ */+ source_media_id?: string+ /** Variants to link this product-level media to. Variants of other products are dropped. */+ variant_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/MediaUpdateParams.ts b/packages/admin-sdk/src/types/params/MediaUpdateParams.tsnew file mode 100644index 0000000000..9fe3fad70c--- /dev/null+++ b/packages/admin-sdk/src/types/params/MediaUpdateParams.ts@@ -0,0 +1,42 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type MediaUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ alt?: string | null+ position?: number+ /**+ * Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an+ * `external_video_url`.+ */+ media_type?: 'image' | 'video' | 'external_video'+ /** YouTube or Vimeo link. Required when `media_type` is `external_video`. */+ external_video_url?: string | null+ /** A `signed_id` from `files.upload()` for a video's poster frame. */+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /**+ * The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`.+ */+ attachment?: string+ /**+ * Fetch an image from this URL, in the background. Images only: an external video uses+ * `external_video_url`.+ */+ url?: string+ /** A `signed_id` from `files.upload()` for the media file itself. */+ signed_id?: string+ /**+ * Place a file that is already in the library. The new row shares the source file rather than+ * copying it, and takes its own alt, position and variant links from here.+ */+ source_media_id?: string+ /** Variants to link this product-level media to. Variants of other products are dropped. */+ variant_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/OptionTypeCreateParams.ts b/packages/admin-sdk/src/types/params/OptionTypeCreateParams.tsnew file mode 100644index 0000000000..0fca86abe3--- /dev/null+++ b/packages/admin-sdk/src/types/params/OptionTypeCreateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { OptionValueParams } from './OptionValueParams'++export type OptionTypeCreateParams = {+ name: string+ label: string+ position?: number+ filterable?: boolean+ kind?: 'dropdown' | 'color_swatch' | 'buttons'+ /**+ * Inline option values. Values left out of the list on update are destroyed, so send the full set+ * every time.+ */+ option_values?: OptionValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/OptionTypeUpdateParams.ts b/packages/admin-sdk/src/types/params/OptionTypeUpdateParams.tsnew file mode 100644index 0000000000..a95fd2645c--- /dev/null+++ b/packages/admin-sdk/src/types/params/OptionTypeUpdateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { OptionValueParams } from './OptionValueParams'++export type OptionTypeUpdateParams = {+ name?: string+ label?: string+ position?: number+ filterable?: boolean+ kind?: 'dropdown' | 'color_swatch' | 'buttons'+ /**+ * Inline option values. Values left out of the list on update are destroyed, so send the full set+ * every time.+ */+ option_values?: OptionValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/OptionValueParams.ts b/packages/admin-sdk/src/types/params/OptionValueParams.tsnew file mode 100644index 0000000000..acd711d8d4--- /dev/null+++ b/packages/admin-sdk/src/types/params/OptionValueParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OptionValueParams = {+ /** Present for existing values. Omit to create a new one. */+ id?: string+ name?: string+ label?: string+ position?: number+ /** Hex color. Only meaningful when the option type's `kind` is `color_swatch`. */+ color_code?: string | null+ /** A `signed_id` from `files.upload()`, or null to remove the image. */+ image_signed_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/OrderCancelParams.ts b/packages/admin-sdk/src/types/params/OrderCancelParams.tsnew file mode 100644index 0000000000..a21d90c0c3--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderCancelParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderCancelParams = {+ /** Why the order was canceled: the id of one of the store's cancellation reasons. */+ cancel_reason_id?: string+ /** Staff-facing note about the cancellation. */+ cancel_note?: string+ /** Whether this order's share of a payment shared across a split checkout is handed back. */+ refund_payments?: boolean+ /**+ * How much of that share to return. Defaults to all of it; refused on an order whose payment is+ * not shared.+ */+ refund_amount?: string+ /** Send the order cancellation email after canceling. */+ notify_customer?: boolean+}diff --git a/packages/admin-sdk/src/types/params/OrderCompleteParams.ts b/packages/admin-sdk/src/types/params/OrderCompleteParams.tsnew file mode 100644index 0000000000..67c9f26957--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderCompleteParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderCompleteParams = {+ payment_pending?: boolean+ /** Send the order confirmation email after completion. */+ notify_customer?: boolean+}diff --git a/packages/admin-sdk/src/types/params/OrderCreateParams.ts b/packages/admin-sdk/src/types/params/OrderCreateParams.tsnew file mode 100644index 0000000000..c4bbd70a88--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderCreateParams.ts@@ -0,0 +1,73 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { AddressInputParams } from './AddressInputParams'++export type OrderCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ email?: string+ customer_id?: string+ /**+ * With `customer_id`, copies the customer's saved billing and shipping addresses onto the order.+ */+ use_customer_default_address?: boolean+ currency?: string+ market_id?: string+ /** Defaults to the store primary channel when omitted. */+ channel_id?: string+ locale?: string+ /** Public, customer-visible note. */+ customer_note?: string+ /** Staff-only note. Rich text HTML; reads come back as this plus `internal_note_html`. */+ internal_note?: string+ /**+ * The buyer's own purchase-order reference. Searchable alongside the order number, and rendered+ * on every order-facing document.+ */+ po_number?: string+ /**+ * The `signed_id` of the buyer's purchase order, from `files.upload()` with+ * `visibility: 'private'`. Null removes the document the order carries.+ */+ po_document_signed_id?: string | null+ /** An existing address of the customer. */+ shipping_address_id?: string+ /** An existing address of the customer. */+ billing_address_id?: string+ /**+ * Stock location to prefer for fulfillment. Order Routing's built-in preferred-location rule+ * ranks it first; routing falls back to the next rule when the location can't cover the cart.+ */+ preferred_stock_location_id?: string+ /**+ * Makes the order a company purchase, with that company's catalog prices and tax treatment. Null+ * makes a draft a plain customer order again.+ */+ company_id?: string | null+ /** Applied non-fatally: an invalid code does not block creation. */+ coupon_code?: string+ metadata?: Record<string, unknown>+ tags?: string[]+ shipping_address?: AddressInputParams+ billing_address?: AddressInputParams+ /**+ * Line items to upsert, keyed by variant. An entry sets that variant's quantity, creating the+ * line item when the order has none; `quantity: 0` removes it. Variants you do not send are left+ * alone.+ */+ items?: {+ variant_id: string+ quantity?: number+ /**+ * Negotiated unit price; stamps `price_source: 'manual'`. Null reverts the line to catalog+ * pricing. Draft orders only.+ */+ price?: string | null+ metadata?: Record<string, unknown>+ }[]+}diff --git a/packages/admin-sdk/src/types/params/OrderRoutingRuleCreateParams.ts b/packages/admin-sdk/src/types/params/OrderRoutingRuleCreateParams.tsnew file mode 100644index 0000000000..b591aa1a17--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderRoutingRuleCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderRoutingRuleCreateParams = {+ /** Wire shorthand for the rule kind, from the order routing rule types endpoint. */+ type: string+ active?: boolean+ /**+ * 1-based priority in the channel's rule list. Omitted on create, the rule goes last; a new+ * position reorders the rest of the list around it.+ */+ position?: number+ /** Values for the rule kind's preference schema. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/OrderRoutingRuleUpdateParams.ts b/packages/admin-sdk/src/types/params/OrderRoutingRuleUpdateParams.tsnew file mode 100644index 0000000000..018d843a4a--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderRoutingRuleUpdateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderRoutingRuleUpdateParams = {+ active?: boolean+ /**+ * 1-based priority in the channel's rule list. Omitted on create, the rule goes last; a new+ * position reorders the rest of the list around it.+ */+ position?: number+ /** Values for the rule kind's preference schema. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/OrderUpdateParams.ts b/packages/admin-sdk/src/types/params/OrderUpdateParams.tsnew file mode 100644index 0000000000..aa7d15e3ed--- /dev/null+++ b/packages/admin-sdk/src/types/params/OrderUpdateParams.ts@@ -0,0 +1,63 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { AddressInputParams } from './AddressInputParams'++export type OrderUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ email?: string+ customer_id?: string+ currency?: string+ market_id?: string+ /** Defaults to the store primary channel when omitted. */+ channel_id?: string+ locale?: string+ /** Public, customer-visible note. */+ customer_note?: string+ /** Staff-only note. Rich text HTML; reads come back as this plus `internal_note_html`. */+ internal_note?: string+ /**+ * The buyer's own purchase-order reference. Searchable alongside the order number, and rendered+ * on every order-facing document.+ */+ po_number?: string+ /**+ * The `signed_id` of the buyer's purchase order, from `files.upload()` with+ * `visibility: 'private'`. Null removes the document the order carries.+ */+ po_document_signed_id?: string | null+ /**+ * Stock location to prefer for fulfillment. Order Routing's built-in preferred-location rule+ * ranks it first; routing falls back to the next rule when the location can't cover the cart.+ */+ preferred_stock_location_id?: string+ /**+ * Makes the order a company purchase, with that company's catalog prices and tax treatment. Null+ * makes a draft a plain customer order again.+ */+ company_id?: string | null+ metadata?: Record<string, unknown>+ tags?: string[]+ shipping_address?: AddressInputParams+ billing_address?: AddressInputParams+ /**+ * Line items to upsert, keyed by variant. An entry sets that variant's quantity, creating the+ * line item when the order has none; `quantity: 0` removes it. Variants you do not send are left+ * alone.+ */+ items?: {+ variant_id: string+ quantity?: number+ /**+ * Negotiated unit price; stamps `price_source: 'manual'`. Null reverts the line to catalog+ * pricing. Draft orders only.+ */+ price?: string | null+ metadata?: Record<string, unknown>+ }[]+}diff --git a/packages/admin-sdk/src/types/params/PackageTypeCreateParams.ts b/packages/admin-sdk/src/types/params/PackageTypeCreateParams.tsnew file mode 100644index 0000000000..82a16a1a58--- /dev/null+++ b/packages/admin-sdk/src/types/params/PackageTypeCreateParams.ts@@ -0,0 +1,24 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PackageTypeCreateParams = {+ /** Unique within the store. */+ name: string+ /**+ * What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale+ * order leaves on.+ */+ kind: 'box' | 'envelope' | 'carton' | 'pallet' | 'container'+ length?: number | null+ width?: number | null+ height?: number | null+ /** Unit the three dimensions are in; falls back to the store's unit system. */+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft' | null+ /** The empty package's own weight, added to content weight on every quote. */+ weight?: number | null+ /** What the package can hold, not the same as its own weight. */+ max_weight?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz' | null+ /** The box every parcel quote is built on. Setting this demotes whichever row held it. */+ default?: boolean+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PackageTypeUpdateParams.ts b/packages/admin-sdk/src/types/params/PackageTypeUpdateParams.tsnew file mode 100644index 0000000000..19bbdd322f--- /dev/null+++ b/packages/admin-sdk/src/types/params/PackageTypeUpdateParams.ts@@ -0,0 +1,24 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PackageTypeUpdateParams = {+ /** Unique within the store. */+ name?: string+ /**+ * What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale+ * order leaves on.+ */+ kind?: 'box' | 'envelope' | 'carton' | 'pallet' | 'container'+ length?: number | null+ width?: number | null+ height?: number | null+ /** Unit the three dimensions are in; falls back to the store's unit system. */+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft' | null+ /** The empty package's own weight, added to content weight on every quote. */+ weight?: number | null+ /** What the package can hold, not the same as its own weight. */+ max_weight?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz' | null+ /** The box every parcel quote is built on. Setting this demotes whichever row held it. */+ default?: boolean+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PasswordResetParams.ts b/packages/admin-sdk/src/types/params/PasswordResetParams.tsnew file mode 100644index 0000000000..b5682f84a9--- /dev/null+++ b/packages/admin-sdk/src/types/params/PasswordResetParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PasswordResetParams = {+ password: string+ password_confirmation: string+}diff --git a/packages/admin-sdk/src/types/params/PasswordResetRequestParams.ts b/packages/admin-sdk/src/types/params/PasswordResetRequestParams.tsnew file mode 100644index 0000000000..209eb56238--- /dev/null+++ b/packages/admin-sdk/src/types/params/PasswordResetRequestParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PasswordResetRequestParams = {+ email: string+ /**+ * The page the emailed reset link points at, with the reset token appended. Honored only on the+ * dashboard origin, for an account that is staff of the store; ignored otherwise.+ */+ redirect_url?: string+}diff --git a/packages/admin-sdk/src/types/params/PaymentCaptureParams.ts b/packages/admin-sdk/src/types/params/PaymentCaptureParams.tsnew file mode 100644index 0000000000..7be7a2ef06--- /dev/null+++ b/packages/admin-sdk/src/types/params/PaymentCaptureParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PaymentCaptureParams = {+ /** Captures part of the authorized amount. Defaults to all of it. */+ amount?: string+}diff --git a/packages/admin-sdk/src/types/params/PaymentCreateParams.ts b/packages/admin-sdk/src/types/params/PaymentCreateParams.tsnew file mode 100644index 0000000000..3e9ad4c601--- /dev/null+++ b/packages/admin-sdk/src/types/params/PaymentCreateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PaymentCreateParams = {+ payment_method_id: string+ /** Defaults to the order total left after store credit. */+ amount?: string+ /**+ * A saved payment source of the order's customer (a credit card), for an off-session charge. Used+ * only by payment methods that require a source.+ */+ source_id?: string+}diff --git a/packages/admin-sdk/src/types/params/PaymentMethodCreateParams.ts b/packages/admin-sdk/src/types/params/PaymentMethodCreateParams.tsnew file mode 100644index 0000000000..f238486bd3--- /dev/null+++ b/packages/admin-sdk/src/types/params/PaymentMethodCreateParams.ts@@ -0,0 +1,19 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PaymentMethodCreateParams = {+ /** Wire shorthand from the payment method types endpoint. */+ type: string+ name: string+ description?: string | null+ active?: boolean+ /** False keeps the method to the dashboard; true also offers it on the storefront. */+ storefront_visible?: boolean+ /** Deprecated: use `capture_method`. Removed in 6.1. */+ auto_capture?: boolean | null+ /** When customers are charged for this method. Null inherits the store setting. */+ capture_method?: 'checkout' | 'on_dispatch' | 'manual' | null+ position?: number+ metadata?: Record<string, unknown>+ /** Values for the provider's preference schema, from the payment method types endpoint. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PaymentMethodUpdateParams.ts b/packages/admin-sdk/src/types/params/PaymentMethodUpdateParams.tsnew file mode 100644index 0000000000..6012ad8903--- /dev/null+++ b/packages/admin-sdk/src/types/params/PaymentMethodUpdateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PaymentMethodUpdateParams = {+ name?: string+ description?: string | null+ active?: boolean+ /** False keeps the method to the dashboard; true also offers it on the storefront. */+ storefront_visible?: boolean+ /** Deprecated: use `capture_method`. Removed in 6.1. */+ auto_capture?: boolean | null+ /** When customers are charged for this method. Null inherits the store setting. */+ capture_method?: 'checkout' | 'on_dispatch' | 'manual' | null+ position?: number+ metadata?: Record<string, unknown>+ /** Values for the provider's preference schema, from the payment method types endpoint. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PolicyCreateParams.ts b/packages/admin-sdk/src/types/params/PolicyCreateParams.tsnew file mode 100644index 0000000000..786df47f6a--- /dev/null+++ b/packages/admin-sdk/src/types/params/PolicyCreateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PolicyCreateParams = {+ name: string+ slug?: string+ body?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PolicyUpdateParams.ts b/packages/admin-sdk/src/types/params/PolicyUpdateParams.tsnew file mode 100644index 0000000000..15d073ec57--- /dev/null+++ b/packages/admin-sdk/src/types/params/PolicyUpdateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PolicyUpdateParams = {+ name?: string+ slug?: string+ body?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PriceAdjustmentTierParams.ts b/packages/admin-sdk/src/types/params/PriceAdjustmentTierParams.tsnew file mode 100644index 0000000000..ce6fff1fdc--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceAdjustmentTierParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceAdjustmentTierParams = {+ /** Above 1; quantity 1 is the list's own `price_adjustment_percentage`. */+ min_quantity: number+ /** Signed: negative discounts, positive marks up. */+ percentage: string+}diff --git a/packages/admin-sdk/src/types/params/PriceBulkDestroyParams.ts b/packages/admin-sdk/src/types/params/PriceBulkDestroyParams.tsnew file mode 100644index 0000000000..33a5a58ccf--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceBulkDestroyParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceBulkDestroyParams = {+ ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/PriceBulkUpsertParams.ts b/packages/admin-sdk/src/types/params/PriceBulkUpsertParams.tsnew file mode 100644index 0000000000..b633a0424e--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceBulkUpsertParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceBulkUpsertRowParams } from './PriceBulkUpsertRowParams'++export type PriceBulkUpsertParams = {+ /** Send an empty list to change nothing. */+ prices: PriceBulkUpsertRowParams[]+}diff --git a/packages/admin-sdk/src/types/params/PriceBulkUpsertRowParams.ts b/packages/admin-sdk/src/types/params/PriceBulkUpsertRowParams.tsnew file mode 100644index 0000000000..406a80d611--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceBulkUpsertRowParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceBulkUpsertRowParams = {+ /**+ * Present: updates that row. Absent: upserts on+ * `(variant_id, currency, price_list_id, min_quantity)`.+ */+ id?: string | null+ variant_id: string+ currency: string+ /** Omit or null for a base price. */+ price_list_id?: string | null+ /**+ * The rung of the variant's ladder. Omit for the bottom rung; anything above 1 requires a+ * `price_list_id`. A variant carries at most ten rungs on one list per currency.+ */+ min_quantity?: number+ amount?: string | null+ compare_at_amount?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PriceCreateParams.ts b/packages/admin-sdk/src/types/params/PriceCreateParams.tsnew file mode 100644index 0000000000..512bfb244b--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceCreateParams = {+ variant_id: string+ currency: string+ /**+ * The quantity a line must reach for this price to apply. Omit for the bottom rung of the ladder.+ * Anything above 1 requires a `price_list_id`.+ */+ min_quantity?: number+ amount?: string | null+ compare_at_amount?: string | null+ /** Omit or null for a base price; a price list for a list override. */+ price_list_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PriceListCreateParams.ts b/packages/admin-sdk/src/types/params/PriceListCreateParams.tsnew file mode 100644index 0000000000..6167859841--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceListCreateParams.ts@@ -0,0 +1,37 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceAdjustmentTierParams } from './PriceAdjustmentTierParams'+import type { PriceListPriceOverrideParams } from './PriceListPriceOverrideParams'+import type { PriceListRuleParams } from './PriceListRuleParams'++export type PriceListCreateParams = {+ name: string+ description?: string | null+ position?: number+ /**+ * Pair with `ends_at` to schedule the list: activating a list whose start is in the future marks+ * it `scheduled`.+ */+ starts_at?: string | null+ ends_at?: string | null+ /** `all`: every rule must match. `any`: one matching rule is enough. */+ match_policy?: 'all' | 'any'+ /** Signed: negative discounts off base prices, positive marks up. */+ price_adjustment_percentage?: string | null+ adjust_compare_at?: boolean+ /**+ * The complete rule set: rules are matched by `id` and updated, new ones are built, and rules+ * left out are removed.+ */+ rules?: PriceListRuleParams[]+ /**+ * Quantity bands on the list's percentage. The payload is the whole ladder: a band left out is+ * removed.+ */+ price_adjustment_tiers?: PriceAdjustmentTierParams[]+ /**+ * Per-variant price overrides. Each row upserts, so the variants it names become part of the+ * list. Curating whole products goes through the nested products endpoint instead.+ */+ prices?: PriceListPriceOverrideParams[]+}diff --git a/packages/admin-sdk/src/types/params/PriceListPriceOverrideParams.ts b/packages/admin-sdk/src/types/params/PriceListPriceOverrideParams.tsnew file mode 100644index 0000000000..807d29be40--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceListPriceOverrideParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceListPriceOverrideParams = {+ /**+ * Updates this price row. Without it, the row upserts on `(variant_id, currency, min_quantity)`.+ */+ id?: string+ variant_id?: string+ currency?: string+ /** The rung of the variant's ladder. Omit for the bottom rung. */+ min_quantity?: number+ amount?: string | null+ compare_at_amount?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PriceListRuleParams.ts b/packages/admin-sdk/src/types/params/PriceListRuleParams.tsnew file mode 100644index 0000000000..da3116f7b3--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceListRuleParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceListRuleParams = {+ /** Present for existing rules. Omit to create a new one. */+ id?: string | null+ /** Wire shorthand for the rule kind, from the price rule types endpoint. */+ type: string+ /** The rule kind's settings, keyed by preference name. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PriceListUpdateParams.ts b/packages/admin-sdk/src/types/params/PriceListUpdateParams.tsnew file mode 100644index 0000000000..fd6c13402c--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceListUpdateParams.ts@@ -0,0 +1,37 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceAdjustmentTierParams } from './PriceAdjustmentTierParams'+import type { PriceListPriceOverrideParams } from './PriceListPriceOverrideParams'+import type { PriceListRuleParams } from './PriceListRuleParams'++export type PriceListUpdateParams = {+ name?: string+ description?: string | null+ position?: number+ /**+ * Pair with `ends_at` to schedule the list: activating a list whose start is in the future marks+ * it `scheduled`.+ */+ starts_at?: string | null+ ends_at?: string | null+ /** `all`: every rule must match. `any`: one matching rule is enough. */+ match_policy?: 'all' | 'any'+ /** Signed: negative discounts off base prices, positive marks up. */+ price_adjustment_percentage?: string | null+ adjust_compare_at?: boolean+ /**+ * The complete rule set: rules are matched by `id` and updated, new ones are built, and rules+ * left out are removed.+ */+ rules?: PriceListRuleParams[]+ /**+ * Quantity bands on the list's percentage. The payload is the whole ladder: a band left out is+ * removed.+ */+ price_adjustment_tiers?: PriceAdjustmentTierParams[]+ /**+ * Per-variant price overrides. Each row upserts, so the variants it names become part of the+ * list. Curating whole products goes through the nested products endpoint instead.+ */+ prices?: PriceListPriceOverrideParams[]+}diff --git a/packages/admin-sdk/src/types/params/PriceParams.ts b/packages/admin-sdk/src/types/params/PriceParams.tsnew file mode 100644index 0000000000..237f235d67--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceParams = {+ currency: string+ /**+ * A canonical decimal string (`"1234.56"`: period decimal, no grouping). The API does not parse+ * localized input.+ */+ amount: string+ compare_at_amount?: string | null+}diff --git a/packages/admin-sdk/src/types/params/PriceUpdateParams.ts b/packages/admin-sdk/src/types/params/PriceUpdateParams.tsnew file mode 100644index 0000000000..efb1e61d37--- /dev/null+++ b/packages/admin-sdk/src/types/params/PriceUpdateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PriceUpdateParams = {+ variant_id?: string+ currency?: string+ /**+ * The quantity a line must reach for this price to apply. Omit for the bottom rung of the ladder.+ * Anything above 1 requires a `price_list_id`.+ */+ min_quantity?: number+ amount?: string | null+ compare_at_amount?: string | null+ /** Omit or null for a base price; a price list for a list override. */+ price_list_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/ProductBulkCategoriesParams.ts b/packages/admin-sdk/src/types/params/ProductBulkCategoriesParams.tsnew file mode 100644index 0000000000..2d56cd6d56--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductBulkCategoriesParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkCategoriesParams = {+ ids: string[]+ category_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductBulkChannelsParams.ts b/packages/admin-sdk/src/types/params/ProductBulkChannelsParams.tsnew file mode 100644index 0000000000..ed8cc91263--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductBulkChannelsParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkChannelsParams = {+ ids: string[]+ channel_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductBulkCollectionsParams.ts b/packages/admin-sdk/src/types/params/ProductBulkCollectionsParams.tsnew file mode 100644index 0000000000..288d1bc5ba--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductBulkCollectionsParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkCollectionsParams = {+ ids: string[]+ collection_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductBulkDestroyParams.ts b/packages/admin-sdk/src/types/params/ProductBulkDestroyParams.tsnew file mode 100644index 0000000000..e006ec122f--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductBulkDestroyParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkDestroyParams = {+ /** Products the caller cannot delete are skipped. */+ ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductBulkStatusParams.ts b/packages/admin-sdk/src/types/params/ProductBulkStatusParams.tsnew file mode 100644index 0000000000..5a56b7d9a6--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductBulkStatusParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkStatusParams = {+ ids: string[]+ /** Products in review are skipped and counted in `skipped_in_review_count`. */+ status: 'draft' | 'active' | 'archived'+}diff --git a/packages/admin-sdk/src/types/params/ProductCreateParams.ts b/packages/admin-sdk/src/types/params/ProductCreateParams.tsnew file mode 100644index 0000000000..38e5be98fd--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductCreateParams.ts@@ -0,0 +1,74 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'+import type { PriceParams } from './PriceParams'+import type { ProductDigitalAssetParams } from './ProductDigitalAssetParams'+import type { ProductMediaParams } from './ProductMediaParams'+import type { ProductPublicationParams } from './ProductPublicationParams'+import type { ProductVariantParams } from './ProductVariantParams'++export type ProductCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name: string+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ slug?: string+ status?: 'draft' | 'active' | 'archived'+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ tax_category_id?: string+ /**+ * The product type this product is created from (`pt_...`). Its option types and categories seed+ * onto the product and its custom field definitions drive the product form. Editing the type+ * later never rewrites existing products.+ */+ product_type_id?: string | null+ /**+ * The delivery profile deciding how this product ships (`fp_...`); null falls back to the store+ * default.+ */+ delivery_profile_id?: string | null+ promotionable?: boolean+ tags?: string[]+ category_ids?: string[]+ /**+ * Manual collections this product belongs to. Automatic collections are kept as they are, since+ * their rules decide membership.+ */+ collection_ids?: string[]+ metadata?: Record<string, unknown>+ /**+ * 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. Don't+ * pass both.+ */+ prices?: PriceParams[]+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+ /**+ * Media written with the product. Entries with `id` update an existing asset; entries with+ * `signed_id` attach a fresh upload; an external video needs only its URL.+ */+ media?: ProductMediaParams[]+ /**+ * Downloadable files written with the product. Each entry carries a `signed_id` (an upload to+ * private storage) or a `provider_type` (a provider-backed asset), and attaches to the default+ * variant unless `variant_id` is given. An `id` updates that asset in place, so replaying the+ * list does not duplicate it; removal uses the nested digital assets endpoint.+ */+ digital_assets?: ProductDigitalAssetParams[]+ product_publications?: ProductPublicationParams[]+ /**+ * Every purchasable attribute (sku, prices, stock, weight, dimensions) lives on variants. An+ * entry without `options` upserts onto the default variant of a simple product; pass `id` to+ * update an existing variant.+ */+ variants?: ProductVariantParams[]+}diff --git a/packages/admin-sdk/src/types/params/ProductDigitalAssetParams.ts b/packages/admin-sdk/src/types/params/ProductDigitalAssetParams.tsnew file mode 100644index 0000000000..d523489a95--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductDigitalAssetParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductDigitalAssetParams = {+ id?: string+ signed_id?: string+ variant_id?: string+ /** A provider shorthand from the digital asset providers endpoint. */+ provider_type?: string+ /** Values for the provider's settings schema, keyed by field name. */+ provider_settings?: Record<string, unknown>+ /** Null means the store's download settings apply. */+ authorized_clicks?: number | null+ /** Null means the store's download settings apply. */+ authorized_days?: number | null+}diff --git a/packages/admin-sdk/src/types/params/ProductMediaParams.ts b/packages/admin-sdk/src/types/params/ProductMediaParams.tsnew file mode 100644index 0000000000..691a5c7c4f--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductMediaParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductMediaParams = {+ id?: string+ /** A `signed_id` from `files.upload()`. */+ signed_id?: string+ /** Copies an asset from the media library. */+ source_media_id?: string+ alt?: string | null+ position?: number+ media_type?: 'image' | 'video' | 'external_video'+ external_video_url?: string | null+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /** Replaces the variants this media is linked to. An empty list clears them. */+ variant_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductMembershipParams.ts b/packages/admin-sdk/src/types/params/ProductMembershipParams.tsnew file mode 100644index 0000000000..c49bf80372--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductMembershipParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductMembershipParams = {+ /** Products from other stores, or ones the caller cannot see, are ignored. */+ product_ids: string[]+}diff --git a/packages/admin-sdk/src/types/params/ProductMembershipRepositionParams.ts b/packages/admin-sdk/src/types/params/ProductMembershipRepositionParams.tsnew file mode 100644index 0000000000..925e1521e4--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductMembershipRepositionParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductMembershipRepositionParams = {+ /** 0-based index among the parent's products. */+ new_position: number+}diff --git a/packages/admin-sdk/src/types/params/ProductPublicationParams.ts b/packages/admin-sdk/src/types/params/ProductPublicationParams.tsnew file mode 100644index 0000000000..9f76b86106--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductPublicationParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductPublicationParams = {+ id?: string+ channel_id?: string+ published_at?: string | null+ unpublished_at?: string | null+}diff --git a/packages/admin-sdk/src/types/params/ProductRejectParams.ts b/packages/admin-sdk/src/types/params/ProductRejectParams.tsnew file mode 100644index 0000000000..33317696f9--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductRejectParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductRejectParams = {+ /** Why the submission was turned down. Sent back to the seller. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/ProductTypeCreateParams.ts b/packages/admin-sdk/src/types/params/ProductTypeCreateParams.tsnew file mode 100644index 0000000000..27c9eaa7ed--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductTypeCreateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { ProductTypeCustomFieldDefinitionParams } from './ProductTypeCustomFieldDefinitionParams'++export type ProductTypeCreateParams = {+ name: string+ /**+ * Delivery profile stamped onto products created with this type. Null leaves new products on the+ * store default profile.+ */+ delivery_profile_id?: string | null+ /**+ * Option types seeded onto products that get this type. Use apply to products to backfill+ * existing ones.+ */+ option_type_ids?: string[]+ /**+ * Categories seeded onto products that get this type. Categories from other stores are ignored.+ */+ category_ids?: string[]+ /**+ * The custom field definitions the product form shows. Definitions not listed are removed from+ * the type.+ */+ custom_field_definitions?: ProductTypeCustomFieldDefinitionParams[]+}diff --git a/packages/admin-sdk/src/types/params/ProductTypeCustomFieldDefinitionParams.ts b/packages/admin-sdk/src/types/params/ProductTypeCustomFieldDefinitionParams.tsnew file mode 100644index 0000000000..d84840103e--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductTypeCustomFieldDefinitionParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductTypeCustomFieldDefinitionParams = {+ /** The custom field definition. */+ id: string+ required?: boolean+ sort_order?: number+}diff --git a/packages/admin-sdk/src/types/params/ProductTypeUpdateParams.ts b/packages/admin-sdk/src/types/params/ProductTypeUpdateParams.tsnew file mode 100644index 0000000000..b250860707--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductTypeUpdateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { ProductTypeCustomFieldDefinitionParams } from './ProductTypeCustomFieldDefinitionParams'++export type ProductTypeUpdateParams = {+ name?: string+ /**+ * Delivery profile stamped onto products created with this type. Null leaves new products on the+ * store default profile.+ */+ delivery_profile_id?: string | null+ /**+ * Option types seeded onto products that get this type. Use apply to products to backfill+ * existing ones.+ */+ option_type_ids?: string[]+ /**+ * Categories seeded onto products that get this type. Categories from other stores are ignored.+ */+ category_ids?: string[]+ /**+ * The custom field definitions the product form shows. Definitions not listed are removed from+ * the type.+ */+ custom_field_definitions?: ProductTypeCustomFieldDefinitionParams[]+}diff --git a/packages/admin-sdk/src/types/params/ProductUpdateParams.ts b/packages/admin-sdk/src/types/params/ProductUpdateParams.tsnew file mode 100644index 0000000000..643243f439--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductUpdateParams.ts@@ -0,0 +1,74 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'+import type { PriceParams } from './PriceParams'+import type { ProductDigitalAssetParams } from './ProductDigitalAssetParams'+import type { ProductMediaParams } from './ProductMediaParams'+import type { ProductPublicationParams } from './ProductPublicationParams'+import type { ProductVariantParams } from './ProductVariantParams'++export type ProductUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name?: string+ /** Rich text HTML. Reads come back as this (plain text) plus `description_html`. */+ description?: string+ slug?: string+ status?: 'draft' | 'active' | 'archived'+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ tax_category_id?: string+ /**+ * The product type this product is created from (`pt_...`). Its option types and categories seed+ * onto the product and its custom field definitions drive the product form. Editing the type+ * later never rewrites existing products.+ */+ product_type_id?: string | null+ /**+ * The delivery profile deciding how this product ships (`fp_...`); null falls back to the store+ * default.+ */+ delivery_profile_id?: string | null+ promotionable?: boolean+ tags?: string[]+ category_ids?: string[]+ /**+ * Manual collections this product belongs to. Automatic collections are kept as they are, since+ * their rules decide membership.+ */+ collection_ids?: string[]+ metadata?: Record<string, unknown>+ /**+ * 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. Don't+ * pass both.+ */+ prices?: PriceParams[]+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+ /**+ * Media written with the product. Entries with `id` update an existing asset; entries with+ * `signed_id` attach a fresh upload; an external video needs only its URL.+ */+ media?: ProductMediaParams[]+ /**+ * Downloadable files written with the product. Each entry carries a `signed_id` (an upload to+ * private storage) or a `provider_type` (a provider-backed asset), and attaches to the default+ * variant unless `variant_id` is given. An `id` updates that asset in place, so replaying the+ * list does not duplicate it; removal uses the nested digital assets endpoint.+ */+ digital_assets?: ProductDigitalAssetParams[]+ product_publications?: ProductPublicationParams[]+ /**+ * Every purchasable attribute (sku, prices, stock, weight, dimensions) lives on variants. An+ * entry without `options` upserts onto the default variant of a simple product; pass `id` to+ * update an existing variant.+ */+ variants?: ProductVariantParams[]+}diff --git a/packages/admin-sdk/src/types/params/ProductVariantParams.ts b/packages/admin-sdk/src/types/params/ProductVariantParams.tsnew file mode 100644index 0000000000..288ece75fb--- /dev/null+++ b/packages/admin-sdk/src/types/params/ProductVariantParams.ts@@ -0,0 +1,66 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceParams } from './PriceParams'+import type { StockLevelParams } from './StockLevelParams'+import type { VariantOptionParams } from './VariantOptionParams'++export type ProductVariantParams = {+ id?: string+ sku?: string+ barcode?: string+ cost_price?: string | null+ cost_currency?: string+ weight?: number | null+ height?: number | null+ width?: number | null+ depth?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz'+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft'+ hs_code?: string+ country_of_origin?: string+ customs_description?: string+ minimum_order_quantity?: number | null+ order_multiple?: number | null+ purchase_unit?: string+ /** How many units fill one carton. */+ units_per_carton?: number | null+ /**+ * The carton this variant is packed into: a package type of kind `carton`. Its dimensions are+ * shared by every product packed the same way, so a corrected carton size fixes all of them at+ * once.+ */+ carton_package_type_id?: string | null+ /** What one packed carton weighs, in the variant's weight unit. */+ carton_weight?: number | null+ /** How many cartons stack on one pallet. */+ cartons_per_pallet?: number | null+ seller_id?: string+ delivery_profile_id?: string | null+ track_inventory?: boolean+ /**+ * Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap+ * comes from `backorder_limit`, an incoming stock count, or backorder.+ */+ preorderable?: boolean+ /**+ * The "ships by" date shown to customers while the variant is a pre-order. Once it passes, the+ * variant is no longer a pre-order. Null clears it.+ */+ preorder_ships_at?: string | null+ /**+ * Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is+ * unlimited.+ */+ backorder_limit?: number | null+ tax_category_id?: string+ position?: number+ /** Per-currency prices. Upserted by currency. */+ prices?: PriceParams[]+ /** Stock per location. Upserted by location; omitted locations are removed. */+ stock_levels?: StockLevelParams[]+ /**+ * One pair per option type the variant takes part in (size, color). Option types and values are+ * created when missing.+ */+ options?: VariantOptionParams[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionActionCalculatorParams.ts b/packages/admin-sdk/src/types/params/PromotionActionCalculatorParams.tsnew file mode 100644index 0000000000..28ad4f9c33--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionActionCalculatorParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PromotionActionCalculatorParams = {+ /**+ * The calculator kind, from `GET /promotion_actions/calculators`. Changing it swaps the+ * calculator.+ */+ type?: string+ /** Values for the calculator's settings, such as `amount` or `flat_percent`. */+ preferences?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/PromotionActionCreateParams.ts b/packages/admin-sdk/src/types/params/PromotionActionCreateParams.tsnew file mode 100644index 0000000000..fa1ad28921--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionActionCreateParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PromotionActionCalculatorParams } from './PromotionActionCalculatorParams'+import type { PromotionActionLineItemParams } from './PromotionActionLineItemParams'++export type PromotionActionCreateParams = {+ /** The action kind, from `GET /promotion_actions/types`. */+ type: string+ /** Values for the action kind's settings schema, from `GET /promotion_actions/types`. */+ preferences?: Record<string, unknown>+ /** For adjustment actions. */+ calculator?: PromotionActionCalculatorParams+ /**+ * For `create_line_items`: the variants to add and their quantities. Variants left out are+ * removed.+ */+ line_items?: PromotionActionLineItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionActionDraftParams.ts b/packages/admin-sdk/src/types/params/PromotionActionDraftParams.tsnew file mode 100644index 0000000000..853440215d--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionActionDraftParams.ts@@ -0,0 +1,19 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PromotionActionCalculatorParams } from './PromotionActionCalculatorParams'+import type { PromotionActionLineItemParams } from './PromotionActionLineItemParams'++export type PromotionActionDraftParams = {+ id?: string+ /** The action kind, from `GET /promotion_actions/types`. */+ type: string+ /** Values for the action kind's settings schema, from `GET /promotion_actions/types`. */+ preferences?: Record<string, unknown>+ /** For adjustment actions. */+ calculator?: PromotionActionCalculatorParams+ /**+ * For `create_line_items`: the variants to add and their quantities. Variants left out are+ * removed.+ */+ line_items?: PromotionActionLineItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionActionLineItemParams.ts b/packages/admin-sdk/src/types/params/PromotionActionLineItemParams.tsnew file mode 100644index 0000000000..f7abf48565--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionActionLineItemParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PromotionActionLineItemParams = {+ variant_id: string+ quantity: number+}diff --git a/packages/admin-sdk/src/types/params/PromotionActionUpdateParams.ts b/packages/admin-sdk/src/types/params/PromotionActionUpdateParams.tsnew file mode 100644index 0000000000..c525b910c9--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionActionUpdateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PromotionActionCalculatorParams } from './PromotionActionCalculatorParams'+import type { PromotionActionLineItemParams } from './PromotionActionLineItemParams'++export type PromotionActionUpdateParams = {+ /** Values for the action kind's settings schema, from `GET /promotion_actions/types`. */+ preferences?: Record<string, unknown>+ /** For adjustment actions. */+ calculator?: PromotionActionCalculatorParams+ /**+ * For `create_line_items`: the variants to add and their quantities. Variants left out are+ * removed.+ */+ line_items?: PromotionActionLineItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionCreateParams.ts b/packages/admin-sdk/src/types/params/PromotionCreateParams.tsnew file mode 100644index 0000000000..d3e15a1fd8--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionCreateParams.ts@@ -0,0 +1,30 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PromotionActionDraftParams } from './PromotionActionDraftParams'+import type { PromotionRuleDraftParams } from './PromotionRuleDraftParams'++export type PromotionCreateParams = {+ name: string+ description?: string | null+ /** Required for single-code coupon promotions. Ignored when `multi_codes` is true. */+ code?: string | null+ path?: string | null+ starts_at?: string | null+ expires_at?: string | null+ usage_limit?: number | null+ match_policy?: 'all' | 'any'+ /** `coupon_code` needs a code (or `multi_codes`); `automatic` applies without one. */+ kind?: 'coupon_code' | 'automatic'+ /** Generates `number_of_codes` codes starting with `code_prefix`. */+ multi_codes?: boolean+ number_of_codes?: number | null+ code_prefix?: string | null+ promotion_category_id?: string | null+ /**+ * The rules the promotion should have: entries with `id` update, entries without are created, and+ * rules left out are removed.+ */+ rules?: PromotionRuleDraftParams[]+ /** The actions the promotion should have, matched the same way as `rules`. */+ actions?: PromotionActionDraftParams[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionRuleCreateParams.ts b/packages/admin-sdk/src/types/params/PromotionRuleCreateParams.tsnew file mode 100644index 0000000000..ae1d810b3e--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionRuleCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PromotionRuleCreateParams = {+ /** The rule kind, from `GET /promotion_rules/types`. */+ type: string+ /** Values for the rule kind's settings schema, from `GET /promotion_rules/types`. */+ preferences?: Record<string, unknown>+ /** For the `product` rule. */+ product_ids?: string[]+ /** For the `category` rule. */+ category_ids?: string[]+ /** For the `user` rule: the customers who qualify. */+ customer_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionRuleDraftParams.ts b/packages/admin-sdk/src/types/params/PromotionRuleDraftParams.tsnew file mode 100644index 0000000000..5e74cf5786--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionRuleDraftParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PromotionRuleDraftParams = {+ id?: string+ /** The rule kind, from `GET /promotion_rules/types`. */+ type: string+ /** Values for the rule kind's settings schema, from `GET /promotion_rules/types`. */+ preferences?: Record<string, unknown>+ /** For the `product` rule. */+ product_ids?: string[]+ /** For the `category` rule. */+ category_ids?: string[]+ /** For the `user` rule: the customers who qualify. */+ customer_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionRuleUpdateParams.ts b/packages/admin-sdk/src/types/params/PromotionRuleUpdateParams.tsnew file mode 100644index 0000000000..b6a44bc7f4--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionRuleUpdateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PromotionRuleUpdateParams = {+ /** Values for the rule kind's settings schema, from `GET /promotion_rules/types`. */+ preferences?: Record<string, unknown>+ /** For the `product` rule. */+ product_ids?: string[]+ /** For the `category` rule. */+ category_ids?: string[]+ /** For the `user` rule: the customers who qualify. */+ customer_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/PromotionUpdateParams.ts b/packages/admin-sdk/src/types/params/PromotionUpdateParams.tsnew file mode 100644index 0000000000..d2c29e55c4--- /dev/null+++ b/packages/admin-sdk/src/types/params/PromotionUpdateParams.ts@@ -0,0 +1,30 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PromotionActionDraftParams } from './PromotionActionDraftParams'+import type { PromotionRuleDraftParams } from './PromotionRuleDraftParams'++export type PromotionUpdateParams = {+ name?: string+ description?: string | null+ /** Required for single-code coupon promotions. Ignored when `multi_codes` is true. */+ code?: string | null+ path?: string | null+ starts_at?: string | null+ expires_at?: string | null+ usage_limit?: number | null+ match_policy?: 'all' | 'any'+ /** `coupon_code` needs a code (or `multi_codes`); `automatic` applies without one. */+ kind?: 'coupon_code' | 'automatic'+ /** Generates `number_of_codes` codes starting with `code_prefix`. */+ multi_codes?: boolean+ number_of_codes?: number | null+ code_prefix?: string | null+ promotion_category_id?: string | null+ /**+ * The rules the promotion should have: entries with `id` update, entries without are created, and+ * rules left out are removed.+ */+ rules?: PromotionRuleDraftParams[]+ /** The actions the promotion should have, matched the same way as `rules`. */+ actions?: PromotionActionDraftParams[]+}diff --git a/packages/admin-sdk/src/types/params/PurchaseOrderCancelParams.ts b/packages/admin-sdk/src/types/params/PurchaseOrderCancelParams.tsnew file mode 100644index 0000000000..7195cef6ec--- /dev/null+++ b/packages/admin-sdk/src/types/params/PurchaseOrderCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PurchaseOrderCancelParams = {+ /** Appended to the order's notes. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/PurchaseOrderCreateParams.ts b/packages/admin-sdk/src/types/params/PurchaseOrderCreateParams.tsnew file mode 100644index 0000000000..1eb0b09855--- /dev/null+++ b/packages/admin-sdk/src/types/params/PurchaseOrderCreateParams.ts@@ -0,0 +1,19 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PurchaseOrderItemParams } from './PurchaseOrderItemParams'++export type PurchaseOrderCreateParams = {+ supplier_id: string+ destination_location_id: string+ /** Defaults to the store's currency; set it for a foreign-currency order. */+ currency?: string | null+ /** The day the supplier promised. `null` clears it. */+ expected_at?: string | null+ /** The day after which the goods are no longer wanted. `null` clears it. */+ cancel_by?: string | null+ /** The supplier's own order number. `null` clears it. */+ reference?: string | null+ notes?: string | null+ /** Sending the list replaces whatever the order currently holds. */+ items?: PurchaseOrderItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/PurchaseOrderItemParams.ts b/packages/admin-sdk/src/types/params/PurchaseOrderItemParams.tsnew file mode 100644index 0000000000..455d65dd4d--- /dev/null+++ b/packages/admin-sdk/src/types/params/PurchaseOrderItemParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PurchaseOrderItemParams = {+ variant_id: string+ quantity_ordered: number+ /** What the merchant agreed to pay per unit. */+ unit_cost?: string+}diff --git a/packages/admin-sdk/src/types/params/PurchaseOrderUpdateParams.ts b/packages/admin-sdk/src/types/params/PurchaseOrderUpdateParams.tsnew file mode 100644index 0000000000..3485aa8d2e--- /dev/null+++ b/packages/admin-sdk/src/types/params/PurchaseOrderUpdateParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PurchaseOrderItemParams } from './PurchaseOrderItemParams'++export type PurchaseOrderUpdateParams = {+ supplier_id?: string+ destination_location_id?: string+ /** Defaults to the store's currency; set it for a foreign-currency order. */+ currency?: string | null+ /** The day the supplier promised. `null` clears it. */+ expected_at?: string | null+ /** The day after which the goods are no longer wanted. `null` clears it. */+ cancel_by?: string | null+ /** The supplier's own order number. `null` clears it. */+ reference?: string | null+ notes?: string | null+ /** Sending the list replaces whatever the order currently holds. */+ items?: PurchaseOrderItemParams[]+ metadata?: Record<string, unknown> | null+}diff --git a/packages/admin-sdk/src/types/params/ReasonCreateParams.ts b/packages/admin-sdk/src/types/params/ReasonCreateParams.tsnew file mode 100644index 0000000000..de366a9452--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReasonCreateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReasonCreateParams = {+ name: string+ /** Whether the reason is offered on new records. */+ active?: boolean+}diff --git a/packages/admin-sdk/src/types/params/ReasonUpdateParams.ts b/packages/admin-sdk/src/types/params/ReasonUpdateParams.tsnew file mode 100644index 0000000000..2cb85c60c9--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReasonUpdateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReasonUpdateParams = {+ name?: string+ /** Whether the reason is offered on new records. */+ active?: boolean+}diff --git a/packages/admin-sdk/src/types/params/ReceivableCloseParams.ts b/packages/admin-sdk/src/types/params/ReceivableCloseParams.tsnew file mode 100644index 0000000000..8faeeb4067--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReceivableCloseParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReceivableCloseParams = {+ /** Why the balance is not coming. */+ reason?: string | null+}diff --git a/packages/admin-sdk/src/types/params/RefundCreateParams.ts b/packages/admin-sdk/src/types/params/RefundCreateParams.tsnew file mode 100644index 0000000000..97abf9c7b8--- /dev/null+++ b/packages/admin-sdk/src/types/params/RefundCreateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RefundCreateParams = {+ payment_id: string+ amount: string+ /** Defaults to the store's first refund reason. */+ refund_reason_id?: string+}diff --git a/packages/admin-sdk/src/types/params/ReportingQueryParams.ts b/packages/admin-sdk/src/types/params/ReportingQueryParams.tsnew file mode 100644index 0000000000..1f567461b7--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReportingQueryParams.ts@@ -0,0 +1,45 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReportingQueryParams = {+ /** Registered metric names, from the reporting schema endpoint. */+ metrics: string[]+ /**+ * Up to 2 dimensions to break the metrics down by. Each is a dimension name, or+ * `{ name, grain, include_empty }`: `grain` (`hour`, `day`, `week`, `month`) buckets a time+ * dimension, and `include_empty` lists members with no matching rows where the schema entry+ * supports it.+ */+ dimensions?: unknown[]+ /** Narrows the rows by dimension value. */+ filters?: {+ dimension: string+ op: 'eq' | 'in'+ /** One value for `eq`, a list for `in`. */+ value: unknown+ }[]+ /**+ * Filters on an aggregate, such as `units_sold = 0`. Narrows the rows only; the totals stay the+ * period's real figure. The metric must also appear in `metrics`, and cannot be a derived one.+ */+ metric_filters?: {+ metric: string+ op: 'eq' | 'gt' | 'gte' | 'lt' | 'lte'+ value: number+ }[]+ /**+ * A named preset (`last_month`, `week_to_date`, any `last_<n>_<days|weeks|months>`), or ISO 8601+ * dates or times in `since` and `until` (a bare date covers the store's whole day). Defaults to+ * the last 30 days, in the store's time zone.+ */+ time_range?: {+ preset?: string+ since?: string+ until?: string+ }+ compare?: 'previous_period' | 'previous_year'+ /** A metric name; prefix it with `-` to sort descending. */+ sort?: string+ /** At most 1000. */+ limit?: number+ currency?: string+}diff --git a/packages/admin-sdk/src/types/params/ReturnCancelParams.ts b/packages/admin-sdk/src/types/params/ReturnCancelParams.tsnew file mode 100644index 0000000000..9ce90b1524--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReturnCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnCancelParams = {+ /** A note on why the return was canceled. */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/ReturnCreateParams.ts b/packages/admin-sdk/src/types/params/ReturnCreateParams.tsnew file mode 100644index 0000000000..a872cbb49b--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReturnCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnCreateParams = {+ /** Fulfilled units coming back, and how many of each. */+ items: {+ fulfillment_item_id: string+ quantity: number+ }[]+ /** Where the goods come back to. Defaults to the location that shipped them. */+ stock_location_id?: string+ /** One of the store's return reasons. */+ reason_id?: string+ memo?: string+}diff --git a/packages/admin-sdk/src/types/params/ReturnReceiveParams.ts b/packages/admin-sdk/src/types/params/ReturnReceiveParams.tsnew file mode 100644index 0000000000..21fd4f6ad9--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReturnReceiveParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnReceiveParams = {+ /**+ * What actually arrived. Omit to receive everything as requested and resellable; send rows for a+ * partial or damaged receipt.+ */+ items?: {+ return_line_item_id: string+ quantity: number+ /** Goods that cannot be resold are received but never restocked. Defaults to true. */+ resellable?: boolean+ }[]+}diff --git a/packages/admin-sdk/src/types/params/ReturnRefundParams.ts b/packages/admin-sdk/src/types/params/ReturnRefundParams.tsnew file mode 100644index 0000000000..293bd0543f--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReturnRefundParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnRefundParams = {+ /** Defaults to the value of what was actually received. */+ amount?: string+ /**+ * `store_credit` issues credit immediately; `original_payment` (the default) refunds through the+ * gateway that took the money.+ */+ refund_method?: 'original_payment' | 'store_credit'+}diff --git a/packages/admin-sdk/src/types/params/ReturnUpdateParams.ts b/packages/admin-sdk/src/types/params/ReturnUpdateParams.tsnew file mode 100644index 0000000000..811676fa23--- /dev/null+++ b/packages/admin-sdk/src/types/params/ReturnUpdateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnUpdateParams = {+ /** Where the goods come back to. Defaults to the location that shipped them. */+ stock_location_id?: string+ /** One of the store's return reasons. */+ reason_id?: string+ memo?: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/RoleCreateParams.ts b/packages/admin-sdk/src/types/params/RoleCreateParams.tsnew file mode 100644index 0000000000..8672fd101e--- /dev/null+++ b/packages/admin-sdk/src/types/params/RoleCreateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RoleCreateParams = {+ /** Unique role name, the machine identifier shown capitalized in the dashboard. */+ name: string+ description?: string | null+ /**+ * Permission keys (`read_orders`, `write_products`, ...) from the permissions endpoint. You can+ * only grant keys you hold yourself.+ */+ permissions?: string[]+}diff --git a/packages/admin-sdk/src/types/params/RoleUpdateParams.ts b/packages/admin-sdk/src/types/params/RoleUpdateParams.tsnew file mode 100644index 0000000000..8a602b97fc--- /dev/null+++ b/packages/admin-sdk/src/types/params/RoleUpdateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RoleUpdateParams = {+ /** Unique role name, the machine identifier shown capitalized in the dashboard. */+ name?: string+ description?: string | null+ /**+ * Permission keys (`read_orders`, `write_products`, ...) from the permissions endpoint. You can+ * only grant keys you hold yourself.+ */+ permissions?: string[]+}diff --git a/packages/admin-sdk/src/types/params/SavedReportCreateParams.ts b/packages/admin-sdk/src/types/params/SavedReportCreateParams.tsnew file mode 100644index 0000000000..81b563026d--- /dev/null+++ b/packages/admin-sdk/src/types/params/SavedReportCreateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SavedReportCreateParams = {+ name: string+ description?: string | null+ /** A reporting query, validated against the reporting registry on save. */+ query: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/SavedReportUpdateParams.ts b/packages/admin-sdk/src/types/params/SavedReportUpdateParams.tsnew file mode 100644index 0000000000..ffad598e68--- /dev/null+++ b/packages/admin-sdk/src/types/params/SavedReportUpdateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SavedReportUpdateParams = {+ name?: string+ description?: string | null+ /** A reporting query, validated against the reporting registry on save. */+ query?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/SellerAddressParams.ts b/packages/admin-sdk/src/types/params/SellerAddressParams.tsnew file mode 100644index 0000000000..49532a833d--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerAddressParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerAddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ country_code?: string+ state_code?: string+ state_name?: string+ label?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerApproveParams.ts b/packages/admin-sdk/src/types/params/SellerApproveParams.tsnew file mode 100644index 0000000000..d96ce25aa5--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerApproveParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerApproveParams = {+ /**+ * Admits a seller whose onboarding checklist is unfinished: the operator's deliberate exception,+ * which the `seller.approved` event records along with what was outstanding.+ */+ override_requirements?: boolean+}diff --git a/packages/admin-sdk/src/types/params/SellerCreateParams.ts b/packages/admin-sdk/src/types/params/SellerCreateParams.tsnew file mode 100644index 0000000000..3fbc189d51--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerCreateParams.ts@@ -0,0 +1,44 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'+import type { SellerAddressParams } from './SellerAddressParams'++export type SellerCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name: string+ /** URL-safe slug, derived from the name when omitted. */+ slug?: string+ contact_email?: string | null+ billing_email?: string | null+ /** Sanitized HTML: the seller's public description. */+ about?: string | null+ /**+ * A `signed_id` from the files upload endpoint to set the image, `null` to remove it, or omit the+ * key to leave it untouched. The same applies to `square_logo_signed_id` and+ * `cover_photo_signed_id`.+ */+ logo_signed_id?: string | null+ square_logo_signed_id?: string | null+ cover_photo_signed_id?: string | null+ tax_remittance?: 'seller' | 'platform'+ payouts_schedule_interval?: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'manual' | null+ minimum_payout_amount?: string | null+ /** Set while the seller is away: the catalog stays but stops selling. */+ holiday_mode_until?: string | null+ legal_name?: string | null+ registration_number?: string | null+ metadata?: Record<string, unknown>+ /**+ * The seller's own billing 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.+ */+ billing_address?: SellerAddressParams+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/SellerInviteParams.ts b/packages/admin-sdk/src/types/params/SellerInviteParams.tsnew file mode 100644index 0000000000..98d44ba711--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerInviteParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerInviteParams = {+ email: string+ /** A role this seller owns; defaults to the seller's own admin role. */+ role_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/SellerPayoutCompleteParams.ts b/packages/admin-sdk/src/types/params/SellerPayoutCompleteParams.tsnew file mode 100644index 0000000000..1396badeea--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerPayoutCompleteParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerPayoutCompleteParams = {+ /** The provider's own id for the settlement, when one made it. */+ reference?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerRejectParams.ts b/packages/admin-sdk/src/types/params/SellerRejectParams.tsnew file mode 100644index 0000000000..d29989904e--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerRejectParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerRejectParams = {+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerReopenOnboardingParams.ts b/packages/admin-sdk/src/types/params/SellerReopenOnboardingParams.tsnew file mode 100644index 0000000000..6986a94e99--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerReopenOnboardingParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerReopenOnboardingParams = {+ /** What the seller has to fix. */+ note?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerRequirementCreateParams.ts b/packages/admin-sdk/src/types/params/SellerRequirementCreateParams.tsnew file mode 100644index 0000000000..a6c379a414--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerRequirementCreateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerRequirementCreateParams = {+ /** The kind, from the seller requirement types endpoint. */+ type: string+ /**+ * 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.+ */+ name?: string+ /** Instructions shown to the seller. */+ description?: string+ /** Place in the checklist. */+ position?: number+ active?: boolean+ /** Whether this blocks approval. Off means recommended. */+ required?: boolean+ /** Configuration for this kind, per its type's `schema`. */+ preferences?: Record<string, unknown>+ metadata?: Record<string, unknown>+ /**+ * Custom field definitions this requirement asks the seller to fill in (`required_custom_fields`+ * kind).+ */+ custom_field_definition_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/SellerRequirementReviewParams.ts b/packages/admin-sdk/src/types/params/SellerRequirementReviewParams.tsnew file mode 100644index 0000000000..6050f0406e--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerRequirementReviewParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerRequirementReviewParams = {+ /** Kept with the decision. On a rejection it is the reason sent back to the seller. */+ review_note?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerRequirementUpdateParams.ts b/packages/admin-sdk/src/types/params/SellerRequirementUpdateParams.tsnew file mode 100644index 0000000000..36ae43bcf9--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerRequirementUpdateParams.ts@@ -0,0 +1,24 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerRequirementUpdateParams = {+ /**+ * 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.+ */+ name?: string+ /** Instructions shown to the seller. */+ description?: string+ /** Place in the checklist. */+ position?: number+ active?: boolean+ /** Whether this blocks approval. Off means recommended. */+ required?: boolean+ /** Configuration for this kind, per its type's `schema`. */+ preferences?: Record<string, unknown>+ metadata?: Record<string, unknown>+ /**+ * Custom field definitions this requirement asks the seller to fill in (`required_custom_fields`+ * kind).+ */+ custom_field_definition_ids?: string[]+}diff --git a/packages/admin-sdk/src/types/params/SellerRequirementWaiveParams.ts b/packages/admin-sdk/src/types/params/SellerRequirementWaiveParams.tsnew file mode 100644index 0000000000..bfe8027c1a--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerRequirementWaiveParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerRequirementWaiveParams = {+ /** The requirement the seller is excused from. */+ requirement_id: string+ /** Why the seller is excused. Kept with the decision. */+ review_note?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerSuspendParams.ts b/packages/admin-sdk/src/types/params/SellerSuspendParams.tsnew file mode 100644index 0000000000..8be25a8396--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerSuspendParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerSuspendParams = {+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/SellerUpdateParams.ts b/packages/admin-sdk/src/types/params/SellerUpdateParams.tsnew file mode 100644index 0000000000..b288e5a78c--- /dev/null+++ b/packages/admin-sdk/src/types/params/SellerUpdateParams.ts@@ -0,0 +1,44 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'+import type { SellerAddressParams } from './SellerAddressParams'++export type SellerUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name?: string+ /** URL-safe slug, derived from the name when omitted. */+ slug?: string+ contact_email?: string | null+ billing_email?: string | null+ /** Sanitized HTML: the seller's public description. */+ about?: string | null+ /**+ * A `signed_id` from the files upload endpoint to set the image, `null` to remove it, or omit the+ * key to leave it untouched. The same applies to `square_logo_signed_id` and+ * `cover_photo_signed_id`.+ */+ logo_signed_id?: string | null+ square_logo_signed_id?: string | null+ cover_photo_signed_id?: string | null+ tax_remittance?: 'seller' | 'platform'+ payouts_schedule_interval?: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'manual' | null+ minimum_payout_amount?: string | null+ /** Set while the seller is away: the catalog stays but stops selling. */+ holiday_mode_until?: string | null+ legal_name?: string | null+ registration_number?: string | null+ metadata?: Record<string, unknown>+ /**+ * The seller's own billing 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.+ */+ billing_address?: SellerAddressParams+ /** Custom field values, each validated against its definition. */+ custom_fields?: CustomFieldValueParams[]+}diff --git a/packages/admin-sdk/src/types/params/SetupParams.ts b/packages/admin-sdk/src/types/params/SetupParams.tsnew file mode 100644index 0000000000..eceb3b5c63--- /dev/null+++ b/packages/admin-sdk/src/types/params/SetupParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SetupParams = {+ /** The one-time token from the install output. */+ setup_token: string+ email: string+ password: string+ password_confirmation?: string+ first_name?: string+ last_name?: string+ store_name?: string+ /**+ * ISO 3166-1 alpha-2 country the store sells from. It determines the default market, the+ * warehouse, the delivery zones and the currency.+ */+ country_code: string+ /** Storefront locale. Defaults to the country's own language. */+ locale?: string+ /**+ * ISO 4217 currency. Defaults to the country's own currency: pass one only when the store prices+ * in something else.+ */+ currency?: string+ /**+ * Load the demo catalog, customers and orders in the background once the admin account exists.+ * The load takes minutes, so the response does not wait for it.+ */+ sample_data?: boolean+}diff --git a/packages/admin-sdk/src/types/params/ShippingLabelCreateParams.ts b/packages/admin-sdk/src/types/params/ShippingLabelCreateParams.tsnew file mode 100644index 0000000000..e0e6a28e98--- /dev/null+++ b/packages/admin-sdk/src/types/params/ShippingLabelCreateParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ShippingLabelCreateParams = {+ /**+ * A `signed_id` from `files.upload()`. Its presence records a label bought elsewhere instead of+ * buying one; without it the body is ignored and the label is bought through the carrier.+ */+ file_signed_id?: string+ /** The number printed on an uploaded label. Required with `file_signed_id`. */+ tracking_number?: string+ /**+ * Free text; a forwarder's name is as valid as a carrier slug. Detected from the number when+ * omitted.+ */+ carrier?: string+ /** Carrier service the label was bought at. */+ service?: string+ /**+ * What the merchant paid the carrier. Accounting data only; it never touches the order's shipping+ * charge.+ */+ cost?: string+ /** Currency of the cost. */+ currency?: string+ /** Taken from the file when omitted. */+ file_format?: 'pdf' | 'png' | 'zpl'+ /** Tracking page for the consignment the label mints. */+ tracking_url?: string+}diff --git a/packages/admin-sdk/src/types/params/StockLevelBulkUpsertParams.ts b/packages/admin-sdk/src/types/params/StockLevelBulkUpsertParams.tsnew file mode 100644index 0000000000..440e1f849e--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLevelBulkUpsertParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { StockLevelBulkUpsertRowParams } from './StockLevelBulkUpsertRowParams'++export type StockLevelBulkUpsertParams = {+ /** Send an empty list to change nothing. */+ stock_levels: StockLevelBulkUpsertRowParams[]+}diff --git a/packages/admin-sdk/src/types/params/StockLevelBulkUpsertRowParams.ts b/packages/admin-sdk/src/types/params/StockLevelBulkUpsertRowParams.tsnew file mode 100644index 0000000000..bb1cc5f596--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLevelBulkUpsertRowParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLevelBulkUpsertRowParams = {+ variant_id: string+ stock_location_id: string+ /** The absolute level the external system reports. */+ count_on_hand?: number | null+ /**+ * A relative change, for feeds that report movements rather than levels. Each row needs+ * `count_on_hand` or `adjustment`.+ */+ adjustment?: number | null+ backorderable?: boolean | null+}diff --git a/packages/admin-sdk/src/types/params/StockLevelParams.ts b/packages/admin-sdk/src/types/params/StockLevelParams.tsnew file mode 100644index 0000000000..0f83b5e39c--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLevelParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLevelParams = {+ id?: string+ /** The location holding the stock (`sloc_...`). */+ stock_location_id: string+ /**+ * Units physically at the location, not units available to sell: stock promised to placed orders+ * counts until it ships. Sent as the count the shelf should end at; the API records the+ * difference as an adjustment in the stock history.+ */+ count_on_hand: number+ /** Whether this location sells the variant beyond what it holds. */+ backorderable?: boolean+}diff --git a/packages/admin-sdk/src/types/params/StockLevelUpdateParams.ts b/packages/admin-sdk/src/types/params/StockLevelUpdateParams.tsnew file mode 100644index 0000000000..8597035069--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLevelUpdateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLevelUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ /**+ * The count the shelf should end at: a whole number of zero or more. The API records the+ * difference as an `adjusted` movement, so the correction appears in the stock history.+ */+ count_on_hand?: number+ /**+ * A signed change to the shelf instead of a target count, applied to the count the API holds at+ * that moment and recorded the same way. Cannot be sent together with `count_on_hand`.+ */+ adjustment?: number+ /** Whether this location sells the variant beyond what it holds. */+ backorderable?: boolean+ /** Labels the correction in the stock history. Defaults to "Manual adjustment". */+ reason?: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/StockLocationCreateParams.ts b/packages/admin-sdk/src/types/params/StockLocationCreateParams.tsnew file mode 100644index 0000000000..b69a5a408c--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLocationCreateParams.ts@@ -0,0 +1,46 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLocationCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name: string+ /** Internal name shown only in the admin. */+ admin_name?: string | null+ active?: boolean+ /** Setting to true demotes the previous default. */+ default?: boolean+ /**+ * Categorizes the location. Built-in values: `warehouse`, `store`, `fulfillment_center`;+ * extensions may add their own.+ */+ kind?: string+ propagate_all_variants?: boolean+ backorderable_default?: boolean+ address1?: string | null+ address2?: string | null+ city?: string | null+ zipcode?: string | null+ phone?: string | null+ company?: string | null+ /** ISO-3166 alpha-2 country code. */+ country_code?: string | null+ /** State or province abbreviation, resolved against the selected country's states. */+ state_code?: string | null+ /** Free-text state for countries that don't have a states list. */+ state_name?: string | null+ pickup_enabled?: boolean+ /**+ * `local` collects only items at this location; `any` lets items transfer in from other locations+ * (ship-to-store).+ */+ pickup_stock_policy?: 'local' | 'any'+ pickup_ready_in_minutes?: number | null+ /** Whether customers may send returns to this location. */+ returns_enabled?: boolean+ pickup_instructions?: string | null+}diff --git a/packages/admin-sdk/src/types/params/StockLocationUpdateParams.ts b/packages/admin-sdk/src/types/params/StockLocationUpdateParams.tsnew file mode 100644index 0000000000..32479f8277--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockLocationUpdateParams.ts@@ -0,0 +1,46 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLocationUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ name?: string+ /** Internal name shown only in the admin. */+ admin_name?: string | null+ active?: boolean+ /** Setting to true demotes the previous default. */+ default?: boolean+ /**+ * Categorizes the location. Built-in values: `warehouse`, `store`, `fulfillment_center`;+ * extensions may add their own.+ */+ kind?: string+ propagate_all_variants?: boolean+ backorderable_default?: boolean+ address1?: string | null+ address2?: string | null+ city?: string | null+ zipcode?: string | null+ phone?: string | null+ company?: string | null+ /** ISO-3166 alpha-2 country code. */+ country_code?: string | null+ /** State or province abbreviation, resolved against the selected country's states. */+ state_code?: string | null+ /** Free-text state for countries that don't have a states list. */+ state_name?: string | null+ pickup_enabled?: boolean+ /**+ * `local` collects only items at this location; `any` lets items transfer in from other locations+ * (ship-to-store).+ */+ pickup_stock_policy?: 'local' | 'any'+ pickup_ready_in_minutes?: number | null+ /** Whether customers may send returns to this location. */+ returns_enabled?: boolean+ pickup_instructions?: string | null+}diff --git a/packages/admin-sdk/src/types/params/StockReceiptCreateParams.ts b/packages/admin-sdk/src/types/params/StockReceiptCreateParams.tsnew file mode 100644index 0000000000..1ce7e5c01b--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockReceiptCreateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { StockReceiptItemParams } from './StockReceiptItemParams'++export type StockReceiptCreateParams = {+ /** The supplier's delivery note, or the carrier's reference. */+ reference?: string | null+ /** When the goods were counted in. Defaults to now. */+ received_at?: string | null+ notes?: string | null+ /**+ * Omit to book in everything still outstanding, intact. Naming lines, even none, records exactly+ * what the dock counted: `quantity_accepted` reaches the shelf; `quantity_rejected` is refused,+ * recorded with a `rejection_reason` and never stocked.+ */+ items?: StockReceiptItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/StockReceiptItemParams.ts b/packages/admin-sdk/src/types/params/StockReceiptItemParams.tsnew file mode 100644index 0000000000..f23398503a--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockReceiptItemParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockReceiptItemParams = {+ /** The purchase order or transfer line. */+ id: string+ quantity_accepted?: number+ quantity_rejected?: number+ rejection_reason?: 'damaged' | 'wrong_item' | 'expired' | 'other' | null+ notes?: string | null+}diff --git a/packages/admin-sdk/src/types/params/StockTransferCancelParams.ts b/packages/admin-sdk/src/types/params/StockTransferCancelParams.tsnew file mode 100644index 0000000000..2572f6fdc6--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockTransferCancelParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockTransferCancelParams = {+ /**+ * Required once the units have left the source: either they come back (`restock`) or they are+ * written off as lost (`write_off`).+ */+ on_in_transit?: 'restock' | 'write_off'+ /** Recorded against the written-off lines. */+ reason?: string | null+}diff --git a/packages/admin-sdk/src/types/params/StockTransferCreateParams.ts b/packages/admin-sdk/src/types/params/StockTransferCreateParams.tsnew file mode 100644index 0000000000..340108dc44--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockTransferCreateParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { StockTransferItemParams } from './StockTransferItemParams'++export type StockTransferCreateParams = {+ source_location_id: string+ destination_location_id: string+ /** The merchant's own label for the trip. `null` clears it. */+ reference?: string | null+ notes?: string | null+ /**+ * A draft may open empty and gain lines as the merchant packs. Sending the list replaces whatever+ * the draft currently holds.+ */+ items?: StockTransferItemParams[]+}diff --git a/packages/admin-sdk/src/types/params/StockTransferItemParams.ts b/packages/admin-sdk/src/types/params/StockTransferItemParams.tsnew file mode 100644index 0000000000..b8cea81191--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockTransferItemParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockTransferItemParams = {+ variant_id: string+ quantity_shipped: number+}diff --git a/packages/admin-sdk/src/types/params/StockTransferMarkInTransitParams.ts b/packages/admin-sdk/src/types/params/StockTransferMarkInTransitParams.tsnew file mode 100644index 0000000000..5ded6f4067--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockTransferMarkInTransitParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockTransferMarkInTransitParams = {+ /** Ship even if it drives the source below zero. */+ force?: boolean+}diff --git a/packages/admin-sdk/src/types/params/StockTransferUpdateParams.ts b/packages/admin-sdk/src/types/params/StockTransferUpdateParams.tsnew file mode 100644index 0000000000..dd08ab0d08--- /dev/null+++ b/packages/admin-sdk/src/types/params/StockTransferUpdateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { StockTransferItemParams } from './StockTransferItemParams'++export type StockTransferUpdateParams = {+ source_location_id?: string+ destination_location_id?: string+ /** The merchant's own label for the trip. `null` clears it. */+ reference?: string | null+ notes?: string | null+ /**+ * A draft may open empty and gain lines as the merchant packs. Sending the list replaces whatever+ * the draft currently holds.+ */+ items?: StockTransferItemParams[]+ metadata?: Record<string, unknown> | null+}diff --git a/packages/admin-sdk/src/types/params/StoreCreditApplyParams.ts b/packages/admin-sdk/src/types/params/StoreCreditApplyParams.tsnew file mode 100644index 0000000000..e83afd14f7--- /dev/null+++ b/packages/admin-sdk/src/types/params/StoreCreditApplyParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StoreCreditApplyParams = {+ /** Defaults to the customer's available store credit, up to the order total. */+ amount?: string+}diff --git a/packages/admin-sdk/src/types/params/StoreUpdateParams.ts b/packages/admin-sdk/src/types/params/StoreUpdateParams.tsnew file mode 100644index 0000000000..e323973583--- /dev/null+++ b/packages/admin-sdk/src/types/params/StoreUpdateParams.ts@@ -0,0 +1,137 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StoreUpdateParams = {+ name?: string+ admin_locale?: string+ timezone?: string+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz'+ unit_system?: 'metric' | 'imperial'+ /**+ * The store-wide default for what anonymous visitors can see. Channels fall back to it when they+ * don't set their own.+ */+ storefront_access?: 'public' | 'prices_hidden' | 'login_required'+ /**+ * The storefront's public URL, the base for links in customer emails. Saving it also completes+ * the storefront setup task.+ */+ storefront_url?: string | null+ /** The store-wide default for guest checkout. Channels fall back to it. */+ guest_checkout?: boolean+ /** Always show a confirmation step in checkout, even when no payment method requires one. */+ always_include_confirm_step?: boolean+ /** Shows a company field on address forms. */+ company_field_enabled?: boolean+ /** Makes a company name mandatory on addresses. */+ address_requires_company?: boolean+ /** Makes a phone number mandatory on customer addresses. */+ address_requires_phone?: boolean+ /**+ * The store-wide default for when a customer is charged rather than only authorized. A payment+ * method's own setting wins when set.+ */+ capture_method?: 'checkout' | 'on_dispatch' | 'manual'+ /** Deprecated: use `capture_method`. Removed in 6.1. */+ preferred_auto_capture?: boolean+ /** Deprecated: use `capture_method`. Removed in 6.1. */+ preferred_auto_capture_on_dispatch?: boolean+ /** Counts on-hand quantities. Off means everything is treated as always available. */+ track_inventory_levels?: boolean+ /** Holds stock for shoppers while they check out, so the same item can't be sold twice. */+ stock_reservations_enabled?: boolean+ /**+ * On-hand units at or below which a tracked variant counts as low stock on the home screen; 0+ * turns the warning off.+ */+ low_stock_threshold?: number+ /**+ * Calculates tax from the shipping address. When false, tax is calculated from the billing+ * address.+ */+ tax_using_ship_address?: boolean+ /** Records price changes for the EU Omnibus lowest-price-in-30-days display. */+ track_price_history?: boolean+ /** Whether products with no price in the shopper's currency still appear in listings. */+ show_products_without_price?: boolean+ /** Lets more than one variant share the same SKU. */+ disable_sku_validation?: boolean+ /** The store-wide order routing strategy shorthand. Channels fall back to it. */+ order_routing_strategy?: string+ /** Where prices come from: a registered provider key, or `internal`. */+ pricing_provider?: string+ /** Where stock levels come from: a registered provider key, or `internal`. */+ inventory_provider?: string+ /** `strict` refuses to price when the provider cannot answer; `fallback` uses the catalog. */+ pricing_provider_failure_policy?: 'fallback' | 'strict'+ /**+ * `fallback` sells on the local stock snapshot when the provider cannot answer; `strict` refuses.+ */+ inventory_provider_failure_policy?: 'fallback' | 'strict'+ /** Blank means the built-in provider: the marketplace settles by hand. */+ payout_provider?: string+ default_payouts_schedule_interval?: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'manual'+ /** In the store's currency. */+ default_minimum_payout_amount?: string+ /** Admits a seller as soon as they finish onboarding, with no operator review. */+ auto_approve_sellers?: boolean+ /** Puts a seller product on sale the moment it is submitted, with no review. */+ auto_approve_seller_products?: boolean+ /** When false, transactional seller emails (approval, payouts and so on) are not sent. */+ send_seller_transactional_emails?: boolean+ /**+ * Tax charged on commission as a fraction (`"0.23"` is 23%), when neither the commission rate nor+ * the tax provider names one.+ */+ default_commission_tax_rate?: string+ /**+ * How document numbers are produced: `sequential` or `random`. Applies to every numbered+ * document.+ */+ document_number_format?: string+ /** Leads every order number. Uppercase letters, digits, dashes and # only. */+ order_number_prefix?: string+ /** Ends every order number. Uppercase letters, digits, dashes and # only. */+ order_number_suffix?: string+ /** The first sequential order number. Only applies before the store's first order. */+ order_number_sequence_start?: number+ /** Whether a digital download link stops working after a number of clicks. */+ limit_digital_download_count?: boolean+ /** How many clicks a download link allows, unless the file sets its own. */+ digital_asset_authorized_clicks?: number+ /** Whether a digital download link expires after a number of days. */+ limit_digital_download_days?: boolean+ /** How many days a download link stays valid, unless the file sets its own. */+ digital_asset_authorized_days?: number+ /** Sender address of every transactional email. */+ mail_from_address?: string+ /** Customer-facing reply-to address shown in the storefront and email footers. */+ customer_support_email?: string | null+ /** Recipient of "new order placed" staff notifications. */+ new_order_notifications_email?: string | null+ /** When false, transactional customer emails (order confirmation and so on) are not sent. */+ send_consumer_transactional_emails?: boolean+ /**+ * Customer email buttons and links, as `#RRGGBB`. Blank keeps the outlined buttons emails ship+ * with.+ */+ email_accent_color?: string | null+ /** Customer email page background, as `#RRGGBB`. */+ email_background_color?: string | null+ /** Customer email card behind the content, as `#RRGGBB`. */+ email_card_color?: string | null+ /** Customer email body text, as `#RRGGBB`. */+ email_text_color?: string | null+ /** Customer email headings and emphasized text, as `#RRGGBB`. */+ email_heading_color?: string | null+ /**+ * Customer email font: `inter`, `system`, `helvetica`, `georgia`, `roboto`, `lato` or+ * `merriweather`.+ */+ email_font?: string | null+ /** A `signed_id` from `files.upload()` for the store logo, or null to remove it. */+ logo_signed_id?: string | null+ /**+ * A `signed_id` from `files.upload()` for the logo in transactional emails, or null to remove it.+ */+ mailer_logo_signed_id?: string | null+}diff --git a/packages/admin-sdk/src/types/params/SupplierCreateParams.ts b/packages/admin-sdk/src/types/params/SupplierCreateParams.tsnew file mode 100644index 0000000000..8f9998dfe3--- /dev/null+++ b/packages/admin-sdk/src/types/params/SupplierCreateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SupplierCreateParams = {+ name: string+ contact_name?: string | null+ email?: string | null+ phone?: string | null+ notes?: string | null+ address1?: string | null+ address2?: string | null+ city?: string | null+ state_name?: string | null+ state_code?: string | null+ country_code?: string | null+ postal_code?: string | null+ metadata?: Record<string, unknown> | null+}diff --git a/packages/admin-sdk/src/types/params/SupplierUpdateParams.ts b/packages/admin-sdk/src/types/params/SupplierUpdateParams.tsnew file mode 100644index 0000000000..05602e5a72--- /dev/null+++ b/packages/admin-sdk/src/types/params/SupplierUpdateParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SupplierUpdateParams = {+ name?: string+ contact_name?: string | null+ email?: string | null+ phone?: string | null+ notes?: string | null+ address1?: string | null+ address2?: string | null+ city?: string | null+ state_name?: string | null+ state_code?: string | null+ country_code?: string | null+ postal_code?: string | null+ metadata?: Record<string, unknown> | null+}diff --git a/packages/admin-sdk/src/types/params/TaxCategoryCreateParams.ts b/packages/admin-sdk/src/types/params/TaxCategoryCreateParams.tsnew file mode 100644index 0000000000..4222fe3517--- /dev/null+++ b/packages/admin-sdk/src/types/params/TaxCategoryCreateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxCategoryCreateParams = {+ name: string+ tax_code?: string | null+ description?: string | null+ is_default?: boolean+}diff --git a/packages/admin-sdk/src/types/params/TaxCategoryUpdateParams.ts b/packages/admin-sdk/src/types/params/TaxCategoryUpdateParams.tsnew file mode 100644index 0000000000..92b051974c--- /dev/null+++ b/packages/admin-sdk/src/types/params/TaxCategoryUpdateParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxCategoryUpdateParams = {+ name?: string+ tax_code?: string | null+ description?: string | null+ is_default?: boolean+}diff --git a/packages/admin-sdk/src/types/params/TaxExemptionCertificateParams.ts b/packages/admin-sdk/src/types/params/TaxExemptionCertificateParams.tsnew file mode 100644index 0000000000..9787145e40--- /dev/null+++ b/packages/admin-sdk/src/types/params/TaxExemptionCertificateParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxExemptionCertificateParams = {+ /** Required when creating. */+ certificate_number?: string+ /** Becomes the tax provider's entity use code. Required when creating. */+ reason_code?: string+ issuing_authority?: string | null+ issued_at?: string | null+ expires_at?: string | null+ /** Where the certificate holds. Omit both for one valid everywhere. */+ country_code?: string | null+ /** Where the certificate holds. Omit both for one valid everywhere. */+ state_code?: string | null+ /** A `signed_id` from `files.upload()` with `visibility: 'private'`. */+ document_signed_id?: string+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/TaxIdentifierParams.ts b/packages/admin-sdk/src/types/params/TaxIdentifierParams.tsnew file mode 100644index 0000000000..094c5d4af0--- /dev/null+++ b/packages/admin-sdk/src/types/params/TaxIdentifierParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxIdentifierParams = {+ /**+ * The registration the number belongs to, such as `eu_vat` or `gb_vat`. Any kind is accepted; one+ * with a registered validator is checked by it. Built-in: `eu_vat`. Extensions may register more.+ * Required when creating.+ */+ kind?: string+ /** Required when creating. */+ value?: string+}diff --git a/packages/admin-sdk/src/types/params/TaxRateParams.ts b/packages/admin-sdk/src/types/params/TaxRateParams.tsnew file mode 100644index 0000000000..c2623b6827--- /dev/null+++ b/packages/admin-sdk/src/types/params/TaxRateParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxRateParams = {+ /** Customer-facing rate name. */+ name?: string+ /** The rate as a fraction. Send this or `rate_percent`. */+ rate?: string+ /** The rate as a percentage. */+ rate_percent?: string+ included_in_price?: boolean+ show_rate_in_label?: boolean+ tax_category_id?: string+ /** ISO country code. A rate naming no country taxes everywhere. */+ country_code?: string | null+ /** State abbreviation within that country. */+ state_code?: string | null+ metadata?: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/TranslationBatchEntryParams.ts b/packages/admin-sdk/src/types/params/TranslationBatchEntryParams.tsnew file mode 100644index 0000000000..f17bcac518--- /dev/null+++ b/packages/admin-sdk/src/types/params/TranslationBatchEntryParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TranslationBatchEntryParams = {+ /** Translatable resource type token, e.g. `option_type`. */+ resource_type: string+ resource_id: string+ /** Translated fields keyed by locale code, then by field name. */+ values: Record<string, unknown>+}diff --git a/packages/admin-sdk/src/types/params/TranslationBatchParams.ts b/packages/admin-sdk/src/types/params/TranslationBatchParams.tsnew file mode 100644index 0000000000..e6dd831ff4--- /dev/null+++ b/packages/admin-sdk/src/types/params/TranslationBatchParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { TranslationBatchEntryParams } from './TranslationBatchEntryParams'++export type TranslationBatchParams = {+ /** At least one entry. All entries are saved, or none are. */+ translations: TranslationBatchEntryParams[]+}diff --git a/packages/admin-sdk/src/types/params/VariantCreateParams.ts b/packages/admin-sdk/src/types/params/VariantCreateParams.tsnew file mode 100644index 0000000000..d547f64421--- /dev/null+++ b/packages/admin-sdk/src/types/params/VariantCreateParams.ts@@ -0,0 +1,72 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceParams } from './PriceParams'+import type { StockLevelParams } from './StockLevelParams'+import type { VariantOptionParams } from './VariantOptionParams'++export type VariantCreateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ sku?: string+ barcode?: string+ cost_price?: string | null+ cost_currency?: string+ weight?: number | null+ height?: number | null+ width?: number | null+ depth?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz'+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft'+ hs_code?: string+ country_of_origin?: string+ customs_description?: string+ minimum_order_quantity?: number | null+ order_multiple?: number | null+ purchase_unit?: string+ /** How many units fill one carton. */+ units_per_carton?: number | null+ /**+ * The carton this variant is packed into: a package type of kind `carton`. Its dimensions are+ * shared by every product packed the same way, so a corrected carton size fixes all of them at+ * once.+ */+ carton_package_type_id?: string | null+ /** What one packed carton weighs, in the variant's weight unit. */+ carton_weight?: number | null+ /** How many cartons stack on one pallet. */+ cartons_per_pallet?: number | null+ seller_id?: string+ delivery_profile_id?: string | null+ track_inventory?: boolean+ /**+ * Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap+ * comes from `backorder_limit`, an incoming stock count, or backorder.+ */+ preorderable?: boolean+ /**+ * The "ships by" date shown to customers while the variant is a pre-order. Once it passes, the+ * variant is no longer a pre-order. Null clears it.+ */+ preorder_ships_at?: string | null+ /**+ * Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is+ * unlimited.+ */+ backorder_limit?: number | null+ tax_category_id?: string+ position?: number+ /** Per-currency prices. Upserted by currency. */+ prices?: PriceParams[]+ /** Stock per location. Upserted by location; omitted locations are removed. */+ stock_levels?: StockLevelParams[]+ /**+ * One pair per option type the variant takes part in (size, color). Option types and values are+ * created when missing. On update, omit to leave the option values untouched.+ */+ options: VariantOptionParams[]+}diff --git a/packages/admin-sdk/src/types/params/VariantOptionParams.ts b/packages/admin-sdk/src/types/params/VariantOptionParams.tsnew file mode 100644index 0000000000..641969b6c1--- /dev/null+++ b/packages/admin-sdk/src/types/params/VariantOptionParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type VariantOptionParams = {+ name: string+ value: string+}diff --git a/packages/admin-sdk/src/types/params/VariantUpdateParams.ts b/packages/admin-sdk/src/types/params/VariantUpdateParams.tsnew file mode 100644index 0000000000..ab39c23541--- /dev/null+++ b/packages/admin-sdk/src/types/params/VariantUpdateParams.ts@@ -0,0 +1,72 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { PriceParams } from './PriceParams'+import type { StockLevelParams } from './StockLevelParams'+import type { VariantOptionParams } from './VariantOptionParams'++export type VariantUpdateParams = {+ /**+ * Identities the record has in external systems, keyed by system: the same+ * `{ system: external_id }` map the Admin API renders, so what you read can be sent straight+ * back. Systems you do not name keep the reference they have. A list of `{ system, external_id }`+ * entries is accepted too.+ */+ external_references?: Record<string, unknown>+ sku?: string+ barcode?: string+ cost_price?: string | null+ cost_currency?: string+ weight?: number | null+ height?: number | null+ width?: number | null+ depth?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz'+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft'+ hs_code?: string+ country_of_origin?: string+ customs_description?: string+ minimum_order_quantity?: number | null+ order_multiple?: number | null+ purchase_unit?: string+ /** How many units fill one carton. */+ units_per_carton?: number | null+ /**+ * The carton this variant is packed into: a package type of kind `carton`. Its dimensions are+ * shared by every product packed the same way, so a corrected carton size fixes all of them at+ * once.+ */+ carton_package_type_id?: string | null+ /** What one packed carton weighs, in the variant's weight unit. */+ carton_weight?: number | null+ /** How many cartons stack on one pallet. */+ cartons_per_pallet?: number | null+ seller_id?: string+ delivery_profile_id?: string | null+ track_inventory?: boolean+ /**+ * Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap+ * comes from `backorder_limit`, an incoming stock count, or backorder.+ */+ preorderable?: boolean+ /**+ * The "ships by" date shown to customers while the variant is a pre-order. Once it passes, the+ * variant is no longer a pre-order. Null clears it.+ */+ preorder_ships_at?: string | null+ /**+ * Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is+ * unlimited.+ */+ backorder_limit?: number | null+ tax_category_id?: string+ position?: number+ /** Per-currency prices. Upserted by currency. */+ prices?: PriceParams[]+ /** Stock per location. Upserted by location; omitted locations are removed. */+ stock_levels?: StockLevelParams[]+ /**+ * One pair per option type the variant takes part in (size, color). Option types and values are+ * created when missing. On update, omit to leave the option values untouched.+ */+ options?: VariantOptionParams[]+}diff --git a/packages/admin-sdk/src/types/params/WebhookEndpointCreateParams.ts b/packages/admin-sdk/src/types/params/WebhookEndpointCreateParams.tsnew file mode 100644index 0000000000..40f33fdd65--- /dev/null+++ b/packages/admin-sdk/src/types/params/WebhookEndpointCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type WebhookEndpointCreateParams = {+ /** A label shown in the dashboard list. */+ name?: string | null+ /** HTTPS destination URL. It cannot resolve to a private IP address outside development. */+ url: string+ /** Defaults to true on create. Prefer the disable and enable endpoints to pause one. */+ active?: boolean+ /**+ * Event names this endpoint receives. An empty list or `["*"]` subscribes to every event;+ * otherwise list exact names (`order.completed`) or patterns (`order.*`).+ */+ subscriptions?: string[]+}diff --git a/packages/admin-sdk/src/types/params/WebhookEndpointDisableParams.ts b/packages/admin-sdk/src/types/params/WebhookEndpointDisableParams.tsnew file mode 100644index 0000000000..9dee8e0ee0--- /dev/null+++ b/packages/admin-sdk/src/types/params/WebhookEndpointDisableParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type WebhookEndpointDisableParams = {+ /** Shown next to the disabled indicator. Defaults to "Manually disabled". */+ reason?: string+}diff --git a/packages/admin-sdk/src/types/params/WebhookEndpointUpdateParams.ts b/packages/admin-sdk/src/types/params/WebhookEndpointUpdateParams.tsnew file mode 100644index 0000000000..021ea018f1--- /dev/null+++ b/packages/admin-sdk/src/types/params/WebhookEndpointUpdateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type WebhookEndpointUpdateParams = {+ /** A label shown in the dashboard list. */+ name?: string | null+ /** HTTPS destination URL. It cannot resolve to a private IP address outside development. */+ url?: string+ /** Defaults to true on create. Prefer the disable and enable endpoints to pause one. */+ active?: boolean+ /**+ * Event names this endpoint receives. An empty list or `["*"]` subscribes to every event;+ * otherwise list exact names (`order.completed`) or patterns (`order.*`).+ */+ subscriptions?: string[]+}diff --git a/packages/admin-sdk/src/types/params/index.ts b/packages/admin-sdk/src/types/params/index.tsnew file mode 100644index 0000000000..0a4c3b520c--- /dev/null+++ b/packages/admin-sdk/src/types/params/index.ts@@ -0,0 +1,223 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type { AddressInputParams } from './AddressInputParams'+export type { AdminUserUpdateParams } from './AdminUserUpdateParams'+export type { AllowedOriginCreateParams } from './AllowedOriginCreateParams'+export type { AllowedOriginUpdateParams } from './AllowedOriginUpdateParams'+export type { ApiKeyCreateParams } from './ApiKeyCreateParams'+export type { ApiKeyUpdateParams } from './ApiKeyUpdateParams'+export type { BulkTagsParams } from './BulkTagsParams'+export type { CatalogAssignParams } from './CatalogAssignParams'+export type { CatalogAssignmentParams } from './CatalogAssignmentParams'+export type { CatalogOrderMinimumParams } from './CatalogOrderMinimumParams'+export type { CatalogParams } from './CatalogParams'+export type { CatalogPriceListParams } from './CatalogPriceListParams'+export type { CatalogProductTermsParams } from './CatalogProductTermsParams'+export type { CategoryCreateParams } from './CategoryCreateParams'+export type { CategoryRepositionParams } from './CategoryRepositionParams'+export type { CategoryUpdateParams } from './CategoryUpdateParams'+export type { ChannelAddProductsParams } from './ChannelAddProductsParams'+export type { ChannelCreateParams } from './ChannelCreateParams'+export type { ChannelRemoveProductsParams } from './ChannelRemoveProductsParams'+export type { ChannelUpdateParams } from './ChannelUpdateParams'+export type { ClaimCancelParams } from './ClaimCancelParams'+export type { ClaimCreateParams } from './ClaimCreateParams'+export type { ClaimDenyParams } from './ClaimDenyParams'+export type { ClaimResolveParams } from './ClaimResolveParams'+export type { ClaimUpdateParams } from './ClaimUpdateParams'+export type { CollectionCreateParams } from './CollectionCreateParams'+export type { CollectionRuleParams } from './CollectionRuleParams'+export type { CollectionUpdateParams } from './CollectionUpdateParams'+export type { CommissionRateCreateParams } from './CommissionRateCreateParams'+export type { CommissionRateUpdateParams } from './CommissionRateUpdateParams'+export type { CommissionRuleDraftParams } from './CommissionRuleDraftParams'+export type { CompanyAddressParams } from './CompanyAddressParams'+export type { CompanyMembershipCreateParams } from './CompanyMembershipCreateParams'+export type { CompanyParams } from './CompanyParams'+export type { CustomFieldCreateParams } from './CustomFieldCreateParams'+export type { CustomFieldDefinitionCreateParams } from './CustomFieldDefinitionCreateParams'+export type { CustomFieldDefinitionUpdateParams } from './CustomFieldDefinitionUpdateParams'+export type { CustomFieldUpdateParams } from './CustomFieldUpdateParams'+export type { CustomFieldValueParams } from './CustomFieldValueParams'+export type { CustomerAddressParams } from './CustomerAddressParams'+export type { CustomerBulkGroupsParams } from './CustomerBulkGroupsParams'+export type { CustomerCreateParams } from './CustomerCreateParams'+export type { CustomerGroupCreateParams } from './CustomerGroupCreateParams'+export type { CustomerGroupUpdateParams } from './CustomerGroupUpdateParams'+export type { CustomerStoreCreditCreateParams } from './CustomerStoreCreditCreateParams'+export type { CustomerStoreCreditUpdateParams } from './CustomerStoreCreditUpdateParams'+export type { CustomerUpdateParams } from './CustomerUpdateParams'+export type { DataRequestCreateParams } from './DataRequestCreateParams'+export type { DeliveryCreateParams } from './DeliveryCreateParams'+export type { DeliveryMarkDeliveredParams } from './DeliveryMarkDeliveredParams'+export type { DeliveryMethodParams } from './DeliveryMethodParams'+export type { DeliveryMethodRuleCreateParams } from './DeliveryMethodRuleCreateParams'+export type { DeliveryMethodRuleUpdateParams } from './DeliveryMethodRuleUpdateParams'+export type { DeliveryMethodServiceParams } from './DeliveryMethodServiceParams'+export type { DeliveryOriginGroupParams } from './DeliveryOriginGroupParams'+export type { DeliveryProfileParams } from './DeliveryProfileParams'+export type { DeliveryUpdateParams } from './DeliveryUpdateParams'+export type { DeliveryZoneMemberParams } from './DeliveryZoneMemberParams'+export type { DeliveryZoneParams } from './DeliveryZoneParams'+export type { DigitalAssetCreateParams } from './DigitalAssetCreateParams'+export type { DigitalAssetUpdateParams } from './DigitalAssetUpdateParams'+export type { DiscountCodeApplyParams } from './DiscountCodeApplyParams'+export type { DiscountCreateParams } from './DiscountCreateParams'+export type { DiscountUpdateParams } from './DiscountUpdateParams'+export type { EmailTemplateDraftParams } from './EmailTemplateDraftParams'+export type { EmailTemplatePreviewParams } from './EmailTemplatePreviewParams'+export type { EmailTemplateRestoreParams } from './EmailTemplateRestoreParams'+export type { EmailTemplateVersionParams } from './EmailTemplateVersionParams'+export type { ExchangeCancelParams } from './ExchangeCancelParams'+export type { ExchangeCreateParams } from './ExchangeCreateParams'+export type { ExchangeFulfillParams } from './ExchangeFulfillParams'+export type { ExchangeReceiveParams } from './ExchangeReceiveParams'+export type { ExchangeUpdateParams } from './ExchangeUpdateParams'+export type { ExportCreateParams } from './ExportCreateParams'+export type { FeeCreateParams } from './FeeCreateParams'+export type { FeeUpdateParams } from './FeeUpdateParams'+export type { FileUploadCreateParams } from './FileUploadCreateParams'+export type { FulfillmentCreateParams } from './FulfillmentCreateParams'+export type { FulfillmentFulfillParams } from './FulfillmentFulfillParams'+export type { FulfillmentMarkDeliveredParams } from './FulfillmentMarkDeliveredParams'+export type { FulfillmentSplitParams } from './FulfillmentSplitParams'+export type { FulfillmentUpdateParams } from './FulfillmentUpdateParams'+export type { GiftCardApplyParams } from './GiftCardApplyParams'+export type { GiftCardBatchCreateParams } from './GiftCardBatchCreateParams'+export type { GiftCardCreateParams } from './GiftCardCreateParams'+export type { GiftCardUpdateParams } from './GiftCardUpdateParams'+export type { ImportCompleteMappingParams } from './ImportCompleteMappingParams'+export type { ImportCreateParams } from './ImportCreateParams'+export type { IntegrationCreateParams } from './IntegrationCreateParams'+export type { IntegrationUpdateParams } from './IntegrationUpdateParams'+export type { InvitationAcceptParams } from './InvitationAcceptParams'+export type { InvitationCreateParams } from './InvitationCreateParams'+export type { LineItemCreateParams } from './LineItemCreateParams'+export type { LineItemUpdateParams } from './LineItemUpdateParams'+export type { MarketCreateParams } from './MarketCreateParams'+export type { MarketUpdateParams } from './MarketUpdateParams'+export type { MeUpdateParams } from './MeUpdateParams'+export type { MediaCreateParams } from './MediaCreateParams'+export type { MediaLibraryCreateParams } from './MediaLibraryCreateParams'+export type { MediaLibraryUpdateParams } from './MediaLibraryUpdateParams'+export type { MediaUpdateParams } from './MediaUpdateParams'+export type { OptionTypeCreateParams } from './OptionTypeCreateParams'+export type { OptionTypeUpdateParams } from './OptionTypeUpdateParams'+export type { OptionValueParams } from './OptionValueParams'+export type { OrderCancelParams } from './OrderCancelParams'+export type { OrderCompleteParams } from './OrderCompleteParams'+export type { OrderCreateParams } from './OrderCreateParams'+export type { OrderRoutingRuleCreateParams } from './OrderRoutingRuleCreateParams'+export type { OrderRoutingRuleUpdateParams } from './OrderRoutingRuleUpdateParams'+export type { OrderUpdateParams } from './OrderUpdateParams'+export type { PackageTypeCreateParams } from './PackageTypeCreateParams'+export type { PackageTypeUpdateParams } from './PackageTypeUpdateParams'+export type { PasswordResetParams } from './PasswordResetParams'+export type { PasswordResetRequestParams } from './PasswordResetRequestParams'+export type { PaymentCaptureParams } from './PaymentCaptureParams'+export type { PaymentCreateParams } from './PaymentCreateParams'+export type { PaymentMethodCreateParams } from './PaymentMethodCreateParams'+export type { PaymentMethodUpdateParams } from './PaymentMethodUpdateParams'+export type { PolicyCreateParams } from './PolicyCreateParams'+export type { PolicyUpdateParams } from './PolicyUpdateParams'+export type { PriceAdjustmentTierParams } from './PriceAdjustmentTierParams'+export type { PriceBulkDestroyParams } from './PriceBulkDestroyParams'+export type { PriceBulkUpsertParams } from './PriceBulkUpsertParams'+export type { PriceBulkUpsertRowParams } from './PriceBulkUpsertRowParams'+export type { PriceCreateParams } from './PriceCreateParams'+export type { PriceListCreateParams } from './PriceListCreateParams'+export type { PriceListPriceOverrideParams } from './PriceListPriceOverrideParams'+export type { PriceListRuleParams } from './PriceListRuleParams'+export type { PriceListUpdateParams } from './PriceListUpdateParams'+export type { PriceParams } from './PriceParams'+export type { PriceUpdateParams } from './PriceUpdateParams'+export type { ProductBulkCategoriesParams } from './ProductBulkCategoriesParams'+export type { ProductBulkChannelsParams } from './ProductBulkChannelsParams'+export type { ProductBulkCollectionsParams } from './ProductBulkCollectionsParams'+export type { ProductBulkDestroyParams } from './ProductBulkDestroyParams'+export type { ProductBulkStatusParams } from './ProductBulkStatusParams'+export type { ProductCreateParams } from './ProductCreateParams'+export type { ProductDigitalAssetParams } from './ProductDigitalAssetParams'+export type { ProductMediaParams } from './ProductMediaParams'+export type { ProductMembershipParams } from './ProductMembershipParams'+export type { ProductMembershipRepositionParams } from './ProductMembershipRepositionParams'+export type { ProductPublicationParams } from './ProductPublicationParams'+export type { ProductRejectParams } from './ProductRejectParams'+export type { ProductTypeCreateParams } from './ProductTypeCreateParams'+export type { ProductTypeCustomFieldDefinitionParams } from './ProductTypeCustomFieldDefinitionParams'+export type { ProductTypeUpdateParams } from './ProductTypeUpdateParams'+export type { ProductUpdateParams } from './ProductUpdateParams'+export type { ProductVariantParams } from './ProductVariantParams'+export type { PromotionActionCalculatorParams } from './PromotionActionCalculatorParams'+export type { PromotionActionCreateParams } from './PromotionActionCreateParams'+export type { PromotionActionDraftParams } from './PromotionActionDraftParams'+export type { PromotionActionLineItemParams } from './PromotionActionLineItemParams'+export type { PromotionActionUpdateParams } from './PromotionActionUpdateParams'+export type { PromotionCreateParams } from './PromotionCreateParams'+export type { PromotionRuleCreateParams } from './PromotionRuleCreateParams'+export type { PromotionRuleDraftParams } from './PromotionRuleDraftParams'+export type { PromotionRuleUpdateParams } from './PromotionRuleUpdateParams'+export type { PromotionUpdateParams } from './PromotionUpdateParams'+export type { PurchaseOrderCancelParams } from './PurchaseOrderCancelParams'+export type { PurchaseOrderCreateParams } from './PurchaseOrderCreateParams'+export type { PurchaseOrderItemParams } from './PurchaseOrderItemParams'+export type { PurchaseOrderUpdateParams } from './PurchaseOrderUpdateParams'+export type { ReasonCreateParams } from './ReasonCreateParams'+export type { ReasonUpdateParams } from './ReasonUpdateParams'+export type { ReceivableCloseParams } from './ReceivableCloseParams'+export type { RefundCreateParams } from './RefundCreateParams'+export type { ReportingQueryParams } from './ReportingQueryParams'+export type { ReturnCancelParams } from './ReturnCancelParams'+export type { ReturnCreateParams } from './ReturnCreateParams'+export type { ReturnReceiveParams } from './ReturnReceiveParams'+export type { ReturnRefundParams } from './ReturnRefundParams'+export type { ReturnUpdateParams } from './ReturnUpdateParams'+export type { RoleCreateParams } from './RoleCreateParams'+export type { RoleUpdateParams } from './RoleUpdateParams'+export type { SavedReportCreateParams } from './SavedReportCreateParams'+export type { SavedReportUpdateParams } from './SavedReportUpdateParams'+export type { SellerAddressParams } from './SellerAddressParams'+export type { SellerApproveParams } from './SellerApproveParams'+export type { SellerCreateParams } from './SellerCreateParams'+export type { SellerInviteParams } from './SellerInviteParams'+export type { SellerPayoutCompleteParams } from './SellerPayoutCompleteParams'+export type { SellerRejectParams } from './SellerRejectParams'+export type { SellerReopenOnboardingParams } from './SellerReopenOnboardingParams'+export type { SellerRequirementCreateParams } from './SellerRequirementCreateParams'+export type { SellerRequirementReviewParams } from './SellerRequirementReviewParams'+export type { SellerRequirementUpdateParams } from './SellerRequirementUpdateParams'+export type { SellerRequirementWaiveParams } from './SellerRequirementWaiveParams'+export type { SellerSuspendParams } from './SellerSuspendParams'+export type { SellerUpdateParams } from './SellerUpdateParams'+export type { SetupParams } from './SetupParams'+export type { ShippingLabelCreateParams } from './ShippingLabelCreateParams'+export type { StockLevelBulkUpsertParams } from './StockLevelBulkUpsertParams'+export type { StockLevelBulkUpsertRowParams } from './StockLevelBulkUpsertRowParams'+export type { StockLevelParams } from './StockLevelParams'+export type { StockLevelUpdateParams } from './StockLevelUpdateParams'+export type { StockLocationCreateParams } from './StockLocationCreateParams'+export type { StockLocationUpdateParams } from './StockLocationUpdateParams'+export type { StockReceiptCreateParams } from './StockReceiptCreateParams'+export type { StockReceiptItemParams } from './StockReceiptItemParams'+export type { StockTransferCancelParams } from './StockTransferCancelParams'+export type { StockTransferCreateParams } from './StockTransferCreateParams'+export type { StockTransferItemParams } from './StockTransferItemParams'+export type { StockTransferMarkInTransitParams } from './StockTransferMarkInTransitParams'+export type { StockTransferUpdateParams } from './StockTransferUpdateParams'+export type { StoreCreditApplyParams } from './StoreCreditApplyParams'+export type { StoreUpdateParams } from './StoreUpdateParams'+export type { SupplierCreateParams } from './SupplierCreateParams'+export type { SupplierUpdateParams } from './SupplierUpdateParams'+export type { TaxCategoryCreateParams } from './TaxCategoryCreateParams'+export type { TaxCategoryUpdateParams } from './TaxCategoryUpdateParams'+export type { TaxExemptionCertificateParams } from './TaxExemptionCertificateParams'+export type { TaxIdentifierParams } from './TaxIdentifierParams'+export type { TaxRateParams } from './TaxRateParams'+export type { TranslationBatchEntryParams } from './TranslationBatchEntryParams'+export type { TranslationBatchParams } from './TranslationBatchParams'+export type { VariantCreateParams } from './VariantCreateParams'+export type { VariantOptionParams } from './VariantOptionParams'+export type { VariantUpdateParams } from './VariantUpdateParams'+export type { WebhookEndpointCreateParams } from './WebhookEndpointCreateParams'+export type { WebhookEndpointDisableParams } from './WebhookEndpointDisableParams'+export type { WebhookEndpointUpdateParams } from './WebhookEndpointUpdateParams'diff --git a/packages/admin-sdk/src/zod/generated/Media.ts b/packages/admin-sdk/src/zod/generated/Media.tsindex 9cdf0d32e4..d408c864b3 100644--- a/packages/admin-sdk/src/zod/generated/Media.ts+++ b/packages/admin-sdk/src/zod/generated/Media.ts@@ -8,9 +8,9 @@ export const MediaSchema = z.object({position: z.number(),alt: z.string().nullable(),media_type: z.string(),+ external_video_url: z.string().nullable(),focal_point_x: z.number().nullable(),focal_point_y: z.number().nullable(),- external_video_url: z.string().nullable(),video_provider: z.string().nullable(),video_embed_url: z.string().nullable(),video_url: z.string().nullable(),diff --git a/packages/admin-sdk/src/zod/generated/Order.ts b/packages/admin-sdk/src/zod/generated/Order.tsindex b375d1b45f..921117e121 100644--- a/packages/admin-sdk/src/zod/generated/Order.ts+++ b/packages/admin-sdk/src/zod/generated/Order.ts@@ -68,7 +68,7 @@ export const OrderSchema = z.object({last_ip_address: z.string().nullable(),considered_risky: z.boolean(),confirmation_delivered: z.boolean(),- store_owner_notification_delivered: z.boolean(),+ store_owner_notification_delivered: z.boolean().nullable(),metadata: z.record(z.string(), z.unknown()),cancel_note: z.string().nullable(),canceled_at: z.string().nullable(),diff --git a/packages/admin-sdk/tests/params-types.test.ts b/packages/admin-sdk/tests/params-types.test.tsnew file mode 100644index 0000000000..068021b640--- /dev/null+++ b/packages/admin-sdk/tests/params-types.test.ts@@ -0,0 +1,85 @@+import { describe, expect, it } from 'vitest'+import { renderParamsTypes } from '../../sdk-core/src/params-types'++describe('renderParamsTypes', () => {+ const files = renderParamsTypes({+ components: {+ schemas: {+ Product: { type: 'object', properties: { id: { type: 'string' } } },+ PriceParams: {+ type: 'object',+ properties: {+ amount: { type: 'string', format: 'decimal' },+ compare_at_amount: { type: 'string', nullable: true },+ },+ required: ['amount'],+ },+ WidgetCreateParams: {+ type: 'object',+ properties: {+ name: { type: 'string', description: 'The name.' },+ status: { type: 'string', enum: ['draft', "it's"] },+ weight: { type: 'number', nullable: true },+ tags: { type: 'array', items: { type: 'string' } },+ metadata: { type: 'object', additionalProperties: true },+ value: {},+ prices: { type: 'array', items: { $ref: '#/components/schemas/PriceParams' } },+ main_price: { allOf: [{ $ref: '#/components/schemas/PriceParams' }], nullable: true },+ options: {+ type: 'array',+ items: {+ type: 'object',+ properties: { name: { type: 'string' } },+ required: ['name'],+ },+ },+ },+ required: ['name'],+ },+ },+ },+ })++ const source = files.get('WidgetCreateParams.ts') ?? ''++ it('writes one file per request schema and an index of them', () => {+ expect([...files.keys()]).toEqual(['PriceParams.ts', 'WidgetCreateParams.ts', 'index.ts'])+ expect(files.get('index.ts')).toContain(+ "export type { PriceParams } from './PriceParams'\nexport type { WidgetCreateParams } from './WidgetCreateParams'\n",+ )+ })++ it('imports the request types a type references', () => {+ expect(source).toContain("import type { PriceParams } from './PriceParams'\n")+ })++ it('maps each kind of value', () => {+ expect(files.get('PriceParams.ts')).toContain(+ ' amount: string\n compare_at_amount?: string | null\n',+ )+ expect(source).toContain(' /** The name. */\n name: string\n')+ expect(source).toContain(" status?: 'draft' | 'it\\'s'\n")+ expect(source).toContain(' weight?: number | null\n')+ expect(source).toContain(' tags?: string[]\n')+ expect(source).toContain(' metadata?: Record<string, unknown>\n')+ expect(source).toContain(' value?: unknown\n')+ expect(source).toContain(' prices?: PriceParams[]\n')+ expect(source).toContain(' main_price?: PriceParams | null\n')+ expect(source).toContain(' options?: {\n name: string\n }[]\n')+ })++ it('refuses a reference to a response schema', () => {+ expect(() =>+ renderParamsTypes({+ components: {+ schemas: {+ BadParams: {+ type: 'object',+ properties: { product: { $ref: '#/components/schemas/Product' } },+ },+ },+ },+ }),+ ).toThrow(/not a request schema/)+ })+})diff --git a/packages/cli/src/generated/admin-spec.json b/packages/cli/src/generated/admin-spec.jsonindex 388845a371..cc1492105c 100644--- a/packages/cli/src/generated/admin-spec.json+++ b/packages/cli/src/generated/admin-spec.json@@ -1 +1 @@-{"info":{"title":"Admin API","contact":{"name":"Spree Commerce","url":"https://spreecommerce.org","email":"[email protected]"},"description":"Spree Admin API v3 - Administrative API for managing products, orders, and store settings.\n\n## Authentication\n\nThe Admin API requires a secret API key passed in the `x-spree-api-key` header.\nSecret API keys can be generated in the Spree admin dashboard.\n\n## Response Format\n\nAll responses are JSON. List endpoints return paginated responses with `data` and `meta` keys.\nSingle resource endpoints return a flat JSON object.\n\n## Resource IDs\n\nEvery resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,\n`variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,\nrequest bodies, and Ransack filters all accept them directly.\n\n## Error Handling\n\nErrors return a consistent format:\n```json\n{\n \"error\": {\n \"code\": \"validation_error\",\n \"message\": \"Validation failed\",\n \"details\": { \"name\": [\"can't be blank\"] }\n }\n}\n```\n","version":"v3"},"paths":{"/api/v3/admin/auth/login":{"post":{"summary":"Login","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Authenticates an admin user and returns a short-lived JWT access token.\nThe rotatable refresh token is set in an HttpOnly cookie — it is not\nincluded in the response body.\n\nThe `provider` field selects the authentication method. When omitted it\ndefaults to `email`, the built-in email/password login.\n\nTo authenticate against a third-party identity provider (Okta, Azure AD,\nGoogle Workspace SSO, a custom JWT issuer, SAML, etc.), send\n`{ \"provider\": \"<your_key>\", ... }` with the fields that provider\nrequires. The endpoint returns the same JWT regardless of which provider\nauthenticated the request. See\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication)\nfor the list of configured providers and their required fields.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"title":"EmailPasswordLogin","description":"Built-in email/password authentication (default when `provider` is omitted).","type":"object","properties":{"provider":{"type":"string","enum":["email"],"default":"email"},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},{"title":"ProviderLogin","description":"Provider-dispatched login. The `provider` key selects a configured\nauthentication provider; the remaining fields are forwarded to it.\nRequired fields depend on the provider — see\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication).\n","type":"object","properties":{"provider":{"type":"string","description":"Registered provider key (anything other than `email`).","not":{"enum":["email"]}}},"required":["provider"],"additionalProperties":true}]}}}}}},"/api/v3/admin/auth/refresh":{"post":{"summary":"Refresh token","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Exchanges the HttpOnly refresh-token cookie for a new access JWT and a\nrotated refresh token cookie. No request body or Authorization header\nis required — the cookie alone authenticates the call.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"refresh successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"missing or invalid refresh-token cookie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/auth/logout":{"post":{"summary":"Logout","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Revokes the refresh-token cookie, effectively logging the admin out.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"logout successful"}}}},"/api/v3/admin/me":{"get":{"summary":"Get current admin user and permissions","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current admin user profile and a serialized list of permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current admin user and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current admin profile","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Self-service update of the signed-in admin's own profile, such as their admin UI display language (`selected_locale`).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"profile updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_locale":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/api/v3/admin/auth/password_resets":{"post":{"summary":"Request password reset","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Requests a password reset email for an admin user. Always returns `202`\nwhether or not the email matches an account, to prevent enumeration.\n\n`redirect_url` is where the emailed link should point (the reset token\nis appended as a `token` query param). It is honoured only on the\ndashboard's origin and for an account that is staff of the store —\notherwise it is silently ignored and the link opens the dashboard's\nreset page. 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":"Honoured only on the dashboard origin, for an account that is staff 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."},"sample_data":{"type":"boolean","description":"Load the demo catalog, customers and orders in the background once the admin account exists."}}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of origin (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[origin_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `origin`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"AllowedOrigin","sortable":["created_at","id","origin","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ApiKey","sortable":["created_at","id","name","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and pretty name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `automatic` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `children_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `parent_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `permalink` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `pretty_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `products_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[parent_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Category","sortable":["automatic","children_count","created_at","depth","id","name","parent_id","permalink","position","pretty_name","products_count","updated_at"]},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"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/categories/{category_id}/custom_fields":{"get":{"summary":"List category custom fields","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the category's custom field values.\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,"schema":{"type":"string"}},{"name":"category_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `store_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Channel","sortable":["active","code","created_at","default","id","name","store_id","updated_at"]},"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},"order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy shorthand (built-in: `rules`). `null` inherits the store setting."},"storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"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"},"order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy shorthand (built-in: `rules`). `null` inherits the store setting."},"storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[active_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `channel_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `store_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `channel_id`, `created_at`, `id`, `position`, `store_id`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderRoutingRule","sortable":["active","channel_id","created_at","id","position","store_id","type","updated_at"]},"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]=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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of namespace, key, and label (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[key_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `field_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `key` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `label` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `namespace` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `resource_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `searchable` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `sortable` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `field_type`, `id`, `key`, `label`, `namespace`, `resource_type`, `searchable`, `sortable`, `storefront_visible`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomFieldDefinition","sortable":["created_at","field_type","id","key","label","namespace","resource_type","searchable","sortable","storefront_visible","updated_at"]},"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 token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension type that has no token is named by its registered class instead."},"resource_type":{"type":"string","description":"Shorthand of the owning resource, e.g. `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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomerGroup","sortable":["created_at","id","name","updated_at"]},"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}/custom_fields":{"get":{"summary":"List customer custom fields","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's custom field values.\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., 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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/customers/{id}/export":{"get":{"summary":"Export a customer's personal data","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns everything the store holds about this customer, for answering a\nGDPR right-of-access request (Art. 15) that reached the merchant\ndirectly.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer data","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object"},"marketing_consent":{"type":"object"},"consent_records":{"type":"array","items":{"type":"object"}},"addresses":{"type":"array","items":{"type":"object"}},"orders":{"type":"array","items":{"type":"object"}},"exported_at":{"type":"string"}}}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/customers/{id}/anonymize":{"post":{"summary":"Erase a customer's personal data","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Carries out a GDPR right-to-erasure request (Art. 17). Personal data is\nreplaced across the account, its addresses, the address snapshots on\npast orders, saved cards, connected identities and live sessions.\n\nOrders, payments and tax records are kept — they carry their own\nretention obligation — with the personal details removed. The country,\nstate and a truncated postal code survive on order addresses so the tax\njurisdiction of a past sale stays provable.\n\nIrreversible.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer anonymized","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"anonymized":{"type":"boolean"},"anonymized_at":{"type":"string","nullable":true}}}}}}}}},"/api/v3/admin/consent_records":{"get":{"summary":"List consent records","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the consents customers gave or withdrew, newest first, as evidence of what each one agreed to and when.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `accepted` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purpose` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `recorded_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `source` | One of `checkout`, `registration`, `account`, `admin`, `newsletter`, `anonymization`, `unknown`, `import`, `storefront` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `accepted`, `created_at`, `email`, `id`, `purpose`, `recorded_at`, `source`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ConsentRecord","sortable":["accepted","created_at","email","id","purpose","recorded_at","source","updated_at"]},"responses":{"200":{"description":"consent records found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConsentRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/data_requests":{"get":{"summary":"List data requests","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the requests customers made to export or erase their personal data, newest first.\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":"q[access]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `access`."},{"name":"q[erasure]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `erasure`."},{"name":"q[in_progress]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_progress`."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `completed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `access`, `erasure` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `requested_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `completed_at`, `created_at`, `email`, `id`, `kind`, `number`, `requested_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DataRequest","sortable":["completed_at","created_at","email","id","kind","number","requested_at","status","updated_at"]},"responses":{"200":{"description":"data requests found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataRequest"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[address1_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `address1` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `address2` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `company` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `postal_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Address","sortable":["address1","address2","city","company","country_code","created_at","first_name","id","last_name","phone","postal_code","state_code","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CreditCard","sortable":["created_at","id","name","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of memo (partial, case-insensitive)."},{"name":"q[from_gift_card]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `from_gift_card`."},{"name":"q[outstanding]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `outstanding`."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `memo` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[created_by_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `created_by_` | `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at` |\n| `created_by_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `created_by_id`, `currency`, `customer_id`, `id`, `memo`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCredit","sortable":["amount","created_at","created_by_id","currency","customer_id","id","memo","updated_at"]},"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/{customer_id}/tax_identifiers":{"get":{"summary":"List customer tax registrations","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's own tax registrations, one per kind.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxIdentifier","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"registrations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxIdentifier"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches email, first name, last name or full name (partial, case-insensitive)."},{"name":"q[anonymized]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `anonymized`."},{"name":"q[with_min_total_spent]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `with_min_total_spent` to the given value."},{"name":"q[with_standing_for_company][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_standing_for_company` to the given value."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `accepts_email_marketing` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[addresses_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Customer","sortable":["accepts_email_marketing","created_at","email","first_name","id","last_name","phone","updated_at"]},"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/email_templates":{"get":{"summary":"List email templates","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every email template merchants may edit: the emails customers\nreceive, the email layout and the shared partials. Each shows what\ncustomers receive now (the store's published version, else Spree's\ndefault) and any draft in progress. Staff emails are not editable.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default) for the version every language uses","schema":{"type":"string"}}],"responses":{"200":{"description":"email templates found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The template key with dots, e.g. `spree.order_mailer.confirm_email`","schema":{"type":"string"}}],"get":{"summary":"Get an email template","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the template for one language: what customers receive now,\nSpree's default, and the draft with its `lock_version`. When Spree's\ndefault changed since the store's version started from it,\n`default_changed` is true and `base_body` holds the default it\nstarted from, to compare with `default_body`.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (`draft.updated_by`)","schema":{"type":"string"}}],"responses":{"200":{"description":"email template found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"404":{"description":"not an editable template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"summary":"Revert an email template to Spree's default","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Goes back to Spree's default for one language and discards the draft.\nThe store's published versions are kept, so one can still be restored.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"lock_version","in":"query","required":false,"description":"The draft's `lock_version` as last seen; a draft saved since is refused with 409","schema":{"type":"integer"}}],"responses":{"200":{"description":"email template reverted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/draft":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"put":{"summary":"Save an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Saves the draft, in any state; customers keep receiving the published\nversion until it is published. Send the `lock_version` the draft was\nloaded with: a save made from an older copy is refused with 409,\nnaming who saved last. The first save starts from what is published,\nelse Spree's default.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"draft saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"409":{"description":"saved by someone else since it was loaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"lock_version":{"type":"integer"},"rebase":{"type":"boolean","description":"Marks the draft as based on Spree's current default, after reviewing what changed in it"}}}}}}},"delete":{"summary":"Discard an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"lock_version","in":"query","required":false,"description":"The draft's `lock_version` as last seen; a draft saved since is refused with 409","schema":{"type":"integer"}}],"responses":{"200":{"description":"draft discarded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/publication":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Publish an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Makes the draft what customers receive. The draft is first rendered\nwith sample data; one that does not render (for the layout or a\npartial: in any email using it) is refused with 422, listing each\nproblem with its email and line.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"draft published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"422":{"description":"the draft does not render","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"lock_version":{"type":"integer","description":"The draft's `lock_version` as reviewed; a draft saved since is refused with 409"}}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/preview":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Preview an email template","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renders the template with sample data built from the store's latest\nmatching record, or the one `record_id` names, and returns the email\nwith the variables it was rendered with. An unsaved `subject` and\n`body` take the place of the current version. The layout and partials\nrender inside an email, `email_key` or the first one. `branding`\npreviews colors and a font before they are saved to the store.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"email template rendered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplatePreview"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"record_id":{"type":"string","description":"The record to build sample data from"},"email_key":{"type":"string","description":"For the layout or a partial, the email to show it in"},"branding":{"type":"object","description":"Unsaved colors and font to preview, named like the store's `email_*` settings","properties":{"accent_color":{"type":"string"},"background_color":{"type":"string"},"card_color":{"type":"string"},"text_color":{"type":"string"},"heading_color":{"type":"string"},"font":{"type":"string","enum":["inter","system","helvetica","georgia","roboto","lato","merriweather"]}}}}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/test_email":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Send a test email","tags":["Email Templates"],"security":[{"bearer_auth":[]}],"description":"Sends the template, rendered as the preview renders it, to the\nsigned-in admin, and never to another address: the sample data comes\nfrom a real customer's records. Takes the same body as the preview.\n","parameters":[{"name":"x-spree-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":"test email queued","content":{"application/json":{"schema":{"type":"object","properties":{"sent_to":{"type":"string"}},"required":["sent_to"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"record_id":{"type":"string"},"email_key":{"type":"string"}}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/sample_records":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"get":{"summary":"List records to preview an email template with","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The store's five latest records the template can be previewed with,\nnewest first, to pass as `record_id` to the preview. For the layout\nand partials, those of the email `email_key` names. Empty for an\nemail that needs no record.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"email_key","in":"query","required":false,"description":"For the layout or a partial, the email to show it in","schema":{"type":"string"}}],"responses":{"200":{"description":"records found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{email_template_id}/revisions":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"get":{"summary":"List email template revisions","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every version of the template published in one language, newest\nfirst. Reverting to Spree's default keeps them.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","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 (`published_by`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"EmailTemplateRevision","sortable":["created_at","id"]},"responses":{"200":{"description":"revisions found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{email_template_id}/revisions/{revision_id}/restoration":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Restore an email template revision","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Copies the revision into the draft, to be published like any change.\nSend the draft's `lock_version` when one is open, as when saving it.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"revision copied into the draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"lock_version":{"type":"integer"}}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `format` | One of `csv` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `format`, `id`, `number`, `seller_id`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Export","sortable":["created_at","format","id","number","seller_id","type","updated_at"]},"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","price_list_prices","purchase_orders"]},"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. A `price_list_prices` export requires `price_list_id_eq` naming a price list of the current store, and refuses `record_selection: \"all\"`.","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/files":{"post":{"summary":"Upload a file","tags":["Files"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts a file and returns a `signed_id` to send to the endpoint that\nuses it — `signed_id` on product media, `avatar_signed_id` on a\ncustomer, `attachment_signed_id` on an import, and so on.\n\nTwo ways to send the bytes, one response:\n\n- **Presigned** (JSON): send the file's metadata, then `PUT` the bytes\n to `upload.url` with exactly `upload.headers`. Use this for anything\n large — the bytes go straight to storage.\n- **Multipart**: send the bytes in a `file` part. The file is stored\n before the response, so `upload` is null. Limited to 10 MB by default.\n\n`signed_id` is opaque: pass it back unchanged and never parse it. It\nstops being attachable at `expires_at`, one day after the upload.\n\n`visibility` picks the storage: `public` (the default) for images and\nvideos customers see, `private` for documents, imports and digital\nproducts. Public uploads accept web images, videos and CSV; private\nuploads accept any type. `checksum` is the file's MD5 digest,\nbase64-encoded — the storage service verifies the bytes against it.\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":"presigned upload target created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpload"}}}},"422":{"description":"content type not allowed for a public upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"integer"},"checksum":{"type":"string","description":"Base64-encoded MD5 digest of the file"},"visibility":{"type":"string","enum":["public","private"],"default":"public"},"file":{"type":"string","format":"binary","description":"The bytes, for a multipart upload"}},"required":["filename","content_type"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"integer"},"checksum":{"type":"string","description":"Base64-encoded MD5 digest of the file"},"visibility":{"type":"string","enum":["public","private"],"default":"public"},"file":{"type":"string","format":"binary","description":"The bytes, for a multipart upload"}},"required":["filename","content_type"]}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Fulfillment","sortable":["created_at","id","number","updated_at"]},"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. Exchange and claim replacements are moved only out of a named `source_fulfillment_id`, which is how a canceled replacement is sent again. 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"},"source_fulfillment_id":{"type":"string","description":"The only fulfillment of this order to move units from, its exchange and claim replacements included. Omit to take the customer's bought units from every unshipped fulfillment"},"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}/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}/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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[prefix_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `prefix` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `prefix`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"GiftCardBatch","sortable":["created_at","id","prefix","updated_at"]},"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[customer_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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of code (partial, case-insensitive)."},{"name":"q[active]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `active`."},{"name":"q[expired]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `expired`."},{"name":"q[partially_redeemed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `partially_redeemed`."},{"name":"q[redeemed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `redeemed`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `expires_at` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `gift_card_batch_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state` | One of `active`, `partially_redeemed`, `redeemed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `active`, `partially_redeemed`, `redeemed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[batch_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `batch_` | `created_at`, `id`, `prefix`, `updated_at` |\n| `customers_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customers_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customers_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customers_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customers_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `users_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `users_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `created_by_id`, `currency`, `customer_id`, `expires_at`, `gift_card_batch_id`, `id`, `state`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"GiftCard","sortable":["code","created_at","created_by_id","currency","customer_id","expires_at","gift_card_batch_id","id","state","status","updated_at"]},"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 `customer_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},"customer_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},"customer_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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `mapping`, `completed_mapping`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `seller_id`, `status`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Import","sortable":["created_at","id","number","seller_id","status","type","updated_at"]},"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/files`\nand pass the returned `signed_id` as `attachment_signed_id`. 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_signed_id"],"properties":{"type":{"type":"string","enum":["products","customers","product_translations","price_list_prices","purchase_orders"]},"price_list_id":{"type":"string","description":"For `price_list_prices` imports: the price list the rows are merged into. Must belong to the current store."},"attachment_signed_id":{"type":"string","description":"The `signed_id` returned by POST /api/v3/admin/files."},"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `row_number` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `row_number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ImportRow","sortable":["created_at","id","row_number","status","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `default_locale` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `currency`, `default_locale`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Market","sortable":["created_at","currency","default_locale","id","name","position","updated_at"]},"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/{option_type_id}/custom_fields":{"get":{"summary":"List option type custom fields","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the option type'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":"option_type_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and label (partial, case-insensitive)."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `dropdown`, `color_swatch`, `buttons` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `label` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OptionType","sortable":["created_at","id","kind","label","name","position","updated_at"]},"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/claims":{"get":{"summary":"List claims","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every damage or missing-item claim in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `open`, `approved`, `resolved`, `denied`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Claim","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"claims listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/claims":{"get":{"summary":"List order claims","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The damage or missing-item claims opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `open`, `approved`, `resolved`, `denied`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Claim","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"claims listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/custom_fields":{"get":{"summary":"List order custom fields","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the order's custom field values.\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,"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/digital_links":{"get":{"summary":"List digital links","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the download links issued for digital products bought in this store, newest first.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DigitalLink","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"digital links found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/exchanges":{"get":{"summary":"List exchanges","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every exchange in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `fulfilled`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Exchange","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"exchanges listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/exchanges":{"get":{"summary":"List order exchanges","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The exchanges opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `fulfilled`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Exchange","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"exchanges listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[country_code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `provider_id` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `taxability_reason` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `country_code`, `created_at`, `id`, `included`, `provider_id`, `state_code`, `taxability_reason`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxLine","sortable":["country_code","created_at","id","included","provider_id","state_code","taxability_reason","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Discount","sortable":["created_at","id","updated_at"]},"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":"string"},"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":{"get":{"summary":"List fees","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the order's fees, such as surcharges, handling and gift wrap, on the whole order or on one item or delivery.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Fee","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"fees found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fee"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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":"string"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty","exchange"],"description":"Defaults to 'surcharge'"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true}},"required":["label","amount"]}}}}}},"/api/v3/admin/order_groups":{"get":{"summary":"List order groups","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns checkouts split into one order per seller, grouping the orders placed together.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[customer_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `currency`, `email`, `id`, `number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderGroup","sortable":["created_at","currency","email","id","number","updated_at"]},"responses":{"200":{"description":"order groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[additional_tax_total_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `additional_tax_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discount_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included_tax_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `non_taxable_adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `pre_tax_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `taxable_adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"LineItem","sortable":["additional_tax_total","adjustment_total","cost_price","created_at","discount_total","id","included_tax_total","non_taxable_adjustment_total","order_id","pre_tax_amount","price","quantity","tax_category_id","taxable_adjustment_total","updated_at","variant_id"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches order number or purchase order number (partial), the billing first or last name, or the exact email."},{"name":"q[complete]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `complete`."},{"name":"q[incomplete]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `incomplete`."},{"name":"q[partially_refunded]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `partially_refunded`."},{"name":"q[refunded]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `refunded`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `channel_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `completed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `considered_risky` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `coupon_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `delivery_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `fulfillment_status` | One of `backorder`, `canceled`, `partial`, `unfulfilled`, `fulfilled`, `delivered`, `pending`, `ready`, `shipped` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `item_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `order_group_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `payment_status` | One of `none`, `authorized`, `partially_paid`, `paid`, `partially_refunded`, `refunded`, `overcharged`, `voided`, `balance_due`, `credit_owed`, `failed`, `void` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `po_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `draft`, `placed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `total_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[bill_address_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `line_items_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `line_items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_group_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `promotions_coupon_codes_` | `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Order","sortable":["channel_id","completed_at","considered_risky","coupon_code","created_at","currency","customer_id","delivery_total","email","fulfillment_status","id","item_total","number","order_group_id","payment_state","payment_status","po_number","seller_id","shipment_state","status","total","total_quantity","updated_at"]},"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."},"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\nOn a marketplace, an order holding several sellers' goods becomes one\norder per seller, and the response is the order group they belong to\nwith those orders nested inside it.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order completed","content":{"application/json":{}}},"422":{"description":"order cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\n`cancel_reason_id` records why, from the store's own cancellation-reason\nvocabulary (`/admin/order_cancellation_reasons`), and `cancel_note` is a\nstaff-facing note; both are shown on the order afterwards.\n\nStock is always released — the goods are not going out either way — and\nevery payment is settled at the gateway, which releases an\nauthorization it never drew on and refunds a charge it cannot release.\n\n`refund_payments` and `refund_amount` govern the shared payment of a\nsplit checkout, where one payment covers several orders: they decide\nwhether this order's share comes back, and how much of it. A\n`refund_amount` on an ordinary order is refused with a 422.\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":{"cancel_reason_id":{"type":"string","description":"Why the order was canceled — the id of one of the store's cancellation reasons."},"cancel_note":{"type":"string","description":"Staff-facing note about the cancellation."},"refund_payments":{"type":"boolean","default":false,"description":"Whether this order's share of a payment shared across a split checkout is handed back."},"refund_amount":{"type":"string","description":"How much of that share to return. Defaults to all of it; refused on an order whose payment is not shared."},"notify_customer":{"type":"boolean","default":false,"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}/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/returns":{"get":{"summary":"List returns","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every return in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `refunded`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Return","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"returns listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/returns":{"get":{"summary":"List order returns","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The returns opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `refunded`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Return","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"returns listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/returns/{return_id}/labels":{"get":{"summary":"List return labels","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The shipping labels issued for sending one return back to the 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,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}},{"name":"return_id","in":"path","required":true,"description":"Return prefixed 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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `source` | One of `purchased`, `uploaded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `purchased`, `refund_requested`, `refunded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `source`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ShippingLabel","sortable":["carrier","created_at","id","source","status","tracking_number","updated_at"]},"responses":{"200":{"description":"labels listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `position`, `storefront_visible`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PaymentMethod","sortable":["active","created_at","id","name","position","storefront_visible","type","updated_at"]},"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 every registered payment provider with the JSON Schema of its `preferences`. `installed` marks a provider the store already has, which a \"Provider\" picker leaves out.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[avs_response_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `avs_response` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cvv_response_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cvv_response_message` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `response_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state` | One of `checkout`, `processing`, `pending`, `completed`, `failed`, `void`, `invalid` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `checkout`, `processing`, `pending`, `completed`, `failed`, `void`, `invalid` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `payment_method_` | `active`, `created_at`, `id`, `name`, `position`, `storefront_visible`, `type`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `avs_response`, `created_at`, `cvv_response_code`, `cvv_response_message`, `id`, `response_code`, `state`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Payment","sortable":["amount","avs_response","created_at","cvv_response_code","cvv_response_message","id","response_code","state","status","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `catalog_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `ends_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `match_policy` | One of `all`, `any` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `starts_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `draft`, `active`, `inactive`, `scheduled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PriceList","sortable":["catalog_id","created_at","ends_at","id","match_policy","name","position","starts_at","status","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches the variant's SKU, option value or product name, as variant search does."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `compare_at_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `min_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `price_list_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[price_list_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Price","sortable":["amount","compare_at_amount","created_at","currency","id","min_quantity","price_list_id","updated_at","variant_id"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"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}/digital_assets":{"parameters":[{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"get":{"summary":"List product digital assets","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the downloadable files attached to the product's variants, oldest first.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DigitalAsset","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"digital assets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalAsset"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\nAlso filters and sorts on the store's searchable custom fields, as `q[cf_<namespace>_<key>_<predicate>]` and `sort=cf_<namespace>_<key>`.\n\n**Sort by:** `available_on`, `best_selling`, `created_at`, `description`, `discontinue_on`, `id`, `manual`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","best_selling","created_at","description","discontinue_on","id","manual","name","price","seller_id","slug","status","updated_at"],"custom_fields":true},"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/translations":{"get":{"summary":"Translation coverage for a resource type","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Reports how much of each record is translated into each of the store's non-default locales, plus per-locale totals. A record counts as covered for a locale only when every one of its translatable fields is filled in.\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":"resource_type","in":"query","required":true,"description":"A translatable resource type, e.g. `product`, `category`, `option_type`.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"search","in":"query","required":false,"description":"Free-text term, applied through whichever predicate the resource type whitelists (reported back as `search_field`).","schema":{"type":"string"}}],"responses":{"200":{"description":"coverage found","content":{"application/json":{}}},"404":{"description":"resource type is not translatable","content":{"application/json":{}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `owner_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `owner_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `owner_id`, `owner_type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Policy","sortable":["created_at","id","name","owner_id","owner_type","updated_at"]},"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/claim_reasons":{"get":{"summary":"List claim reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why a customer raised a claim — what the merchant got wrong, rather than a change of mind.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ClaimReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"claim reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a claim reason to this store. Names are unique per store, ignoring case.\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":"claim reason created","content":{"application/json":{}}},"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"},"active":{"type":"boolean","description":"Inactive reasons are hidden from the pickers on new records."}}}}}}}},"/api/v3/admin/claim_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Claim reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single claim reason 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"}}],"responses":{"200":{"description":"claim reason found","content":{"application/json":{}}},"404":{"description":"claim reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a claim reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"claim reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a claim reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"claim reason deleted"}}}},"/api/v3/admin/order_cancellation_reasons":{"get":{"summary":"List order cancellation reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why an order was called off before it shipped. Staff pick one when canceling.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderCancellationReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"order cancellation reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a order cancellation reason to this store. Names are unique per store, ignoring case.\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":"order cancellation reason created","content":{"application/json":{}}},"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"},"active":{"type":"boolean","description":"Inactive reasons are hidden from the pickers on new records."}}}}}}}},"/api/v3/admin/order_cancellation_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Order cancellation reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single order cancellation reason 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"}}],"responses":{"200":{"description":"order cancellation reason found","content":{"application/json":{}}},"404":{"description":"order cancellation reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a order cancellation reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"order cancellation reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a order cancellation reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"order cancellation reason deleted"}}}},"/api/v3/admin/refund_reasons":{"get":{"summary":"List refund reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why money went back. Some rows are seeded and looked up by name, so they refuse renaming and deletion.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"RefundReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"refund reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a refund reason to this store. Names are unique per store, ignoring case.\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":"refund reason created","content":{"application/json":{}}},"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"},"active":{"type":"boolean","description":"Inactive reasons are hidden from the pickers on new records."}}}}}}}},"/api/v3/admin/refund_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Refund reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single refund reason 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"}}],"responses":{"200":{"description":"refund reason found","content":{"application/json":{}}},"404":{"description":"refund reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a refund reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"refund reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a refund reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"refund reason deleted"}}}},"/api/v3/admin/return_reasons":{"get":{"summary":"List return reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why a customer is sending items back. Shared by returns and exchanges.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ReturnReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"return reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a return reason to this store. Names are unique per store, ignoring case.\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":"return reason created","content":{"application/json":{}}},"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"},"active":{"type":"boolean","description":"Inactive reasons are hidden from the pickers on new records."}}}}}}}},"/api/v3/admin/return_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Return reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single return reason 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"}}],"responses":{"200":{"description":"return reason found","content":{"application/json":{}}},"404":{"description":"return reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a return reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"return reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a return reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"return reason 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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `promotion_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state` | One of `unused`, `used` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[promotion_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `promotion_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CouponCode","sortable":["code","created_at","id","promotion_id","state","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PromotionAction","sortable":["created_at","id","position","updated_at"]},"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`).\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PromotionRule","sortable":["created_at","id","updated_at"]},"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`).\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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and code (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `coupon_code`, `automatic` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `path` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `promotion_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `starts_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[coupon_codes_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `coupon_codes_` | `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Promotion","sortable":["code","created_at","expires_at","id","kind","name","path","promotion_category_id","starts_at","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Refund","sortable":["created_at","id","updated_at"]},"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"},"admin_locale":{"type":"string"},"timezone":{"type":"string"},"weight_unit":{"type":"string"},"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":"Shorthand of the tagged resource: `product`, `order` or `customer`","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_categories":{"get":{"summary":"List tax categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the tax categories products and delivery methods can be assigned to, which tax rates then apply to.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `is_default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `tax_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxCategory","sortable":["created_at","id","is_default","name","tax_code","updated_at"]},"responses":{"200":{"description":"tax categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included_in_price` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `tax_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `amount`, `country_code`, `created_at`, `id`, `included_in_price`, `name`, `state_code`, `tax_category_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxRate","sortable":["amount","country_code","created_at","id","included_in_price","name","rate","state_code","tax_category_id","updated_at"]},"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 `rate` as a\ndecimal string (`\"0.19\"`) or `rate_percent` as a percentage string (`\"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\""},"rate":{"type":"string","description":"Rate as a decimal string, e.g. \"0.19\""},"rate_percent":{"type":"string","description":"Rate as a percentage string, 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"},"rate":{"type":"string"},"rate_percent":{"type":"string"},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[spree_roles_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"AdminUser","sortable":["created_at","email","first_name","id","last_name","updated_at"]},"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. Removing a role needs the same rights as granting it, and the store always keeps at least one admin.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Invitation","sortable":["created_at","id","updated_at"]},"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/{invitation_id}/acceptance_link":{"get":{"summary":"Get an invitation acceptance link","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the link the invitee opens to accept a pending invitation. The link carries the invitation token, so it needs write access to staff and the right to grant the invitation's role; invitation listings never include it.\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":"invitation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"acceptance link found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAcceptanceLink"}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Role","sortable":["created_at","id","name","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `pickup_enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `returns_enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockLocation","sortable":["active","country_code","created_at","default","id","kind","name","pickup_enabled","returns_enabled","seller_id","state_code","updated_at"]},"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/store_credits":{"get":{"summary":"List store credits","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every store credit in the current store, across all customers.\nRead-only: issuing, editing and deleting a credit stays nested under\nthe customer that holds it.\n\n`meta.totals` carries the outstanding balance as one row per currency,\nsummed over the same filter this request used — so filtering by a\ncustomer answers that customer's balance and no filter answers the\nstore's liability.\n\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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of memo (partial, case-insensitive)."},{"name":"q[from_gift_card]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `from_gift_card`."},{"name":"q[outstanding]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `outstanding`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (customer, created_by).","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `memo` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[created_by_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `created_by_` | `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at` |\n| `created_by_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `created_by_id`, `currency`, `customer_id`, `id`, `memo`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCredit","sortable":["amount","created_at","created_by_id","currency","customer_id","id","memo","updated_at"]},"responses":{"200":{"description":"store credits found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credits/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a store credit","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**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":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (customer, created_by).","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCredit"}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credits/{store_credit_id}/events":{"parameters":[{"name":"store_credit_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List a store credit's ledger","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every movement of the credit's balance, newest first: allocated when\nissued, authorized when a checkout starts against it, captured when\nthat order is paid, and voided or credited back if it is cancelled.\n\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":"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCreditEvent","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"events found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditEvent"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/variants/{variant_id}/custom_fields":{"get":{"summary":"List variant custom fields","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the variant'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":"variant_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches SKU, option value or product name (partial, case-insensitive; at least three characters)."},{"name":"q[available_at_stock_location]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `available_at_stock_location` to the given value."},{"name":"q[product_name_or_sku_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `product_name_or_sku_cont` to the given value."},{"name":"q[search_by_product_name_or_sku]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_product_name_or_sku` to the given value."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[cost_currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carton_package_type_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `carton_weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cartons_per_pallet` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_of_origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `deleted_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `height` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `hs_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `minimum_order_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_multiple` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `product_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_unit` | One of `unit`, `carton` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `sku` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `track_inventory` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `units_per_carton` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `width` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_values_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `prices_price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `product_categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `product_channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `product_collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `product_labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `product_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Variant","sortable":["carton_package_type_id","carton_weight","cartons_per_pallet","cost_currency","cost_price","country_of_origin","created_at","deleted_at","depth","discontinue_on","height","hs_code","id","minimum_order_quantity","order_multiple","position","product_id","purchase_unit","sku","track_inventory","units_per_carton","updated_at","weight","width"]},"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/variants":{"get":{"summary":"List variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every variant in the store across all products, for pickers and stock views that are not tied to one product.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches SKU, option value or product name (partial, case-insensitive; at least three characters)."},{"name":"q[available_at_stock_location]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `available_at_stock_location` to the given value."},{"name":"q[product_name_or_sku_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `product_name_or_sku_cont` to the given value."},{"name":"q[search_by_product_name_or_sku]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_product_name_or_sku` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[cost_currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carton_package_type_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `carton_weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cartons_per_pallet` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_of_origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `deleted_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `height` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `hs_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `minimum_order_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_multiple` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `product_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_unit` | One of `unit`, `carton` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `sku` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `track_inventory` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `units_per_carton` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `width` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_values_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `prices_price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `product_categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `product_channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `product_collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `product_labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `product_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Variant","sortable":["carton_package_type_id","carton_weight","cartons_per_pallet","cost_currency","cost_price","country_of_origin","created_at","deleted_at","depth","discontinue_on","height","hs_code","id","minimum_order_quantity","order_multiple","position","product_id","purchase_unit","sku","track_inventory","units_per_carton","updated_at","weight","width"]},"responses":{"200":{"description":"variants found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of event name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[event_name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `delivered_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `event_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `execution_time` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `response_code` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `success` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `delivered_at`, `event_name`, `execution_time`, `id`, `response_code`, `success`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"WebhookDelivery","sortable":["created_at","delivered_at","event_name","execution_time","id","response_code","success","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of url (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `url` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`, `url`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"WebhookEndpoint","sortable":["active","created_at","id","name","updated_at","url"]},"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/webhook_events":{"get":{"summary":"List webhook events","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every event a webhook endpoint can subscribe to, including those installed extensions declare. Credential events reach only endpoints that name them, and subscribing to one needs the permission listed; deprecated events name their replacement.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"events returned","content":{"application/json":{}}}}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Catalog","sortable":["active","created_at","id","name","position","updated_at"]},"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":{"type":"object","nullable":true,"description":"The price list this catalog owns, written inline. Omit for assortment-only (base prices); send null to remove the pricing, which deletes the list. A catalog with an empty assortment prices without restricting visibility; import or curate products to make it restrictive.","properties":{"price_adjustment_percentage":{"type":"string","nullable":true},"adjust_compare_at":{"type":"boolean"}}}},"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\ncarries no order.\n\n`expand=catalog_price` adds what a buyer on this agreement pays for\neach row and where the amount comes from: `explicit` (an amount\nentered on the catalog's own price list), `automatic` (that list's\npercentage applied to the shop price) or `base` (the shop price\nitself — this agreement does not price the product).\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":"catalog_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"expand","in":"query","required":false,"description":"Comma-separated. `catalog_price` adds the resolved price to every row.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"responses":{"200":{"description":"products found, with what the agreement charges","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProduct"}},"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/catalogs/{catalog_id}/order_minimums":{"get":{"summary":"List catalog order minimums","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The least a whole order must come to under this agreement. One row per currency — Spree holds no exchange rates, so a threshold is never stated once and converted.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CatalogOrderMinimum","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"order minimums found","content":{"application/json":{}}}}},"post":{"summary":"Create a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Requires orders in one currency to reach an amount. The buyer sees the shortfall on the cart while they can still act on it; completion is refused below it.\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":"order minimum created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"string"}},"required":["currency","amount"]}}}}}},"/api/v3/admin/catalogs/{catalog_id}/order_minimums/{id}":{"patch":{"summary":"Update a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Restates one currency's threshold.\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"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"order minimum updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"}}}}}}},"delete":{"summary":"Delete a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lifts the threshold for one currency, so orders in it may come to any total.\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"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"order minimum deleted"}}}},"/api/v3/admin/catalogs/{catalog_id}/quantity_rules":{"put":{"summary":"Set catalog quantity rules","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Writes the given products' quantity terms in one request, keyed by prefixed product id. The stated pair is written to every variant of the product, which is the grain the database keeps them at. Both fields null clears that product's terms; a product not yet in the assortment is added, since a term with nothing to apply to is not a reachable state. Products absent from the payload are left alone — an agreement may name terms for thousands of SKUs. Read them back on the assortment rows: `GET /catalogs/{id}/products?expand=quantity_rule`.\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":{"204":{"description":"quantity rules set"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"terms":{"type":"object","additionalProperties":{"type":"object","properties":{"minimum_order_quantity":{"type":"integer","nullable":true},"order_multiple":{"type":"integer","nullable":true}}}}},"required":["terms"]}}}}}},"/api/v3/admin/catalogs/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Puts the agreement into effect: its audience starts seeing its\nassortment and paying its prices. Refused for a catalog nobody is\nassigned to, since activating it would reach no buyer — a channel's\ndefault catalog is reached through the channel instead, so it needs\nno assignment.\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":"catalog activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}},"/api/v3/admin/catalogs/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Takes the agreement out of effect. Everything it holds — assignments,\ncommercial terms, its price list — survives, so activating again\nresumes exactly what was there.\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":"catalog deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `automatic` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `permalink` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `products_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `sort_order` | One of `manual`, `best_selling`, `price asc`, `price desc`, `available_on desc`, `available_on asc`, `name asc`, `name desc` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Collection","sortable":["automatic","created_at","id","name","permalink","position","products_count","sort_order","updated_at"]},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed (e.g., `commission_rate`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `percentage`, `fixed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `rate` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[commission_rate_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `commission_rate_` | `code`, `created_at`, `enabled`, `id`, `include_shipping`, `kind`, `name`, `position`, `tax_inclusive`, `updated_at`, `value` |\n| `commission_rate_commission_rules_` | `created_at`, `id`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `kind`, `order_id`, `rate`, `tax_amount`, `total`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CommissionLine","sortable":["amount","created_at","currency","id","kind","order_id","rate","tax_amount","total","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-position`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `include_shipping` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `kind` | One of `percentage`, `fixed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_inclusive` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `value` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[commission_rules_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `commission_rules_` | `created_at`, `id`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `enabled`, `id`, `include_shipping`, `kind`, `name`, `position`, `tax_inclusive`, `updated_at`, `value`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CommissionRate","sortable":["code","created_at","enabled","id","include_shipping","kind","name","position","tax_inclusive","updated_at","value"]},"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 type's `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},"schema":{"type":"object","description":"JSON Schema of the type's `preferences`"},"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}/addresses":{"get":{"summary":"List company addresses","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's addresses: its sites, billing address and delivery points.\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":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[address1_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `address1` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `address2` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `company` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `postal_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Address","sortable":["address1","address2","city","company","country_code","created_at","first_name","id","last_name","phone","postal_code","state_code","updated_at"]},"responses":{"200":{"description":"addresses found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/companies/{company_id}/invitations":{"get":{"summary":"List company invitations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the invitations into this business that are still waiting to be accepted.\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":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `email`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CompanyInvitation","sortable":["created_at","email","id","updated_at"]},"responses":{"200":{"description":"invitations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyInvitation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CompanyMembership","sortable":["created_at","id","updated_at"]},"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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[certificate_number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `certificate_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reason_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `pending`, `verified`, `expired`, `revoked` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `certificate_number`, `created_at`, `expires_at`, `id`, `reason_code`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxExemptionCertificate","sortable":["certificate_number","created_at","expires_at","id","reason_code","status","updated_at"]},"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_signed_id` takes the\n`signed_id` returned by `POST /api/v3/admin/files`.\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_signed_id":{"type":"string","description":"The `signed_id` returned by POST /api/v3/admin/files."}},"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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxIdentifier","sortable":["created_at","id","updated_at"]},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `company`, `division` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `parent_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `po_number_required` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[children_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `children_` | `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at` |\n| `children_external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `children_memberships_` | `created_at`, `id`, `updated_at` |\n| `external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `memberships_` | `created_at`, `id`, `updated_at` |\n| `parent_` | `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at` |\n| `parent_external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `parent_memberships_` | `created_at`, `id`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Company","sortable":["created_at","id","kind","name","parent_id","po_number_required","updated_at"]},"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 — send the value 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/collections/{collection_id}/custom_fields":{"get":{"summary":"List collection custom fields","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the collection's custom field values.\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"}},{"name":"collection_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/sellers/{seller_id}/custom_fields":{"get":{"summary":"List seller custom fields","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the seller's custom field values.\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":"seller_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryProfile","sortable":["created_at","id","name","position","updated_at"]},"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"}}],"get":{"summary":"List origin groups","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the profile's origin groups: the sets of warehouses that each quote their own delivery rates.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryOriginGroup","sortable":["created_at","id","name","position","updated_at"]},"responses":{"200":{"description":"origin groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryOriginGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_to_sellers` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_to_sellers`, `created_at`, `id`, `name`, `seller_id`, `storefront_visible`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryMethod","sortable":["available_to_sellers","created_at","id","name","seller_id","storefront_visible","updated_at"]},"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":"object","description":"How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per that type's `schema`.","properties":{"type":{"type":"string"},"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":{"get":{"summary":"List delivery zones","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the areas delivery methods ship to, each made of countries, states or postal code ranges.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `delivery_profile_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `delivery_profile_id`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryZone","sortable":["created_at","delivery_profile_id","id","name","updated_at"]},"responses":{"200":{"description":"delivery zones found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZone"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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/delivery_methods/{delivery_method_id}/rules":{"get":{"summary":"List delivery method rules","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the conditions a delivery method must meet to be offered at checkout, such as an order total or weight range.\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":"delivery_method_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryMethodRule","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"rules found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodRule"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Integration","sortable":["created_at","id","updated_at"]},"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":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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 `POST /api/v3/admin/files`, 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":"The `signed_id` returned by POST /api/v3/admin/files."},"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"}}],"get":{"summary":"List product media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the files placed on a product, in their display 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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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":"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/products/{product_id}/variants/{variant_id}/media":{"parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}},{"name":"variant_id","in":"path","description":"Variant ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"List variant media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the files placed on one of a product's variants, in their display 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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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"]}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries":{"get":{"summary":"List deliveries","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The consignments of a parcel — one per tracking number, each with the carrier status last reported.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `pre_transit`, `in_transit`, `out_for_delivery`, `available_for_pickup`, `delivered`, `return_to_sender`, `failure`, `unknown` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Delivery","sortable":["carrier","created_at","id","status","tracking_number","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Record a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a tracked consignment to a parcel — a second box, or a freight PRO number covering several pallets. The carrier is free text.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery recorded","content":{"application/json":{}}},"422":{"description":"tracking number already recorded on this parcel","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["tracking_number"],"properties":{"tracking_number":{"type":"string","description":"Carrier tracking number, freight PRO number, or a full tracking link"},"carrier":{"type":"string","description":"Free-text carrier; detected from the number when omitted"},"service":{"type":"string","description":"Carrier service"},"tracking_url":{"type":"string","description":"Tracking page for this consignment"}}}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}":{"patch":{"summary":"Correct a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Corrects the tracking number, carrier or link. A corrected number starts the carrier journey over.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tracking_number":{"type":"string"},"carrier":{"type":"string"},"service":{"type":"string"},"tracking_url":{"type":"string"}}}}},"required":true}},"delete":{"summary":"Delete a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a hand-entered consignment. One a label minted is refused — refund the label instead.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"204":{"description":"delivery deleted"}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}/mark_delivered":{"patch":{"summary":"Mark a delivery delivered","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Staff confirming one consignment arrived. The parcel becomes delivered once every one of its consignments has.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery marked delivered","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When it arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification when the parcel completes."}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels":{"get":{"summary":"List shipping labels","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every label bought or uploaded for a parcel, refunded ones included.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `source` | One of `purchased`, `uploaded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `purchased`, `refund_requested`, `refunded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `source`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ShippingLabel","sortable":["carrier","created_at","id","source","status","tracking_number","updated_at"]},"responses":{"200":{"description":"labels found","content":{"application/json":{}}}}},"post":{"summary":"Buy or record a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"With no body, buys the label through the parcel's carrier account. With a `file`, records a label bought elsewhere. Either way the tracking number becomes a delivery on the parcel.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"201":{"description":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Signed blob id of an uploaded label file; its presence records rather than buys"},"tracking_number":{"type":"string","description":"Number printed on an uploaded label"},"carrier":{"type":"string","description":"Free-text carrier; detected from the number when omitted"},"service":{"type":"string","description":"Carrier service the label was bought at"},"cost":{"type":"string","description":"What the merchant paid the carrier"},"currency":{"type":"string","description":"Currency of the cost"},"file_format":{"type":"string","enum":["pdf","png","zpl"],"description":"Label file format; taken from the file when omitted"},"tracking_url":{"type":"string","description":"Tracking page for the consignment"}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels/{id}":{"get":{"summary":"Get a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"One label, with what it cost and where to print it from.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"200":{"description":"label found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an uploaded label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an uploaded label. A purchased label is refunded instead, so the postage history stays honest.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"204":{"description":"label deleted"}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels/{id}/refund":{"patch":{"summary":"Refund a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the carrier to refund a purchased label. The consignment it minted is removed when the parcel never shipped.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"200":{"description":"refund filed","content":{"application/json":{}}},"422":{"description":"uploaded labels cannot be refunded","content":{"application/json":{}}}}}},"/api/v3/admin/package_types":{"get":{"summary":"List package types","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's packaging vocabulary: the box it ships parcels in\nand the cartons, pallets and containers a wholesale order leaves on.\n\n`volume` is the cubic meters the package occupies, converted from\nwhatever unit its dimensions were recorded in — the figure freight\nvolume rules compare against. It is null until all three sides are\nmeasured.\n\n\n**Required scope:** `read_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `box`, `envelope`, `carton`, `pallet`, `container` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `default`, `id`, `kind`, `name`, `seller_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PackageType","sortable":["created_at","default","id","kind","name","seller_id","updated_at"]},"responses":{"200":{"description":"package types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PackageType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a kind of packaging to the store.\n\n`weight` is the empty package's own weight, added to content weight on\nevery quote; `max_weight` is what it can hold. Setting `default` makes\nthis the box every parcel quote is built on, and demotes whichever row\nheld that before.\n\nA variant references a `carton`-kind row to say what it is packed\ninto; other kinds are the merchant's own vocabulary.\n\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"]},"length":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"weight":{"type":"number"},"max_weight":{"type":"number"},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"default":{"type":"boolean"}},"required":["name","kind"]}}}}}},"/api/v3/admin/package_types/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Package type ID","schema":{"type":"string"}}],"get":{"summary":"Get a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single package type by prefixed ID.\n\n**Required scope:** `read_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}},"404":{"description":"package type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a package type. Every product packed in it follows the new geometry.\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"]},"length":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"weight":{"type":"number"},"max_weight":{"type":"number"},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"default":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a kind of packaging. Refused while any variant is packed into\nit — repack those products first.\n\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type deleted"}}}},"/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`expand=price_list_price` adds what the list charges for each variant, with its quantity\nbreaks as tiers, the same reading a catalog's products carry.\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":"price_list_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"expand","in":"query","required":false,"description":"Comma-separated. `price_list_price` adds the resolved price to every row.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"responses":{"200":{"description":"products found, with what the list charges","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceListProduct"}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_types_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ProductType","sortable":["created_at","id","name","updated_at"]},"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/purchase_orders":{"get":{"summary":"List purchase orders","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stock bought from suppliers. A purchase order carries what a purchase\nhas and a stock transfer does not: a supplier, a unit cost per line and\nan expected arrival date.\n\nOrdered units never count toward availability. Nothing here changes\n`count_on_hand` until `receive` runs, because a merchant who has\nordered stock does not have it.\n\nStatuses are `draft`, `ordered`, `partially_received`, `received`, `over_received` and\n`canceled`. Each move between them is its own endpoint, not a `PATCH`\nthat writes `status`.\n\nFilter with Ransack predicates such as `q[status_eq]`,\n`q[supplier_id_eq]` or `q[expected_at_lteq]`. Expand `items`,\n`supplier` and `destination_location`.\n\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number and reference (partial, case-insensitive)."},{"name":"q[closed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `closed`."},{"name":"q[open]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `open`."},{"name":"q[overdue]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `overdue`."},{"name":"q[past_cancel_by]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `past_cancel_by`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, supplier, destination_location","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `cancel_by` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `closed_short_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `destination_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `expected_at` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `ordered_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `ordered`, `partially_received`, `received`, `over_received`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `supplier_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[destination_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `destination_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `destination_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `items_` | `created_at`, `id`, `quantity_ordered`, `quantity_received`, `quantity_rejected`, `unit_cost`, `updated_at`, `variant_id` |\n| `items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `supplier_` | `city`, `contact_name`, `country_code`, `created_at`, `email`, `id`, `name`, `phone`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `cancel_by`, `closed_short_at`, `created_at`, `currency`, `destination_location_id`, `expected_at`, `id`, `number`, `ordered_at`, `received_at`, `reference`, `status`, `supplier_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PurchaseOrder","sortable":["cancel_by","closed_short_at","created_at","currency","destination_location_id","expected_at","id","number","ordered_at","received_at","reference","status","supplier_id","updated_at"]},"responses":{"200":{"description":"purchase orders found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrder"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Drafts an order. Nothing is on order and nothing touches availability\nuntil the order is marked as ordered and then received.\n\n`currency` defaults to the store's; set it for a foreign-currency\norder. `expected_at` is a calendar date (`yyyy-mm-dd`) — the day the\nsupplier promised means the same day in every timezone.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"404":{"description":"supplier belongs to another store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"supplier_id":{"type":"string"},"destination_location_id":{"type":"string"},"currency":{"type":"string","nullable":true},"expected_at":{"type":"string","format":"date","nullable":true},"reference":{"type":"string","nullable":true,"description":"The supplier's own order number"},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity_ordered":{"type":"integer"},"unit_cost":{"type":"string"}},"required":["variant_id","quantity_ordered"]}},"metadata":{"type":"object","nullable":true}},"required":["supplier_id","destination_location_id"]}}},"required":true}}},"/api/v3/admin/purchase_orders/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"get":{"summary":"Get a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, supplier, destination_location","schema":{"type":"string"}}],"responses":{"200":{"description":"purchase order found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"404":{"description":"purchase order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/purchase_orders/{id}/mark_ordered":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Place the order with the supplier","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a `draft` to `ordered`: the lines are frozen and `ordered_at` is\nstamped. Availability is still untouched — ordered stock is not stock\nthe merchant has.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}}}},"/api/v3/admin/purchase_orders/{purchase_order_id}/stock_receipts":{"parameters":[{"name":"purchase_order_id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"get":{"summary":"List the deliveries booked against an order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Each delivery the dock counted in, newest first — with its packing-slip reference and what it accepted and refused.\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `receivable_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `receivable_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_by_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `receivable_id`, `receivable_type`, `received_at`, `received_by_id`, `received_by_type`, `reference`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReceipt","sortable":["created_at","id","number","receivable_id","receivable_type","received_at","received_by_id","received_by_type","reference","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Book in a delivery","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The moment purchased goods first count toward availability. Records\none delivery as a stock receipt: what this delivery brought, per line,\nnot a running total — a second delivery adds to the first.\n\n`quantity_accepted` reaches the shelf; `quantity_rejected` is refused\nand recorded with a `rejection_reason` (`damaged`, `wrong_item`,\n`expired` or `other`), never stocked. Omit `items` to book in\neverything still outstanding, intact.\n\nEach `received` stock movement carries the line's `unit_cost` and\nnames the receipt, so a delivery can be reconciled against the ledger.\n\nThe order stays `partially_received` while any line is still owed,\nsettles in `received` once every line has what it expected, and in\n`over_received` once any line has more.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"delivery booked in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceipt"}}}},"422":{"description":"order has not been placed yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","nullable":true,"description":"The supplier's delivery note or packing slip"},"received_at":{"type":"string","format":"date-time","nullable":true,"description":"Defaults to now"},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"quantity_accepted":{"type":"integer"},"quantity_rejected":{"type":"integer"},"rejection_reason":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}},"required":["id"]}}}}}}}}},"/api/v3/admin/purchase_orders/{id}/mark_draft":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Take an order back to draft","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Reopens a placed order for editing. Only while no delivery has been booked against it; `ordered_at` is cleared.\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"order back in draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}}}},"/api/v3/admin/purchase_orders/{id}/close":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Close an order short","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Ends a partially received order whose balance the supplier will not\ndeliver. Nothing moves: what arrived stays on the shelf, the\noutstanding count stays on each line, and the order settles in\n`received` with `closed_short_at` and the `reason` recorded.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"order closed short","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/purchase_orders/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Cancel a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Closes what is still outstanding. Nothing is unwound: a purchase order\nnever moved stock until units were received, and units already received\nstay on the shelf because the merchant has them.\n\nA `reason` is appended to the order's notes.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/reporting/saved_reports":{"get":{"summary":"List saved reports","tags":["Reports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's saved reports, each a named query staff can run again.\n\n**Required scope:** `read_reports` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seeded` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `seeded`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SavedReport","sortable":["created_at","id","name","seeded","updated_at"]},"responses":{"200":{"description":"saved reports found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SavedReport"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerRequirement","sortable":["created_at","id","name","position","updated_at"]},"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 type's `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."},"schema":{"type":"object","description":"JSON Schema of the type's `preferences`"}}}}}}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `contact_email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `pending`, `invited`, `canceled`, `onboarding`, `ready_for_review`, `approved`, `rejected`, `suspended` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Seller","sortable":["contact_email","created_at","id","name","status","updated_at"]},"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_signed_id":{"type":"string","nullable":true,"description":"The `signed_id` returned by POST /api/v3/admin/files. Send `null` to remove the image, or omit the key to leave it alone. Same for `square_logo_signed_id` and `cover_photo_signed_id`."},"square_logo_signed_id":{"type":"string","nullable":true},"cover_photo_signed_id":{"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/sellers/{seller_id}/balances":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"List a seller's balances","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Where one seller stands with the marketplace, one row per currency:\nwhat they have earned (completed transfers, refund reversals\nincluded), what has been paid to them, what is still owed, and\nearnings the payout provider has not yet confirmed.\n\nComputed from the ledger rather than stored, so the rows carry no id.\n\n\n**Required scope:** `read_payouts` (for API-key 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":"balances listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerBalance"}}},"required":["data"]}}}},"404":{"description":"seller not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{seller_id}/payouts":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"post":{"summary":"Settle a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sweeps everything this seller is owed into a payout — one per currency,\nsince nothing is ever converted between them.\n\nThis is what the `manual` payout interval means: the scheduled sweep\nruns on each seller's own interval and skips anyone set to `manual`,\nleaving the operator to decide when. It also settles any other seller\nearly.\n\nIt records the settlement rather than sending money: the built-in\nprovider waits to be told the bank transfer went out, which is\n`PATCH /api/v3/admin/seller_payouts/{id}/complete`.\n\nAnswers `422` when there is nothing to settle — no payout account,\nnothing unsettled, or a balance below the seller's minimum.\n\n\n**Required scope:** `write_payouts` (for API-key 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 settled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerPayout"}}},"required":["data"]}}}},"422":{"description":"nothing to settle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{seller_id}/requirement_submissions":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"List a seller's requirement submissions","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What this seller submitted against the marketplace requirements, with the review decision on each.\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,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reviewed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `accepted`, `rejected`, `waived` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[requirement_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `requirement_` | `created_at`, `id`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `reviewed_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerRequirementSubmission","sortable":["created_at","id","reviewed_at","status","updated_at"]},"responses":{"200":{"description":"submissions listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerRequirementSubmission"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/seller_transfers":{"get":{"summary":"List seller transfers","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The fund ledger: what each seller earned from an order, and any\nreversals. Read-only, since fulfilment and refunds write it.\n\n\n**Required scope:** `read_payouts` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of reference (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `earning`, `refund_reversal` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `payout_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `provider` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed`, `unresolved` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[payout_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `payout_` | `amount`, `created_at`, `currency`, `id`, `period_end`, `period_start`, `provider`, `reference`, `seller_id`, `status`, `updated_at` |\n| `payout_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `refund_` | `created_at`, `id`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `kind`, `order_id`, `payout_id`, `provider`, `reference`, `seller_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerTransfer","sortable":["amount","created_at","currency","id","kind","order_id","payout_id","provider","reference","seller_id","status","updated_at"]},"responses":{"200":{"description":"transfers listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerTransfer"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/seller_payouts":{"get":{"summary":"List seller payouts","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Settlements to sellers, each batching the transfers that had\naccumulated since the last. `pending` and `processing` payouts are\nstill owed; `completed` ones reached the seller.\n\n\n**Required scope:** `read_payouts` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of reference (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `period_end` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `period_start` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `provider` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed`, `unresolved` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `period_end`, `period_start`, `provider`, `reference`, `seller_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerPayout","sortable":["amount","created_at","currency","id","period_end","period_start","provider","reference","seller_id","status","updated_at"]},"responses":{"200":{"description":"payouts listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerPayout"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/seller_payouts/{id}/complete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller payout prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Mark a payout paid","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the money reached the seller, which is what debits their\nbalance — a balance is earnings less *completed* settlements.\n\nThis is the step the built-in provider waits for: it files the\nsettlement when the payout is created and expects an operator to say\nthe bank transfer went out. A connected provider marks its own payouts\npaid when its webhook reports the money landed.\n\nSend the provider's own id for the transfer as `reference` when there\nis one. Completing a payout that is already complete answers `200`\nwithout recording it twice, so a redelivered webhook or a double click\nis safe.\n\n\n**Required scope:** `write_payouts` (for API-key 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":"payout completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerPayout"}}}},"404":{"description":"payout not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","description":"The provider's own id for the settlement, when one made it"}}}}}}}},"/api/v3/admin/stock_levels":{"get":{"summary":"List stock levels","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"One row per variant per stock location, carrying every figure the\nInventory page shows: `count_on_hand` (on hand), `allocated_count`\n(committed to placed orders), `reserved_count` (held by checkouts in\nprogress), `available_count` (on hand minus committed) and\n`incoming_count` (on its way on an open purchase order or a transfer\nin transit). The variant and location are named flat on the row\n(`variant_name`, `variant_sku`, `stock_location_name`, `thumbnail_url`)\nso a list needs no expansion.\n\nFilter with `q[stock_location_id_eq]`, `q[variant_id_eq]` or\n`q[variant_sku_or_variant_product_name_cont]`.\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,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of variant sku and variant product name (partial, case-insensitive)."},{"name":"q[with_stock_status][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_stock_status` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[allocated_count_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `allocated_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `count_on_hand` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `incoming_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reserved_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `stock_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[stock_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockLevel","sortable":["allocated_count","count_on_hand","created_at","id","incoming_count","reserved_count","stock_location_id","updated_at","variant_id"]},"responses":{"200":{"description":"stock levels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLevel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[reason_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `exchange_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `fulfillment_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `received`, `allocated`, `shipped`, `released`, `adjusted` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reason` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `return_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_level_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_receipt_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_transfer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `unit_cost` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[stock_level_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `stock_level_` | `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id` |\n| `stock_level_stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_level_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `exchange_id`, `fulfillment_id`, `id`, `kind`, `order_id`, `purchase_order_id`, `quantity`, `reason`, `return_id`, `stock_level_id`, `stock_receipt_id`, `stock_transfer_id`, `unit_cost`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockMovement","sortable":["created_at","exchange_id","fulfillment_id","id","kind","order_id","purchase_order_id","quantity","reason","return_id","stock_item_id","stock_level_id","stock_receipt_id","stock_transfer_id","unit_cost","updated_at"]},"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"}}}}}}},"/api/v3/admin/stock_reservations":{"get":{"summary":"List stock reservations","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the stock held for orders that are being checked out, so it cannot be sold twice before they complete or the hold expires.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `line_item_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `stock_level_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[line_item_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `line_item_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `line_item_order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `line_item_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `line_item_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `stock_level_` | `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id` |\n| `stock_level_stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_level_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `expires_at`, `id`, `line_item_id`, `order_id`, `quantity`, `stock_level_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReservation","sortable":["created_at","expires_at","id","line_item_id","order_id","quantity","stock_item_id","stock_level_id","updated_at"]},"responses":{"200":{"description":"stock reservations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockReservation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/stock_transfers":{"get":{"summary":"List stock transfers","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stock moving between two of the merchant's own warehouses.\n\nA transfer is a trip, not an instant. Units leave the source when the\ntransfer is marked in transit and land at the destination when somebody\ncounts them in — in between they are in flight, gone from one shelf and\nnot yet on the other.\n\nStatuses are `draft`, `ready_to_ship`, `in_transit`,\n`partially_received`, `received`, `over_received` and `canceled`. Each move between them\nis its own endpoint, not a `PATCH` that writes `status`.\n\nReceiving from a supplier is a purchase order, not a transfer with a\nmissing source.\n\nFilter with Ransack predicates such as `q[status_eq]`,\n`q[source_location_id_eq]` or `q[number_or_reference_cont]`. Expand\n`items`, `source_location` and `destination_location`.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number and reference (partial, case-insensitive)."},{"name":"q[closed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `closed`."},{"name":"q[open]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `open`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, source_location, destination_location","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `closed_short_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `destination_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `shipped_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `source_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `draft`, `ready_to_ship`, `in_transit`, `partially_received`, `received`, `over_received`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[destination_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `destination_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `destination_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `items_` | `created_at`, `id`, `quantity_received`, `quantity_rejected`, `quantity_shipped`, `updated_at`, `variant_id` |\n| `items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `source_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `source_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `closed_short_at`, `created_at`, `destination_location_id`, `id`, `number`, `received_at`, `reference`, `shipped_at`, `source_location_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockTransfer","sortable":["closed_short_at","created_at","destination_location_id","id","number","received_at","reference","shipped_at","source_location_id","status","updated_at"]},"responses":{"200":{"description":"stock transfers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockTransfer"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Persists a draft — a packing list the merchant can still edit. Nothing\nmoves until the transfer is marked in transit.\n\nA draft may legitimately open empty and gain lines as the merchant\npacks. Both warehouses are required and must belong to the same store.\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 transfer created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"404":{"description":"warehouse belongs to another store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_location_id":{"type":"string"},"destination_location_id":{"type":"string"},"reference":{"type":"string","nullable":true,"description":"The merchant's own label for the trip"},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity_shipped":{"type":"integer"}},"required":["variant_id","quantity_shipped"]}},"metadata":{"type":"object","nullable":true}},"required":["source_location_id","destination_location_id"]}}},"required":true}}},"/api/v3/admin/stock_transfers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**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":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, source_location, destination_location","schema":{"type":"string"}}],"responses":{"200":{"description":"stock transfer found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"404":{"description":"stock transfer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"summary":"Delete a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Drafts only. Past `draft` the transfer describes a box that physically\nexists, so it is cancelled rather than deleted — a 422 says so.\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 transfer deleted"}}}},"/api/v3/admin/stock_transfers/{id}/mark_ready":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Mark a transfer ready to ship","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Freezes the lines so the warehouse and the merchant are looking at the\nsame list. Nothing leaves the shelf yet.\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":"transfer is ready to ship","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}}}},"/api/v3/admin/stock_transfers/{id}/mark_in_transit":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Send a transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The moment stock leaves the source warehouse: `shipped` movements are\nwritten against the source's levels and `shipped_at` is stamped. The\ndestination is deliberately untouched — the units are in flight.\n\nRefused with a 422 when the source does not hold enough. Pass\n`force: true` to record the departure anyway: a merchant forcing it has\ndecided the box left whatever the ledger claims.\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":"transfer is in transit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Ship even if it drives the source below zero"}}}}}}}},"/api/v3/admin/stock_transfers/{stock_transfer_id}/stock_receipts":{"parameters":[{"name":"stock_transfer_id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"get":{"summary":"List the deliveries counted in against a transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Each delivery the destination counted in, with what it accepted and refused.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `receivable_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `receivable_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_by_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `receivable_id`, `receivable_type`, `received_at`, `received_by_id`, `received_by_type`, `reference`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReceipt","sortable":["created_at","id","number","receivable_id","receivable_type","received_at","received_by_id","received_by_type","reference","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Count a delivery in","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records one delivery the destination warehouse counted in, as a stock\nreceipt. Partial receipt is the normal case: ten left, eight arrived,\ntwo were crushed in transit. Quantities are this delivery's counts —\na second box adds to the first rather than restating it.\n\n`quantity_accepted` lands on the destination's shelf;\n`quantity_rejected` is refused and recorded with a `rejection_reason`\n(`damaged`, `wrong_item`, `expired` or `other`), never stocked. A\nrefused unit still arrived, so it counts toward the trip being over.\nOmit `items` to count in everything still outstanding, intact.\n\nThe transfer stays `partially_received` while units are still on the\nroad, settles in `received` once everything has arrived, and in\n`over_received` once more arrived than was shipped.\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":"delivery counted in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceipt"}}}},"422":{"description":"transfer has not shipped yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","nullable":true},"received_at":{"type":"string","format":"date-time","nullable":true,"description":"Defaults to now"},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"quantity_accepted":{"type":"integer"},"quantity_rejected":{"type":"integer"},"rejection_reason":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}},"required":["id"]}}}}}}}}},"/api/v3/admin/stock_transfers/{id}/mark_draft":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Take a transfer back to draft","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unfreezes a ready-to-ship transfer so its lines can be changed. Nothing has left the source, so nothing is undone.\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":"transfer back in draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}}}},"/api/v3/admin/stock_transfers/{id}/close":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Close a transfer short","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Ends a partially received transfer whose missing units are not going\nto turn up. Nothing moves — they already left the source — and the\ntransfer settles in `received` with `closed_short_at` and the\n`reason` recorded, the outstanding count left on each line.\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":"transfer closed short","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/stock_transfers/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Cancel a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Calls the trip off.\n\nCancelling a draft or a packed transfer costs nothing — no stock has\nmoved. Cancelling one already in transit needs `on_in_transit`, because\nthe units are physically gone from the source: either they come back\n(`restock`, as if the transfer had never shipped) or they are written\noff as lost (`write_off`). There is no default — guessing would either\ninvent stock or destroy it — so an in-flight cancellation without it is\nrefused with a 422.\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":"transfer cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"422":{"description":"in-transit cancellation needs a decision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"on_in_transit":{"type":"string","enum":["restock","write_off"],"description":"Required once the units have left the source"},"reason":{"type":"string","nullable":true,"description":"Recorded against the written-off lines"}}}}}}}},"/api/v3/admin/suppliers":{"get":{"summary":"List suppliers","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Who the merchant buys stock from. A supplier is an address-book entry\nwith a purchasing history — not a party that sells on the store, which\nis a seller.\n\nSuppliers belong to one store, and are soft-deleted so the purchase\norders that name them stay readable.\n\nFilter with Ransack predicates such as\n`q[name_or_contact_name_or_email_cont]` or `q[country_code_eq]`.\n\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name, contact name, and email (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `contact_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `city`, `contact_name`, `country_code`, `created_at`, `email`, `id`, `name`, `phone`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Supplier","sortable":["city","contact_name","country_code","created_at","email","id","name","phone","updated_at"]},"responses":{"200":{"description":"suppliers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a supplier to this store's address book. The address is inline —\nstreet, city, state and country live on the supplier itself, the same\nshape a stock location uses.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true}},"required":["name"]}}},"required":true}}},"/api/v3/admin/suppliers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Supplier ID","schema":{"type":"string"}}],"get":{"summary":"Get a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"404":{"description":"supplier not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}}}}},"required":true}},"delete":{"summary":"Delete a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the supplier, so the purchase orders naming it stay\nreadable. Refused with a 422 while a purchase order still points at it.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier deleted"}}}}},"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 short names, e.g. [\"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"]},"PreferenceSchema":{"type":"object","description":"The JSON Schema (draft 2020-12) of a type's `preferences`: one property per setting, with `format` (`money`, `currency`, `iso-country`, `prefixed-id`, …), `enum`, `default`, `x-spree-secret` for a secret and `x-spree-prefix` for an id list. Unknown keys are refused.","additionalProperties":true},"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"]},"Actor":{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"label":{"type":"string","nullable":true}},"required":["id","type","label"],"x-typelizer":true},"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","enum":["publishable","secret"]},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by_label":{"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","created_by_type","created_by_label"],"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"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","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},"po_number_required":{"type":"boolean"},"po_document_filename":{"type":"string","nullable":true},"po_document_byte_size":{"type":"number","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"po_number":{"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},"adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"fee_total":{"type":"string","nullable":true},"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"}},"order_minimum":{"type":"string","nullable":true},"order_minimum_shortfall":{"type":"string","nullable":true},"below_order_minimum":{"type":"boolean","nullable":true},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true},"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","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","adjustment_total","discount_total","tax_total","included_tax_total","additional_tax_total","total","gift_card_total","amount_due","delivery_total","fee_total","store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","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},"CatalogOrderMinimum":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"}},"required":["id","currency","created_at","updated_at","amount"],"x-typelizer":true},"CatalogPrice":{"type":"object","properties":{"id":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"currency":{"type":"string"},"source":{"type":"string","enum":["explicit","automatic","base"]},"break_count":{"type":"number"},"amount":{"type":"string"},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPriceTier"}}},"required":["id","label","sku","currency","source","break_count","amount","tiers"],"x-typelizer":true},"CatalogPriceTier":{"type":"object","properties":{"min_quantity":{"type":"number"},"amount":{"type":"string"}},"required":["min_quantity","amount"],"x-typelizer":true},"CatalogProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"quantity_rule":{"allOf":[{"$ref":"#/components/schemas/CatalogProductTerm"}],"nullable":true},"catalog_variants":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPrice"}}},"required":["id","name","thumbnail_url"],"x-typelizer":true},"CatalogProductTerm":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"product_name":{"type":"string","nullable":true},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"mixed":{"type":"boolean"}},"required":["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":true},"CatalogQuantityRule":{"type":"object","properties":{"id":{"type":"string"},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant_id":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"product_name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":true},"Catalog":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"position":{"type":"number","nullable":true},"metadata":{"type":"object","nullable":true},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"products_count":{"type":"number"},"pricing_strategy":{"type":"string"},"order_minimums":{"type":"array","items":{"$ref":"#/components/schemas/CatalogOrderMinimum"}},"price_list":{"$ref":"#/components/schemas/PriceList"},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/CatalogAssignment"}}},"required":["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"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","nullable":true,"enum":["public","prices_hidden","login_required"]},"guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_routing_strategy":{"type":"string","nullable":true,"description":"Order routing strategy; null inherits the store setting. Built-in: rules. Extensions may register more."},"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","created_at","updated_at","order_routing_strategy","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"},"pre_tax_amount":{"type":"string"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"tax_total":{"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","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","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":{"anyOf":[{"type":"string","enum":["open","approved","resolved","denied","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id","created_by_type"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["is_equal_to","is_not_equal_to","contains","does_not_contain"]},"type":{"type":"string","description":"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},"required":["id","value","match_policy","type"],"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","enum":["all","any"]},"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","enum":["percentage","fixed"]},"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"},"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},"commission_rate":{"$ref":"#/components/schemas/CommissionRate"}},"required":["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","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","enum":["percentage","fixed"]},"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","description":"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},"commission_rate_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/CommissionRulePreferences"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"seller_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"sellers":{"type":"array","items":{"$ref":"#/components/schemas/Seller"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}},"required":["id","created_at","updated_at","type","commission_rate_id","preferences","product_ids","seller_ids","category_ids"],"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","enum":["pending","accepted","revoked","expired"]},"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","enum":["company","division"]},"po_number_required":{"type":"boolean"},"parent_id":{"type":"string","nullable":true},"ancestors":{"type":"array","items":{"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","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":true},"ConsentRecord":{"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"source":{"type":"string","enum":["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},"accepted":{"type":"boolean"},"email":{"type":"string","nullable":true},"ip_address":{"type":"string","nullable":true},"created_at":{"type":"string"},"recorded_at":{"type":"string","nullable":true},"documents":{"type":"array","items":{"type":"object"}}},"required":["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"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"]},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"resource_type":{"type":"string","description":"Shorthand of the resource the field attaches to, for example product, variant, order, customer or category. Discover the full list from the resource_types endpoint; extensions may register more."}},"required":["id","namespace","key","label","field_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at","resource_type"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","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"},"email_marketing_consent_updated_at":{"type":"string","nullable":true},"full_name":{"type":"string"},"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"},"email_marketing_consent_source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"anonymized_at":{"type":"string","nullable":true},"anonymized":{"type":"boolean"},"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"},"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"}},"companies":{"type":"array","items":{"$ref":"#/components/schemas/Company"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DashboardCounter":{"type":"object","properties":{"key":{"type":"string","description":"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},"value":{"type":"number"},"link":{"type":"object","nullable":true,"description":"The list filter that shows exactly the rows counted, or null when no list can."},"nav":{"type":"string","nullable":true,"description":"Sidebar entry key this count badges, or null."}},"required":["key","value","link","nav"],"x-typelizer":true},"DataRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["access","erasure"]},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"requested_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"email":{"type":"string"},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"requested_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"}},"required":["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},"preferences":{"$ref":"#/components/schemas/DeliveryMethodRulePreferences"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","preferences","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},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"available_to_sellers":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"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"}},"fulfillment_provider":{"type":"string","description":"Fulfillment provider. Built-in: manual, digital, pickup, pickup_point. Provider gems register more (e.g. easy_post)."},"pickup_point_provider":{"type":"string","nullable":true,"description":"Pickup point network. None built in; provider gems register them."},"rate_provider":{"type":"string","nullable":true,"description":"Rate provider; null prices through the calculator. Built-in: internal, freight. Provider gems register more (e.g. easy_post)."},"calculator":{"allOf":[{"$ref":"#/components/schemas/DeliveryMethodCalculator"}],"nullable":true}},"required":["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","storefront_visible","tracking_url","available_to_sellers","created_at","updated_at","deleted_at","markup_flat","markup_percent","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","fulfillment_provider","pickup_point_provider","rate_provider","calculator"],"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","description":"Profile kind. Built-in: shipping, digital. Extensions may register more."},"digital":{"type":"boolean"},"offers_pickup":{"type":"boolean"},"offers_shipping":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"origin_groups":{"type":"array","items":{"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},"unpriced":{"type":"boolean"},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true},"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","unpriced","freight_summary","metadata","created_at","updated_at"],"x-typelizer":true},"Delivery":{"type":"object","properties":{"id":{"type":"string"},"tracking_number":{"type":"string"},"carrier":{"type":"string","nullable":true},"carrier_name":{"type":"string","nullable":true},"service":{"type":"string","nullable":true},"status":{"type":"string","enum":["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},"tracking_url":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"details":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"shipping_label_id":{"type":"string","nullable":true}},"required":["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"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},"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_settings":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"provider_type":{"type":"string","nullable":true,"description":"Digital asset provider; null is an uploaded file. Built-in: file. Extensions may register more."},"provider_name":{"type":"string","description":"Digital asset provider name. Built-in: File. Extensions may register more."},"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_settings","created_at","updated_at","provider_type","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","enum":["promotion","manual"]},"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"},"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","metadata","created_at","updated_at"],"x-typelizer":true},"EmailTemplateDraft":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"lock_version":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by_id":{"type":"string","nullable":true},"updated_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"updated_by":{"$ref":"#/components/schemas/Actor"}},"required":["id","subject","body","lock_version","created_at","updated_at","updated_by_id","updated_by_type"],"x-typelizer":true},"EmailTemplatePreview":{"type":"object","properties":{"id":{"type":"string","nullable":true},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"email_key":{"type":"string"},"variables":{"type":"object"}},"required":["id","subject","html","text","email_key","variables"],"x-typelizer":true},"EmailTemplateRevision":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"created_at":{"type":"string"},"published_by_id":{"type":"string","nullable":true},"published_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"published_by":{"$ref":"#/components/schemas/Actor"}},"required":["id","subject","body","created_at","published_by_id","published_by_type"],"x-typelizer":true},"EmailTemplateSampleRecord":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"created_at":{"type":"string"}},"required":["id","label","created_at"],"x-typelizer":true},"EmailTemplate":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"language":{"type":"string"},"customized_languages":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["email","layout","partial"]},"customized":{"type":"boolean"},"published_at":{"type":"string","nullable":true},"default_subject":{"type":"string","nullable":true},"default_body":{"type":"string"},"published_language":{"type":"string","nullable":true},"default_changed":{"type":"boolean"},"base_subject":{"type":"string","nullable":true},"base_body":{"type":"string","nullable":true},"draft":{"allOf":[{"$ref":"#/components/schemas/EmailTemplateDraft"}],"nullable":true}},"required":["id","key","subject","body","language","customized_languages","kind","customized","published_at","default_subject","default_body","published_language","default_changed","base_subject","base_body","draft"],"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_tax_total":{"type":"string"},"new_tax_total":{"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_tax_total","new_tax_total","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":{"anyOf":[{"type":"string","enum":["requested","approved","received","fulfilled","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"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","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type"],"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":{"anyOf":[{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty","exchange"]},{"type":"string"}],"description":"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"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","metadata","created_at","updated_at"],"x-typelizer":true},"FileUpload":{"type":"object","properties":{"signed_id":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"number"},"visibility":{"type":"string","enum":["public","private"]},"expires_at":{"type":"string"},"upload":{"allOf":[{"$ref":"#/components/schemas/FileUploadTarget"}],"nullable":true}},"required":["signed_id","filename","content_type","byte_size","visibility","expires_at","upload"],"x-typelizer":true},"FileUploadTarget":{"type":"object","properties":{"method":{"type":"string"},"url":{"type":"string"},"headers":{"type":"object"}},"required":["method","url","headers"],"x-typelizer":true},"FreightSummaryLine":{"type":"object","properties":{"variant_id":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"units":{"type":"number"},"cartons":{"type":"number","nullable":true},"pallets":{"type":"number","nullable":true},"units_per_carton":{"type":"number","nullable":true},"cartons_per_pallet":{"type":"number","nullable":true},"complete":{"type":"boolean"},"weight_per_carton":{"type":"string","nullable":true},"volume":{"type":"string"},"weight":{"type":"string"}},"required":["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":true},"FreightSummary":{"type":"object","properties":{"total_units":{"type":"number"},"total_cartons":{"type":"number"},"total_pallets":{"type":"number","nullable":true},"total_volume":{"type":"string"},"total_weight":{"type":"string"},"complete":{"type":"boolean"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/FreightSummaryLine"}}},"required":["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"anyOf":[{"type":"string","enum":["on_hand","backordered","shipped","returned"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"unpriced":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["unfulfilled","fulfilled","delivered","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"fulfillment_type":{"type":"string","enum":["shipping","digital","pickup","pickup_point"]},"fulfilled_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"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"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"documents":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"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","pickup_point_data","selected_delivery_rate_id","unpriced","cost","total","discount_total","additional_tax_total","included_tax_total","tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","created_at","updated_at","adjustment_total","pre_tax_amount","order_id","stock_location_id","documents","labels","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":{"anyOf":[{"type":"string","enum":["active","partially_redeemed","redeemed","canceled","expired"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"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","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":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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,"description":"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},"status":{"anyOf":[{"type":"string","enum":["pending","mapping","completed_mapping","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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},"delimiter":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"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","delimiter","price_list_id","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","description":"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},"group":{"type":"string","nullable":true},"preferences":{"$ref":"#/components/schemas/IntegrationPreferences"}},"required":["id","name","active","created_at","updated_at","type","group","preferences"],"x-typelizer":true},"InvitationAcceptanceLink":{"type":"object","properties":{"id":{"type":"string"},"acceptance_url":{"type":"string"}},"required":["id","acceptance_url"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","accepted"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"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","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"},"total":{"type":"string"},"adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"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"},"price_source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"catalog_price":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"price_list_name":{"type":"string","nullable":true},"catalog_id":{"type":"string","nullable":true},"catalog_name":{"type":"string","nullable":true},"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","total","adjustment_total","additional_tax_total","included_tax_total","discount_total","pre_tax_amount","discounted_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","price_list_id","price_list_name","catalog_id","catalog_name","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"}},"country_isos":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tax_provider":{"type":"string","nullable":true,"description":"Tax provider; null uses the store default. Built-in: internal. Provider gems register more."}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","country_isos","supported_locales","created_at","updated_at","tax_provider"],"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","enum":["image","video","external_video"]},"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},"MembershipProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","name","thumbnail_url"],"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","enum":["dropdown","color_swatch","buttons"]},"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},"OrderCancellationReason":{"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},"OrderGroup":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"email":{"type":"string","nullable":true},"currency":{"type":"string"},"total":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true,"enum":["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},"payment_status":{"type":"string","nullable":true,"enum":["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},"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"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}},"required":["id","number","email","currency","total","item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","confirmation_delivered","store_owner_notification_delivered","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","description":"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},"channel_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/OrderRoutingRulePreferences"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"withdrawal_period_ends_at":{"type":"string","nullable":true},"within_withdrawal_period":{"type":"boolean"},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"po_document_filename":{"type":"string","nullable":true},"po_document_byte_size":{"type":"number","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"po_number":{"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,"enum":["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},"payment_status":{"type":"string","nullable":true,"enum":["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"total":{"type":"string"},"gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"delivery_total":{"type":"string"},"fee_total":{"type":"string"},"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","enum":["draft","placed","canceled"]},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"metadata":{"type":"object"},"cancel_note":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment_total":{"type":"string"},"commission_amount_total":{"type":"string"},"commission_tax_total":{"type":"string"},"commission_total":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"po_document_url":{"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},"approver_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"approver":{"$ref":"#/components/schemas/Actor"},"canceler_id":{"type":"string","nullable":true},"canceler_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"canceler":{"$ref":"#/components/schemas/Actor"},"created_by_id":{"type":"string","nullable":true},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"cancel_reason_id":{"type":"string","nullable":true},"cancel_reason_name":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"payment_splits":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSplit"}},"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"},"cancel_reason":{"$ref":"#/components/schemas/OrderCancellationReason"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true}},"required":["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","adjustment_total","discount_total","tax_total","included_tax_total","additional_tax_total","total","gift_card_total","amount_due","delivery_total","fee_total","store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","metadata","cancel_note","canceled_at","approved_at","created_at","updated_at","payment_total","commission_amount_total","commission_tax_total","commission_total","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","approver_type","canceler_id","canceler_type","created_by_id","created_by_type","cancel_reason_id","cancel_reason_name","customer_id","freight_summary"],"x-typelizer":true},"PackageType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"]},"length":{"type":"string","nullable":true},"width":{"type":"string","nullable":true},"height":{"type":"string","nullable":true},"weight":{"type":"string","nullable":true},"max_weight":{"type":"string","nullable":true},"default":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"volume":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true}},"required":["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","description":"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},"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":{"$ref":"#/components/schemas/PaymentMethodPreferences"},"logo_url":{"type":"string","nullable":true},"docs_url":{"type":"string","nullable":true},"third_party":{"type":"boolean"}},"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","logo_url","docs_url","third_party"],"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":{"anyOf":[{"type":"string","enum":["checkout","processing","pending","completed","failed","void","invalid"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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"}},"payment_splits":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSplit"}}},"required":["id","payment_method_id","response_code","number","status","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},"PaymentSplit":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"authorized_amount":{"type":"string"},"captured_amount":{"type":"string"},"refunded_amount":{"type":"string"},"claimed_amount":{"type":"string"},"net_captured_amount":{"type":"string"},"refundable_amount":{"type":"string"},"payment_id":{"type":"string"},"payment_number":{"type":"string","nullable":true},"order_id":{"type":"string"},"order_number":{"type":"string","nullable":true}},"required":["id","currency","created_at","updated_at","authorized_amount","captured_amount","refunded_amount","claimed_amount","net_captured_amount","refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string","enum":["read","write"]},"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},"PriceAdjustmentTier":{"type":"object","properties":{"id":{"type":"string"},"min_quantity":{"type":"number"},"percentage":{"type":"string"}},"required":["id","min_quantity","percentage"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"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","currency","amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceListProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"price_list_variants":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPrice"}}},"required":["id","name","thumbnail_url"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"anyOf":[{"type":"string","enum":["draft","active","inactive","scheduled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"position":{"type":"number"},"match_policy":{"type":"string","enum":["all","any"]},"adjust_compare_at":{"type":"boolean"},"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"},"price_adjustment_percentage":{"type":"string","nullable":true},"automatic_pricing":{"type":"boolean"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"price_adjustment_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentTier"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},"price_list_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/PriceRulePreferences"},"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"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"min_quantity":{"type":"number"},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","currency","amount","compare_at_amount","price_list_id","min_quantity","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":{"anyOf":[{"type":"string","enum":["draft","active","archived","proposed","rejected"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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":{"anyOf":[{"type":"string","enum":["pending","approved","rejected","withdrawn"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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","description":"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"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","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},"promotion_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/PromotionRulePreferences"},"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},"option_value_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"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","product_ids","category_ids","customer_ids","option_value_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},"PurchaseOrderItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_ordered":{"type":"number"},"quantity_received":{"type":"number"},"quantity_rejected":{"type":"number"},"quantity_over":{"type":"number"},"outstanding":{"type":"number"},"currency":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"unit_cost":{"type":"string"},"total_cost":{"type":"string"},"purchase_order_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":true},"PurchaseOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"close_reason":{"type":"string","nullable":true},"items_count":{"type":"number"},"quantity_received_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"ordered_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"closed_short_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expected_at":{"type":"string","nullable":true},"cancel_by":{"type":"string","nullable":true},"closed_short":{"type":"boolean"},"quantity_ordered_total":{"type":"number"},"editable":{"type":"boolean"},"subtotal":{"type":"string"},"supplier_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItem"}},"stock_receipts":{"type":"array","items":{"$ref":"#/components/schemas/StockReceipt"}},"supplier":{"$ref":"#/components/schemas/Supplier"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","supplier_id","destination_location_id"],"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"},"tax_amount":{"type":"string"},"refunder_id":{"type":"string","nullable":true},"refunder_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"refunder":{"$ref":"#/components/schemas/Actor"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at","tax_amount","refunder_id","refunder_type"],"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"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"tax_total":{"type":"string"},"refund_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"},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","refund_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":{"anyOf":[{"type":"string","enum":["requested","approved","received","refunded","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"refund_tax_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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"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"}},"documents":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}}},"required":["id","number","status","order_id","reason_id","refund_total","refund_tax_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type","refunded_total","refundable_total","documents","labels","deliveries"],"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},"SavedReport":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"query":{"type":"object"},"seeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_id":{"type":"string","nullable":true},"author_name":{"type":"string","nullable":true}},"required":["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":true},"SellerBalance":{"type":"object","properties":{"currency":{"type":"string"},"settlement_currency":{"type":"string"},"converted":{"type":"boolean"},"seller_id":{"type":"string"},"earned":{"type":"string"},"pending":{"type":"string"},"payable":{"type":"string"},"paid":{"type":"string"},"balance":{"type":"string"}},"required":["currency","settlement_currency","converted","seller_id","earned","pending","payable","paid","balance"],"x-typelizer":true},"SellerPayout":{"type":"object","properties":{"id":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed","unresolved"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"period_start":{"type":"string","nullable":true},"period_end":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"},"seller_id":{"type":"string"},"seller_name":{"type":"string","nullable":true},"transfers_count":{"type":"number"},"provider":{"type":"string","description":"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},"required":["id","status","currency","reference","metadata","period_start","period_end","created_at","updated_at","amount","seller_id","seller_name","transfers_count","provider"],"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","description":"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preferences":{"$ref":"#/components/schemas/SellerRequirementPreferences"},"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","description":"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"position":{"type":"number"},"status":{"type":"string","enum":["complete","incomplete","pending","rejected"]},"action_url":{"type":"string","nullable":true},"blocker":{"type":"object","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","blocker","blocking","required_policy_name"],"x-typelizer":true},"SellerRequirementSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","accepted","rejected","waived"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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":{"anyOf":[{"type":"string","enum":["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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},"SellerTransfer":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["earning","refund_reversal"]},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed","unresolved"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"},"settled_amount":{"type":"string","nullable":true},"settled_currency":{"type":"string","nullable":true},"converted":{"type":"boolean"},"seller_id":{"type":"string"},"order_id":{"type":"string","nullable":true},"payout_id":{"type":"string","nullable":true},"reversed_from_id":{"type":"string","nullable":true},"refund_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"order_number":{"type":"string","nullable":true},"provider":{"type":"string","description":"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},"required":["id","kind","status","currency","reference","metadata","created_at","updated_at","amount","settled_amount","settled_currency","converted","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number","provider"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"ShippingLabel":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["purchased","uploaded"]},"status":{"anyOf":[{"type":"string","enum":["purchased","refund_requested","refunded"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"carrier":{"type":"string","nullable":true},"carrier_name":{"type":"string","nullable":true},"service":{"type":"string","nullable":true},"tracking_number":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"refunded_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"owner_id":{"type":"string"},"owner_type":{"type":"string","enum":["fulfillment","return"]},"cost":{"type":"string"},"integration_id":{"type":"string","nullable":true},"file_pending":{"type":"boolean"},"download_url":{"type":"string","nullable":true}},"required":["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","integration_id","file_pending","download_url"],"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"},"reserved_count":{"type":"number"},"incoming_count":{"type":"number"},"purchasable_count":{"type":"number"},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_name":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"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","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","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":{"anyOf":[{"type":"string","enum":["warehouse","store","fulfillment_center"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"returns_enabled":{"type":"boolean"},"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","returns_enabled","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,"enum":["received","allocated","shipped","released","adjusted"]},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_level_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"stock_location_name":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"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},"stock_receipt_id":{"type":"string","nullable":true},"purchase_order_id":{"type":"string","nullable":true},"order_number":{"type":"string","nullable":true},"return_number":{"type":"string","nullable":true},"exchange_number":{"type":"string","nullable":true},"stock_transfer_number":{"type":"string","nullable":true},"purchase_order_number":{"type":"string","nullable":true},"unit_cost":{"type":"string","nullable":true}},"required":["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost"],"x-typelizer":true},"StockReceiptItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_accepted":{"type":"number"},"quantity_rejected":{"type":"number"},"rejection_reason":{"type":"string","nullable":true,"enum":["damaged","wrong_item","expired","other"]},"notes":{"type":"string","nullable":true},"line_type":{"type":"string","enum":["purchase_order_item","stock_transfer_item"]},"line_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":true},"StockReceipt":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"quantity_accepted_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"received_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"receivable_type":{"type":"string","enum":["purchase_order","stock_transfer"]},"receivable_id":{"type":"string"},"received_by_id":{"type":"string","nullable":true},"received_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"received_by":{"$ref":"#/components/schemas/Actor"},"items_count":{"type":"number"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockReceiptItem"}}},"required":["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","received_by_type","items_count"],"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},"StockTransferItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_shipped":{"type":"number"},"quantity_received":{"type":"number"},"quantity_rejected":{"type":"number"},"quantity_over":{"type":"number"},"outstanding":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_transfer_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string"},"destination_location_id":{"type":"string"},"status":{"type":"string"},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"close_reason":{"type":"string","nullable":true},"items_count":{"type":"number"},"quantity_received_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"shipped_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"closed_short_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"closed_short":{"type":"boolean"},"quantity_shipped_total":{"type":"number"},"editable":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItem"}},"stock_receipts":{"type":"array","items":{"$ref":"#/components/schemas/StockReceipt"}},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":true},"StoreCreditEvent":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"authorization_code":{"type":"string","nullable":true},"display_action":{"type":"string","nullable":true},"amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"store_credit_id":{"type":"string"},"originator_type":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true}},"required":["id","action","authorization_code","display_action","amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount_authorized":{"type":"string"},"outstanding":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"}},"required":["id","amount","amount_used","amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"default_country_code":{"type":"string","nullable":true},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_routing_strategy":{"type":"string","description":"Order routing strategy. Built-in: rules. Extensions may register more."},"payout_provider":{"type":"string","nullable":true,"description":"Payout provider; null uses the installation default. Built-in: system. Provider gems register more (e.g. stripe)."},"admin_locale":{"type":"string","nullable":true},"timezone":{"type":"string"},"storefront_url":{"type":"string","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"unit_system":{"type":"string"},"storefront_access":{"type":"string","enum":["public","prices_hidden","login_required"]},"guest_checkout":{"type":"boolean"},"always_include_confirm_step":{"type":"boolean"},"company_field_enabled":{"type":"boolean"},"address_requires_company":{"type":"boolean"},"address_requires_phone":{"type":"boolean"},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"track_inventory_levels":{"type":"boolean"},"stock_reservations_enabled":{"type":"boolean"},"low_stock_threshold":{"type":"number"},"tax_using_ship_address":{"type":"boolean"},"track_price_history":{"type":"boolean"},"show_products_without_price":{"type":"boolean"},"disable_sku_validation":{"type":"boolean"},"pricing_provider":{"type":"string"},"inventory_provider":{"type":"string"},"pricing_provider_failure_policy":{"type":"string","enum":["fallback","strict"]},"inventory_provider_failure_policy":{"type":"string","enum":["fallback","strict"]},"default_payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"]},"auto_approve_sellers":{"type":"boolean"},"auto_approve_seller_products":{"type":"boolean"},"send_seller_transactional_emails":{"type":"boolean"},"document_number_format":{"type":"string","enum":["sequential","random"]},"order_number_prefix":{"type":"string"},"order_number_suffix":{"type":"string"},"order_number_sequence_start":{"type":"number"},"limit_digital_download_count":{"type":"boolean"},"digital_asset_authorized_clicks":{"type":"number"},"limit_digital_download_days":{"type":"boolean"},"digital_asset_authorized_days":{"type":"number"},"send_consumer_transactional_emails":{"type":"boolean"},"email_accent_color":{"type":"string","nullable":true},"email_background_color":{"type":"string","nullable":true},"email_card_color":{"type":"string","nullable":true},"email_text_color":{"type":"string","nullable":true},"email_heading_color":{"type":"string","nullable":true},"email_font":{"type":"string","nullable":true,"enum":["inter","system","helvetica","georgia","roboto","lato","merriweather"]},"order_number_sequence_started":{"type":"boolean"},"default_minimum_payout_amount":{"type":"string","nullable":true},"default_commission_tax_rate":{"type":"string","nullable":true},"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","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","created_at","updated_at","order_routing_strategy","payout_provider","admin_locale","timezone","storefront_url","weight_unit","unit_system","storefront_access","guest_checkout","always_include_confirm_step","company_field_enabled","address_requires_company","address_requires_phone","capture_method","track_inventory_levels","stock_reservations_enabled","low_stock_threshold","tax_using_ship_address","track_price_history","show_products_without_price","disable_sku_validation","pricing_provider","inventory_provider","pricing_provider_failure_policy","inventory_provider_failure_policy","default_payouts_schedule_interval","auto_approve_sellers","auto_approve_seller_products","send_seller_transactional_emails","document_number_format","order_number_prefix","order_number_suffix","order_number_sequence_start","limit_digital_download_count","digital_asset_authorized_clicks","limit_digital_download_days","digital_asset_authorized_days","send_consumer_transactional_emails","email_accent_color","email_background_color","email_card_color","email_text_color","email_heading_color","email_font","order_number_sequence_started","default_minimum_payout_amount","default_commission_tax_rate","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"Supplier":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"purchase_orders_count":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"can_be_deleted":{"type":"boolean"}},"required":["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"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":{"anyOf":[{"type":"string","enum":["pending","verified","expired","revoked"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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","description":"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true,"enum":["pending","verified","unverified","unavailable","unsupported"]},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true,"enum":["override","company","customer"]},"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"},"credit":{"type":"boolean"},"rate":{"type":"string","nullable":true},"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},"return_line_item_id":{"type":"string","nullable":true},"claim_line_item_id":{"type":"string","nullable":true},"exchange_line_item_id":{"type":"string","nullable":true},"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"},"original_tax_line_id":{"type":"string","nullable":true}},"required":["id","label","included","credit","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","return_line_item_id","claim_line_item_id","exchange_line_item_id","amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at","original_tax_line_id"],"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},"rate":{"type":"string","nullable":true},"rate_percent":{"type":"string","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","rate","rate_percent","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},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"purchase_unit":{"type":"string","nullable":true,"enum":["unit","carton"]},"units_per_carton":{"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_currency":{"type":"string","nullable":true},"barcode":{"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},"carton_weight":{"type":"string","nullable":true},"cartons_per_pallet":{"type":"number","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"carton_package_type_id":{"type":"string","nullable":true},"units_per_pallet":{"type":"number","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","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","cost_price","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","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","nullable":true},"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},"WebhookEvent":{"type":"object","properties":{"name":{"type":"string"},"group":{"type":"string"},"credential_permission":{"type":"string","nullable":true},"credential":{"type":"boolean"},"deprecated":{"type":"boolean"},"replaced_by":{"type":"string","nullable":true}},"required":["name","group","credential_permission","credential","deprecated","replaced_by"],"x-typelizer":true},"CommissionRuleCategoryRulePreferences":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ctg_[A-Za-z0-9]+$","x-spree-prefix":"ctg"},"default":[]}},"additionalProperties":false},"CommissionRuleItemTotalRulePreferences":{"type":"object","properties":{"min_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"max_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"CommissionRuleProductRulePreferences":{"type":"object","properties":{},"additionalProperties":false},"CommissionRuleSellerRulePreferences":{"type":"object","properties":{"seller_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^sel_[A-Za-z0-9]+$","x-spree-prefix":"sel"},"default":[]}},"additionalProperties":false},"CommissionRulePreferences":{"description":"Settings of a commission rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/CommissionRuleCategoryRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleItemTotalRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleProductRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleSellerRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"category_rule":"#/components/schemas/CommissionRuleCategoryRulePreferences","item_total_rule":"#/components/schemas/CommissionRuleItemTotalRulePreferences","product_rule":"#/components/schemas/CommissionRuleProductRulePreferences","seller_rule":"#/components/schemas/CommissionRuleSellerRulePreferences"}},"DeliveryCalculatorDigitalDeliveryPreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorFlatPercentItemTotalPreferences":{"type":"object","properties":{"flat_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"DeliveryCalculatorFlatRatePreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorFlexiRatePreferences":{"type":"object","properties":{"first_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"additional_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"max_items":{"type":"integer","default":0},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPerItemPreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPriceSackPreferences":{"type":"object","properties":{"minimal_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"normal_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"discount_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPreferences":{"description":"Settings of a delivery calculator, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/DeliveryCalculatorDigitalDeliveryPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlatPercentItemTotalPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlatRatePreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlexiRatePreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorPerItemPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorPriceSackPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"digital_delivery":"#/components/schemas/DeliveryCalculatorDigitalDeliveryPreferences","flat_percent_item_total":"#/components/schemas/DeliveryCalculatorFlatPercentItemTotalPreferences","flat_rate":"#/components/schemas/DeliveryCalculatorFlatRatePreferences","flexi_rate":"#/components/schemas/DeliveryCalculatorFlexiRatePreferences","per_item":"#/components/schemas/DeliveryCalculatorPerItemPreferences","price_sack":"#/components/schemas/DeliveryCalculatorPriceSackPreferences"}},"DeliveryMethodRuleChannelRulePreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"DeliveryMethodRuleCompanyRulePreferences":{"type":"object","properties":{"company_orders_only":{"type":"boolean","default":true}},"additionalProperties":false},"DeliveryMethodRuleExcludedProductsRulePreferences":{"type":"object","properties":{},"additionalProperties":false},"DeliveryMethodRuleItemTotalRulePreferences":{"type":"object","properties":{"minimum_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRuleVolumeRulePreferences":{"type":"object","properties":{"minimum_volume":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_volume":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRuleWeightRulePreferences":{"type":"object","properties":{"minimum_weight":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_weight":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRulePreferences":{"description":"Settings of a delivery method rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/DeliveryMethodRuleChannelRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleCompanyRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleExcludedProductsRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleItemTotalRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleVolumeRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleWeightRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"channel_rule":"#/components/schemas/DeliveryMethodRuleChannelRulePreferences","company_rule":"#/components/schemas/DeliveryMethodRuleCompanyRulePreferences","excluded_products_rule":"#/components/schemas/DeliveryMethodRuleExcludedProductsRulePreferences","item_total_rule":"#/components/schemas/DeliveryMethodRuleItemTotalRulePreferences","volume_rule":"#/components/schemas/DeliveryMethodRuleVolumeRulePreferences","weight_rule":"#/components/schemas/DeliveryMethodRuleWeightRulePreferences"}},"IntegrationPreferences":{"description":"Settings of a integration, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{}},"OrderRoutingRuleDefaultLocationPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRuleMinimizeSplitsPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRulePreferredLocationPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRulePreferences":{"description":"Settings of a order routing rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/OrderRoutingRuleDefaultLocationPreferences"},{"$ref":"#/components/schemas/OrderRoutingRuleMinimizeSplitsPreferences"},{"$ref":"#/components/schemas/OrderRoutingRulePreferredLocationPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"default_location":"#/components/schemas/OrderRoutingRuleDefaultLocationPreferences","minimize_splits":"#/components/schemas/OrderRoutingRuleMinimizeSplitsPreferences","preferred_location":"#/components/schemas/OrderRoutingRulePreferredLocationPreferences"}},"PaymentMethodBogusPreferences":{"type":"object","properties":{"dummy_key":{"type":"string","default":"PUBLICKEY123"},"dummy_secret_key":{"type":"string","x-spree-secret":true,"nullable":true}},"additionalProperties":false},"PaymentMethodCheckPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodCustomPaymentSourceMethodPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodStoreCreditPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodPreferences":{"description":"Settings of a payment method, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PaymentMethodBogusPreferences"},{"$ref":"#/components/schemas/PaymentMethodCheckPreferences"},{"$ref":"#/components/schemas/PaymentMethodCustomPaymentSourceMethodPreferences"},{"$ref":"#/components/schemas/PaymentMethodStoreCreditPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"bogus":"#/components/schemas/PaymentMethodBogusPreferences","check":"#/components/schemas/PaymentMethodCheckPreferences","custom_payment_source_method":"#/components/schemas/PaymentMethodCustomPaymentSourceMethodPreferences","store_credit":"#/components/schemas/PaymentMethodStoreCreditPreferences"}},"PriceRuleChannelRulePreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"PriceRuleCustomerGroupRulePreferences":{"type":"object","properties":{"customer_group_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cg_[A-Za-z0-9]+$","x-spree-prefix":"cg"},"default":[]}},"additionalProperties":false},"PriceRuleMarketRulePreferences":{"type":"object","properties":{"market_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^mkt_[A-Za-z0-9]+$","x-spree-prefix":"mkt"},"default":[]}},"additionalProperties":false},"PriceRuleUserRulePreferences":{"type":"object","properties":{"user_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cust_[A-Za-z0-9]+$","x-spree-prefix":"cust"},"default":[]}},"additionalProperties":false},"PriceRuleVolumeRulePreferences":{"type":"object","properties":{"min_quantity":{"type":"integer","default":1},"max_quantity":{"type":"integer","nullable":true}},"additionalProperties":false},"PriceRulePreferences":{"description":"Settings of a price rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PriceRuleChannelRulePreferences"},{"$ref":"#/components/schemas/PriceRuleCustomerGroupRulePreferences"},{"$ref":"#/components/schemas/PriceRuleMarketRulePreferences"},{"$ref":"#/components/schemas/PriceRuleUserRulePreferences"},{"$ref":"#/components/schemas/PriceRuleVolumeRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"channel_rule":"#/components/schemas/PriceRuleChannelRulePreferences","customer_group_rule":"#/components/schemas/PriceRuleCustomerGroupRulePreferences","market_rule":"#/components/schemas/PriceRuleMarketRulePreferences","user_rule":"#/components/schemas/PriceRuleUserRulePreferences","volume_rule":"#/components/schemas/PriceRuleVolumeRulePreferences"}},"PromotionCalculatorFlatPercentItemTotalPreferences":{"type":"object","properties":{"flat_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"PromotionCalculatorFlatRatePreferences":{"type":"object","properties":{"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorFlexiRatePreferences":{"type":"object","properties":{"first_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"additional_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"max_items":{"type":"integer","default":0},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorPercentOnLineItemPreferences":{"type":"object","properties":{"percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorTieredFlatRatePreferences":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"threshold":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"value":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["threshold","value"],"additionalProperties":false},"default":[]},"base_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"PromotionCalculatorTieredPercentPreferences":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"threshold":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"value":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["threshold","value"],"additionalProperties":false},"default":[]},"base_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"PromotionCalculatorPreferences":{"description":"Settings of a promotion calculator, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PromotionCalculatorFlatPercentItemTotalPreferences"},{"$ref":"#/components/schemas/PromotionCalculatorFlatRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorFlexiRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorPercentOnLineItemPreferences"},{"$ref":"#/components/schemas/PromotionCalculatorTieredFlatRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorTieredPercentPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"flat_percent_item_total":"#/components/schemas/PromotionCalculatorFlatPercentItemTotalPreferences","flat_rate":"#/components/schemas/PromotionCalculatorFlatRatePreferences","flexi_rate":"#/components/schemas/PromotionCalculatorFlexiRatePreferences","percent_on_line_item":"#/components/schemas/PromotionCalculatorPercentOnLineItemPreferences","tiered_flat_rate":"#/components/schemas/PromotionCalculatorTieredFlatRatePreferences","tiered_percent":"#/components/schemas/PromotionCalculatorTieredPercentPreferences"}},"PromotionRuleCategoryPreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any","all"],"default":"any"}},"additionalProperties":false},"PromotionRuleChannelPreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"PromotionRuleCountryPreferences":{"type":"object","properties":{"country_codes":{"type":"array","items":{"type":"string","format":"iso-country","pattern":"^[A-Z]{2}$"},"default":[]},"country_id":{"type":"integer","nullable":true},"country_code":{"type":"string","format":"iso-country","pattern":"^[A-Z]{2}$","nullable":true}},"additionalProperties":false},"PromotionRuleCurrencyPreferences":{"type":"object","properties":{"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$","nullable":true}},"additionalProperties":false},"PromotionRuleCustomerPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleCustomerGroupPreferences":{"type":"object","properties":{"customer_group_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cg_[A-Za-z0-9]+$","x-spree-prefix":"cg"},"default":[]}},"additionalProperties":false},"PromotionRuleCustomerLoggedInPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleFirstOrderPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleItemTotalPreferences":{"type":"object","properties":{"amount_min":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"100"},"operator_min":{"type":"string","default":">"},"amount_max":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"operator_max":{"type":"string","default":"<"}},"additionalProperties":false},"PromotionRuleMarketPreferences":{"type":"object","properties":{"market_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^mkt_[A-Za-z0-9]+$","x-spree-prefix":"mkt"},"default":[]}},"additionalProperties":false},"PromotionRuleOneUsePerUserPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleOptionValuePreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any"],"default":"any"},"eligible_values":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^optval_[A-Za-z0-9]+$","x-spree-prefix":"optval"},"default":[]}},"additionalProperties":false},"PromotionRuleProductPreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any","all","none"],"default":"any"}},"additionalProperties":false},"PromotionRulePreferences":{"description":"Settings of a promotion rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PromotionRuleCategoryPreferences"},{"$ref":"#/components/schemas/PromotionRuleChannelPreferences"},{"$ref":"#/components/schemas/PromotionRuleCountryPreferences"},{"$ref":"#/components/schemas/PromotionRuleCurrencyPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerGroupPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerLoggedInPreferences"},{"$ref":"#/components/schemas/PromotionRuleFirstOrderPreferences"},{"$ref":"#/components/schemas/PromotionRuleItemTotalPreferences"},{"$ref":"#/components/schemas/PromotionRuleMarketPreferences"},{"$ref":"#/components/schemas/PromotionRuleOneUsePerUserPreferences"},{"$ref":"#/components/schemas/PromotionRuleOptionValuePreferences"},{"$ref":"#/components/schemas/PromotionRuleProductPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"category":"#/components/schemas/PromotionRuleCategoryPreferences","channel":"#/components/schemas/PromotionRuleChannelPreferences","country":"#/components/schemas/PromotionRuleCountryPreferences","currency":"#/components/schemas/PromotionRuleCurrencyPreferences","customer":"#/components/schemas/PromotionRuleCustomerPreferences","customer_group":"#/components/schemas/PromotionRuleCustomerGroupPreferences","customer_logged_in":"#/components/schemas/PromotionRuleCustomerLoggedInPreferences","first_order":"#/components/schemas/PromotionRuleFirstOrderPreferences","item_total":"#/components/schemas/PromotionRuleItemTotalPreferences","market":"#/components/schemas/PromotionRuleMarketPreferences","one_use_per_user":"#/components/schemas/PromotionRuleOneUsePerUserPreferences","option_value":"#/components/schemas/PromotionRuleOptionValuePreferences","product":"#/components/schemas/PromotionRuleProductPreferences"}},"SellerRequirementAcceptTermsPreferences":{"type":"object","properties":{"terms_body":{"type":"string","x-spree-widget":"textarea","nullable":true},"terms_effective_from":{"type":"string","format":"date","nullable":true},"terms_url":{"type":"string","nullable":true}},"additionalProperties":false},"SellerRequirementAttestationPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementBillingAddressPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementCompleteProfilePreferences":{"type":"object","properties":{"require_about":{"type":"boolean","default":true},"require_logo":{"type":"boolean","default":true},"require_cover_photo":{"type":"boolean","default":false},"require_contact_email":{"type":"boolean","default":true}},"additionalProperties":false},"SellerRequirementDeliveryMethodPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementDocumentPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementMinimumProductsPreferences":{"type":"object","properties":{"minimum_count":{"type":"integer","default":1}},"additionalProperties":false},"SellerRequirementOperatorReviewPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPackageTypePreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPayoutAccountPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPolicyPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementRequiredCustomFieldsPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementReturnsAddressPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPreferences":{"description":"Settings of a seller requirement, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/SellerRequirementAcceptTermsPreferences"},{"$ref":"#/components/schemas/SellerRequirementAttestationPreferences"},{"$ref":"#/components/schemas/SellerRequirementBillingAddressPreferences"},{"$ref":"#/components/schemas/SellerRequirementCompleteProfilePreferences"},{"$ref":"#/components/schemas/SellerRequirementDeliveryMethodPreferences"},{"$ref":"#/components/schemas/SellerRequirementDocumentPreferences"},{"$ref":"#/components/schemas/SellerRequirementMinimumProductsPreferences"},{"$ref":"#/components/schemas/SellerRequirementOperatorReviewPreferences"},{"$ref":"#/components/schemas/SellerRequirementPackageTypePreferences"},{"$ref":"#/components/schemas/SellerRequirementPayoutAccountPreferences"},{"$ref":"#/components/schemas/SellerRequirementPolicyPreferences"},{"$ref":"#/components/schemas/SellerRequirementRequiredCustomFieldsPreferences"},{"$ref":"#/components/schemas/SellerRequirementReturnsAddressPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"accept_terms":"#/components/schemas/SellerRequirementAcceptTermsPreferences","attestation":"#/components/schemas/SellerRequirementAttestationPreferences","billing_address":"#/components/schemas/SellerRequirementBillingAddressPreferences","complete_profile":"#/components/schemas/SellerRequirementCompleteProfilePreferences","delivery_method":"#/components/schemas/SellerRequirementDeliveryMethodPreferences","document":"#/components/schemas/SellerRequirementDocumentPreferences","minimum_products":"#/components/schemas/SellerRequirementMinimumProductsPreferences","operator_review":"#/components/schemas/SellerRequirementOperatorReviewPreferences","package_type":"#/components/schemas/SellerRequirementPackageTypePreferences","payout_account":"#/components/schemas/SellerRequirementPayoutAccountPreferences","policy":"#/components/schemas/SellerRequirementPolicyPreferences","required_custom_fields":"#/components/schemas/SellerRequirementRequiredCustomFieldsPreferences","returns_address":"#/components/schemas/SellerRequirementReturnsAddressPreferences"}},"DeliveryMethodCalculator":{"type":"object","description":"How the delivery method prices a shipment","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"preferences":{"$ref":"#/components/schemas/DeliveryCalculatorPreferences"}},"required":["type","preferences"]},"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"},"preferences":{"$ref":"#/components/schemas/PromotionCalculatorPreferences"}},"required":["type","preferences"]}}}}\ 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/auth/invitations/{id}/accept":{"parameters":[{"name":"id","in":"path","description":"Invitation ID from the emailed link","required":true,"schema":{"type":"string"}}],"post":{"summary":"Accept an invitation","tags":["Authentication"],"description":"Accepts a staff invitation and returns a signed-in admin session, so the\nnew member lands in the dashboard rather than on a login form.\n\nUnauthenticated — the ID and token in the emailed link are the\ncredential. The email is never taken from the request; it always comes\nfrom the invitation.\n\n`password` is required when no account exists for the invited address,\nin which case it sets one. When an account already exists, the same\nfield is how the person proves the account is theirs.\n","parameters":[{"name":"token","in":"query","required":true,"description":"The token from the emailed link","schema":{"type":"string"}}],"responses":{"200":{"description":"invitation accepted, session issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"404":{"description":"wrong token, or an invitation that can no longer be accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAcceptParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/MeUpdateParams"}}},"required":true}}},"/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 is honoured only on the\ndashboard's origin and for an account that is staff of the store —\notherwise it is silently ignored and the link opens the dashboard's\nreset page. 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":{"$ref":"#/components/schemas/PasswordResetRequestParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/PasswordResetParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/SetupParams"}}},"required":true}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of origin (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[origin_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `origin`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"AllowedOrigin","sortable":["created_at","id","origin","updated_at"]},"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":{"$ref":"#/components/schemas/AllowedOriginCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/AllowedOriginUpdateParams"}}},"required":true}},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ApiKey","sortable":["created_at","id","name","updated_at"]},"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":{"$ref":"#/components/schemas/ApiKeyCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ApiKeyUpdateParams"}}},"required":true}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and pretty name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `automatic` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `children_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `parent_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `permalink` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `pretty_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `products_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[parent_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Category","sortable":["automatic","children_count","created_at","depth","id","name","parent_id","permalink","position","pretty_name","products_count","updated_at"]},"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":{"$ref":"#/components/schemas/CategoryCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CategoryUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/CategoryRepositionParams"}}},"required":true}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductMembershipRepositionParams"}}},"required":true}}},"/api/v3/admin/categories/{category_id}/custom_fields":{"get":{"summary":"List category custom fields","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the category's custom field values.\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,"schema":{"type":"string"}},{"name":"category_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `store_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Channel","sortable":["active","code","created_at","default","id","name","store_id","updated_at"]},"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":{"$ref":"#/components/schemas/ChannelCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ChannelUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ChannelAddProductsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ChannelRemoveProductsParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[active_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `channel_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `store_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `channel_id`, `created_at`, `id`, `position`, `store_id`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderRoutingRule","sortable":["active","channel_id","created_at","id","position","store_id","type","updated_at"]},"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":{"$ref":"#/components/schemas/OrderRoutingRuleCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/OrderRoutingRuleUpdateParams"}}},"required":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]=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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of namespace, key, and label (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[key_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `field_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `key` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `label` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `namespace` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `resource_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `searchable` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `sortable` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `field_type`, `id`, `key`, `label`, `namespace`, `resource_type`, `searchable`, `sortable`, `storefront_visible`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomFieldDefinition","sortable":["created_at","field_type","id","key","label","namespace","resource_type","searchable","sortable","storefront_visible","updated_at"]},"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":{"$ref":"#/components/schemas/CustomFieldDefinitionCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomFieldDefinitionUpdateParams"}}},"required":true}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomerGroup","sortable":["created_at","id","name","updated_at"]},"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":{"$ref":"#/components/schemas/CustomerGroupCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomerGroupUpdateParams"}}},"required":true}},"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}/custom_fields":{"get":{"summary":"List customer custom fields","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's custom field values.\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., 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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/customers/{id}/export":{"get":{"summary":"Export a customer's personal data","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns everything the store holds about this customer, for answering a\nGDPR right-of-access request (Art. 15) that reached the merchant\ndirectly.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer data","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object"},"marketing_consent":{"type":"object"},"consent_records":{"type":"array","items":{"type":"object"}},"addresses":{"type":"array","items":{"type":"object"}},"orders":{"type":"array","items":{"type":"object"}},"exported_at":{"type":"string"}}}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/customers/{id}/anonymize":{"post":{"summary":"Erase a customer's personal data","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Carries out a GDPR right-to-erasure request (Art. 17). Personal data is\nreplaced across the account, its addresses, the address snapshots on\npast orders, saved cards, connected identities and live sessions.\n\nOrders, payments and tax records are kept — they carry their own\nretention obligation — with the personal details removed. The country,\nstate and a truncated postal code survive on order addresses so the tax\njurisdiction of a past sale stays provable.\n\nIrreversible.\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":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer anonymized","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"anonymized":{"type":"boolean"},"anonymized_at":{"type":"string","nullable":true}}}}}}}}},"/api/v3/admin/consent_records":{"get":{"summary":"List consent records","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the consents customers gave or withdrew, newest first, as evidence of what each one agreed to and when.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `accepted` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purpose` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `recorded_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `source` | One of `checkout`, `registration`, `account`, `admin`, `newsletter`, `anonymization`, `unknown`, `import`, `storefront` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `accepted`, `created_at`, `email`, `id`, `purpose`, `recorded_at`, `source`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ConsentRecord","sortable":["accepted","created_at","email","id","purpose","recorded_at","source","updated_at"]},"responses":{"200":{"description":"consent records found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConsentRecord"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/data_requests":{"get":{"summary":"List data requests","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the requests customers made to export or erase their personal data, newest first.\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":"q[access]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `access`."},{"name":"q[erasure]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `erasure`."},{"name":"q[in_progress]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_progress`."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `completed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `access`, `erasure` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `requested_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `completed_at`, `created_at`, `email`, `id`, `kind`, `number`, `requested_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DataRequest","sortable":["completed_at","created_at","email","id","kind","number","requested_at","status","updated_at"]},"responses":{"200":{"description":"data requests found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataRequest"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Record a data request","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records a request a customer made to the merchant directly, to export\nor erase their personal data, and starts answering it. A request of the\nsame kind already in progress for the customer is returned instead of a\nsecond one.\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":{"202":{"description":"data request recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRequest"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataRequestCreateParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[address1_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `address1` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `address2` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `company` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `postal_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Address","sortable":["address1","address2","city","company","country_code","created_at","first_name","id","last_name","phone","postal_code","state_code","updated_at"]},"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":{"$ref":"#/components/schemas/CustomerAddressParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomerAddressParams"}}},"required":true}},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CreditCard","sortable":["created_at","id","name","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of memo (partial, case-insensitive)."},{"name":"q[from_gift_card]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `from_gift_card`."},{"name":"q[outstanding]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `outstanding`."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `memo` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[created_by_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `created_by_` | `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at` |\n| `created_by_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `created_by_id`, `currency`, `customer_id`, `id`, `memo`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCredit","sortable":["amount","created_at","created_by_id","currency","customer_id","id","memo","updated_at"]},"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":{"$ref":"#/components/schemas/CustomerStoreCreditCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomerStoreCreditUpdateParams"}}},"required":true}},"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/{customer_id}/tax_identifiers":{"get":{"summary":"List customer tax registrations","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's own tax registrations, one per kind.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxIdentifier","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"registrations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxIdentifier"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches email, first name, last name or full name (partial, case-insensitive)."},{"name":"q[anonymized]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `anonymized`."},{"name":"q[with_min_total_spent]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `with_min_total_spent` to the given value."},{"name":"q[with_standing_for_company][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_standing_for_company` to the given value."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `accepts_email_marketing` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[addresses_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Customer","sortable":["accepts_email_marketing","created_at","email","first_name","id","last_name","phone","updated_at"]},"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":{"$ref":"#/components/schemas/CustomerCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomerUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/CustomerBulkGroupsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomerBulkGroupsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/BulkTagsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/BulkTagsParams"}}},"required":true}}},"/api/v3/admin/email_templates":{"get":{"summary":"List email templates","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every email template merchants may edit: the emails customers\nreceive, the email layout and the shared partials. Each shows what\ncustomers receive now (the store's published version, else Spree's\ndefault) and any draft in progress. Staff emails are not editable.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default) for the version every language uses","schema":{"type":"string"}}],"responses":{"200":{"description":"email templates found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The template key with dots, e.g. `spree.order_mailer.confirm_email`","schema":{"type":"string"}}],"get":{"summary":"Get an email template","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the template for one language: what customers receive now,\nSpree's default, and the draft with its `lock_version`. When Spree's\ndefault changed since the store's version started from it,\n`default_changed` is true and `base_body` holds the default it\nstarted from, to compare with `default_body`.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (`draft.updated_by`)","schema":{"type":"string"}}],"responses":{"200":{"description":"email template found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"404":{"description":"not an editable template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"summary":"Revert an email template to Spree's default","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Goes back to Spree's default for one language and discards the draft.\nThe store's published versions are kept, so one can still be restored.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"lock_version","in":"query","required":false,"description":"The draft's `lock_version` as last seen; a draft saved since is refused with 409","schema":{"type":"integer"}}],"responses":{"200":{"description":"email template reverted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/draft":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"put":{"summary":"Save an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Saves the draft, in any state; customers keep receiving the published\nversion until it is published. Send the `lock_version` the draft was\nloaded with: a save made from an older copy is refused with 409,\nnaming who saved last. The first save starts from what is published,\nelse Spree's default.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"draft saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"409":{"description":"saved by someone else since it was loaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateDraftParams"}}},"required":true}},"delete":{"summary":"Discard an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","schema":{"type":"string"}},{"name":"lock_version","in":"query","required":false,"description":"The draft's `lock_version` as last seen; a draft saved since is refused with 409","schema":{"type":"integer"}}],"responses":{"200":{"description":"draft discarded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}},"/api/v3/admin/email_templates/{email_template_id}/publication":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Publish an email template draft","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Makes the draft what customers receive. The draft is first rendered\nwith sample data; one that does not render (for the layout or a\npartial: in any email using it) is refused with 422, listing each\nproblem with its email and line.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"draft published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}},"422":{"description":"the draft does not render","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateVersionParams"}}}}}},"/api/v3/admin/email_templates/{email_template_id}/preview":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Preview an email template","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renders the template with sample data built from the store's latest\nmatching record, or the one `record_id` names, and returns the email\nwith the variables it was rendered with. An unsaved `subject` and\n`body` take the place of the current version. The layout and partials\nrender inside an email, `email_key` or the first one. `branding`\npreviews colors and a font before they are saved to the store.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"email template rendered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplatePreview"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplatePreviewParams"}}},"required":true}}},"/api/v3/admin/email_templates/{email_template_id}/test_email":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"post":{"summary":"Send a test email","tags":["Email Templates"],"security":[{"bearer_auth":[]}],"description":"Sends the template, rendered as the preview renders it, to the\nsigned-in admin, and never to another address: the sample data comes\nfrom a real customer's records. Takes the same body as the preview.\n","parameters":[{"name":"x-spree-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":"test email queued","content":{"application/json":{"schema":{"type":"object","properties":{"sent_to":{"type":"string"}},"required":["sent_to"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplatePreviewParams"}}},"required":true}}},"/api/v3/admin/email_templates/{email_template_id}/sample_records":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"get":{"summary":"List records to preview an email template with","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The store's five latest records the template can be previewed with,\nnewest first, to pass as `record_id` to the preview. For the layout\nand partials, those of the email `email_key` names. Empty for an\nemail that needs no record.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"email_key","in":"query","required":false,"description":"For the layout or a partial, the email to show it in","schema":{"type":"string"}}],"responses":{"200":{"description":"records found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{email_template_id}/revisions":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}}],"get":{"summary":"List email template revisions","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every version of the template published in one language, newest\nfirst. Reverting to Spree's default keeps them.\n\n\n**Required scope:** `read_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"language","in":"query","required":false,"description":"A language code, or `any` (the default)","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 (`published_by`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"EmailTemplateRevision","sortable":["created_at","id"]},"responses":{"200":{"description":"revisions found","content":{"application/json":{}}}}}},"/api/v3/admin/email_templates/{email_template_id}/revisions/{revision_id}/restoration":{"parameters":[{"name":"email_template_id","in":"path","required":true,"description":"The template key with dots","schema":{"type":"string"}},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Restore an email template revision","tags":["Email Templates"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Copies the revision into the draft, to be published like any change.\nSend the draft's `lock_version` when one is open, as when saving it.\n\n\n**Required scope:** `write_email_templates` (for API-key authentication).","parameters":[{"name":"x-spree-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":"revision copied into the draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateRestoreParams"}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `format` | One of `csv` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `format`, `id`, `number`, `seller_id`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Export","sortable":["created_at","format","id","number","seller_id","type","updated_at"]},"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":{"$ref":"#/components/schemas/ExportCreateParams"}}},"required":true}}},"/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/files":{"post":{"summary":"Upload a file","tags":["Files"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Accepts a file and returns a `signed_id` to send to the endpoint that\nuses it — `signed_id` on product media, `avatar_signed_id` on a\ncustomer, `attachment_signed_id` on an import, and so on.\n\nTwo ways to send the bytes, one response:\n\n- **Presigned** (JSON): send the file's metadata, then `PUT` the bytes\n to `upload.url` with exactly `upload.headers`. Use this for anything\n large — the bytes go straight to storage.\n- **Multipart**: send the bytes in a `file` part. The file is stored\n before the response, so `upload` is null. Limited to 10 MB by default.\n\n`signed_id` is opaque: pass it back unchanged and never parse it. It\nstops being attachable at `expires_at`, one day after the upload.\n\n`visibility` picks the storage: `public` (the default) for images and\nvideos customers see, `private` for documents, imports and digital\nproducts. Public uploads accept web images, videos and CSV; private\nuploads accept any type. `checksum` is the file's MD5 digest,\nbase64-encoded — the storage service verifies the bytes against it.\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":"presigned upload target created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpload"}}}},"422":{"description":"content type not allowed for a public upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadCreateParams"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/FileUploadCreateParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Fulfillment","sortable":["created_at","id","number","updated_at"]},"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. Exchange and claim replacements are moved only out of a named `source_fulfillment_id`, which is how a canceled replacement is sent again. 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":{"$ref":"#/components/schemas/FulfillmentCreateParams"}}},"required":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":{"$ref":"#/components/schemas/FulfillmentUpdateParams"}}},"required":true}}},"/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":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentFulfillParams"}}}}}},"/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":{"$ref":"#/components/schemas/FulfillmentMarkDeliveredParams"}}},"required":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}/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":{"$ref":"#/components/schemas/FulfillmentSplitParams"}}},"required":true}}},"/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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[prefix_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `prefix` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `prefix`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"GiftCardBatch","sortable":["created_at","id","prefix","updated_at"]},"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":{"$ref":"#/components/schemas/GiftCardBatchCreateParams"}}},"required":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[customer_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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of code (partial, case-insensitive)."},{"name":"q[active]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `active`."},{"name":"q[expired]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `expired`."},{"name":"q[partially_redeemed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `partially_redeemed`."},{"name":"q[redeemed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `redeemed`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `expires_at` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `gift_card_batch_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state` | One of `active`, `partially_redeemed`, `redeemed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `active`, `partially_redeemed`, `redeemed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[batch_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `batch_` | `created_at`, `id`, `prefix`, `updated_at` |\n| `customers_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customers_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customers_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customers_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customers_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customers_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `users_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `users_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `users_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `users_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `created_by_id`, `currency`, `customer_id`, `expires_at`, `gift_card_batch_id`, `id`, `state`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"GiftCard","sortable":["code","created_at","created_by_id","currency","customer_id","expires_at","gift_card_batch_id","id","state","status","updated_at"]},"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 `customer_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":{"$ref":"#/components/schemas/GiftCardCreateParams"}}},"required":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":{"$ref":"#/components/schemas/GiftCardUpdateParams"}}},"required":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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `mapping`, `completed_mapping`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `seller_id`, `status`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Import","sortable":["created_at","id","number","seller_id","status","type","updated_at"]},"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/files`\nand pass the returned `signed_id` as `attachment_signed_id`. 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":{"$ref":"#/components/schemas/ImportCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ImportCompleteMappingParams"}}}}}},"/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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `row_number` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `row_number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ImportRow","sortable":["created_at","id","row_number","status","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `default_locale` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `currency`, `default_locale`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Market","sortable":["created_at","currency","default_locale","id","name","position","updated_at"]},"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":{"$ref":"#/components/schemas/MarketCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/MarketUpdateParams"}}},"required":true}},"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/{option_type_id}/custom_fields":{"get":{"summary":"List option type custom fields","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the option type'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":"option_type_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and label (partial, case-insensitive)."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `dropdown`, `color_swatch`, `buttons` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `label` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OptionType","sortable":["created_at","id","kind","label","name","position","updated_at"]},"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":{"$ref":"#/components/schemas/OptionTypeCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/OptionTypeUpdateParams"}}},"required":true}},"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/claims":{"get":{"summary":"List claims","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every damage or missing-item claim in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `open`, `approved`, `resolved`, `denied`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Claim","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"claims listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/claims":{"get":{"summary":"List order claims","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The damage or missing-item claims opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `open`, `approved`, `resolved`, `denied`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Claim","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"claims listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a claim","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens a damage or missing-item claim on a completed order. Each item says how it should be made right: money back, a replacement, or both.\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":"claim opened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/claims/{id}":{"patch":{"summary":"Update a claim","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits the reason, memo or metadata of a claim. Its status moves only through the approve, resolve, deny and cancel actions.\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"}},{"name":"id","in":"path","required":true,"description":"Claim prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"claim updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimUpdateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/claims/{id}/resolve":{"patch":{"summary":"Resolve a claim","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Settles an approved claim with money back, a replacement shipment, or both.\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"}},{"name":"id","in":"path","required":true,"description":"Claim prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"claim resolved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"422":{"description":"unknown resolution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResolveParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/claims/{id}/deny":{"patch":{"summary":"Deny a claim","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down an open claim, recording why for the customer.\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"}},{"name":"id","in":"path","required":true,"description":"Claim prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"claim denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimDenyParams"}}}}}},"/api/v3/admin/orders/{order_id}/claims/{id}/cancel":{"patch":{"summary":"Cancel a claim","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws a claim that has not been resolved.\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"}},{"name":"id","in":"path","required":true,"description":"Claim prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"claim canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCancelParams"}}}}}},"/api/v3/admin/orders/{order_id}/custom_fields":{"get":{"summary":"List order custom fields","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the order's custom field values.\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,"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/digital_links":{"get":{"summary":"List digital links","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the download links issued for digital products bought in this store, newest first.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DigitalLink","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"digital links found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/exchanges":{"get":{"summary":"List exchanges","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every exchange in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `fulfilled`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Exchange","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"exchanges listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/exchanges":{"get":{"summary":"List order exchanges","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The exchanges opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `fulfilled`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Exchange","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"exchanges listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create an exchange","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens an exchange on a completed order: items coming back, and the variant that goes out in place of each.\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":"exchange opened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exchange"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/exchanges/{id}":{"patch":{"summary":"Update an exchange","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits the warehouse, reason, memo or metadata of an exchange. Its status moves only through the approve, receive, fulfill and cancel actions.\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"}},{"name":"id","in":"path","required":true,"description":"Exchange prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"exchange updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exchange"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeUpdateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/exchanges/{id}/receive":{"patch":{"summary":"Receive an exchange","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records the goods that came back on an approved exchange. Omit `items` to receive everything as requested and resellable.\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"}},{"name":"id","in":"path","required":true,"description":"Exchange prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"exchange received","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exchange"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeReceiveParams"}}}}}},"/api/v3/admin/orders/{order_id}/exchanges/{id}/fulfill":{"patch":{"summary":"Fulfill an exchange","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Ships the replacements for a received exchange and settles any price difference.\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"}},{"name":"id","in":"path","required":true,"description":"Exchange prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"exchange fulfilled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exchange"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeFulfillParams"}}}}}},"/api/v3/admin/orders/{order_id}/exchanges/{id}/cancel":{"patch":{"summary":"Cancel an exchange","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws an exchange whose goods have not been received.\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"}},{"name":"id","in":"path","required":true,"description":"Exchange prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"exchange canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exchange"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeCancelParams"}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[country_code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `provider_id` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `taxability_reason` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `country_code`, `created_at`, `id`, `included`, `provider_id`, `state_code`, `taxability_reason`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxLine","sortable":["country_code","created_at","id","included","provider_id","state_code","taxability_reason","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Discount","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/DiscountCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/discounts/{id}":{"patch":{"summary":"Update manual discount","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits the label or amount of a manual discount and re-sums the order totals. Promotion-sourced rows are owned by recalculation and respond 422.\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"}},{"name":"id","in":"path","required":true,"description":"Discount prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"discount updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountUpdateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fees":{"get":{"summary":"List fees","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the order's fees, such as surcharges, handling and gift wrap, on the whole order or on one item or delivery.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Fee","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"fees found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fee"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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":{"$ref":"#/components/schemas/FeeCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fees/{id}":{"patch":{"summary":"Update fee","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits the label, amount or kind of a fee and re-sums the order totals. 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"}},{"name":"id","in":"path","required":true,"description":"Fee prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fee updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fee"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeUpdateParams"}}},"required":true}}},"/api/v3/admin/order_groups":{"get":{"summary":"List order groups","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns checkouts split into one order per seller, grouping the orders placed together.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[customer_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `orders_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `orders_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `orders_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `orders_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `orders_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `orders_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `orders_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `orders_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `orders_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `currency`, `email`, `id`, `number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderGroup","sortable":["created_at","currency","email","id","number","updated_at"]},"responses":{"200":{"description":"order groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/discount_codes":{"post":{"summary":"Apply a discount code","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies a discount code to a draft order and returns the order. A real code the order does not yet qualify for is kept and applies once it does. Completed orders refuse codes; change their discounts through manual discounts instead.\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 code applied","content":{"application/json":{}}},"422":{"description":"unknown discount code","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountCodeApplyParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/GiftCardApplyParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[additional_tax_total_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `additional_tax_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discount_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included_tax_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `non_taxable_adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `pre_tax_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `taxable_adjustment_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"LineItem","sortable":["additional_tax_total","adjustment_total","cost_price","created_at","discount_total","id","included_tax_total","non_taxable_adjustment_total","order_id","pre_tax_amount","price","quantity","tax_category_id","taxable_adjustment_total","updated_at","variant_id"]},"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":{"$ref":"#/components/schemas/LineItemCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/LineItemUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/StoreCreditApplyParams"}}},"required":true}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches order number or purchase order number (partial), the billing first or last name, or the exact email."},{"name":"q[complete]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `complete`."},{"name":"q[incomplete]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `incomplete`."},{"name":"q[partially_refunded]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `partially_refunded`."},{"name":"q[refunded]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `refunded`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `channel_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `completed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `considered_risky` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `coupon_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `delivery_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `fulfillment_status` | One of `backorder`, `canceled`, `partial`, `unfulfilled`, `fulfilled`, `delivered`, `pending`, `ready`, `shipped` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `item_total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `order_group_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `payment_status` | One of `none`, `authorized`, `partially_paid`, `paid`, `partially_refunded`, `refunded`, `overcharged`, `voided`, `balance_due`, `credit_owed`, `failed`, `void` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `po_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `draft`, `placed`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `total_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[bill_address_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `line_items_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `line_items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_group_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `promotions_coupon_codes_` | `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Order","sortable":["channel_id","completed_at","considered_risky","coupon_code","created_at","currency","customer_id","delivery_total","email","fulfillment_status","id","item_total","number","order_group_id","payment_state","payment_status","po_number","seller_id","shipment_state","status","total","total_quantity","updated_at"]},"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":{"$ref":"#/components/schemas/OrderCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/OrderUpdateParams"}}},"required":true}},"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\nOn a marketplace, an order holding several sellers' goods becomes one\norder per seller, and the response is the order group they belong to\nwith those orders nested inside it.\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":{"$ref":"#/components/schemas/OrderCompleteParams"}}},"required":true}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\n`cancel_reason_id` records why, from the store's own cancellation-reason\nvocabulary (`/admin/order_cancellation_reasons`), and `cancel_note` is a\nstaff-facing note; both are shown on the order afterwards.\n\nStock is always released — the goods are not going out either way — and\nevery payment is settled at the gateway, which releases an\nauthorization it never drew on and refunds a charge it cannot release.\n\n`refund_payments` and `refund_amount` govern the shared payment of a\nsplit checkout, where one payment covers several orders: they decide\nwhether this order's share comes back, and how much of it. A\n`refund_amount` on an ordinary order is refused with a 422.\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":{"$ref":"#/components/schemas/OrderCancelParams"}}},"required":true}}},"/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}/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/returns":{"get":{"summary":"List returns","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every return in the store, across all orders.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `refunded`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Return","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"returns listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/orders/{order_id}/returns":{"get":{"summary":"List order returns","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The returns opened on one 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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `requested`, `approved`, `received`, `refunded`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `reason_` | `active`, `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `number`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Return","sortable":["created_at","id","number","status","updated_at"]},"responses":{"200":{"description":"returns listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a return","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Opens a return on a completed order for fulfilled units the customer is sending back.\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":"return opened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Return"}}}},"422":{"description":"more returned than was fulfilled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/returns/{id}":{"patch":{"summary":"Update a return","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits the warehouse, reason, memo or metadata of a return. Its status moves only through the approve, receive, refund and cancel actions.\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"}},{"name":"id","in":"path","required":true,"description":"Return prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"return updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Return"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnUpdateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/returns/{id}/receive":{"patch":{"summary":"Receive a return","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records what arrived on an approved return. Omit `items` to receive everything as requested and resellable; send rows for a partial or damaged receipt.\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"}},{"name":"id","in":"path","required":true,"description":"Return prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"return received","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Return"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnReceiveParams"}}}}}},"/api/v3/admin/orders/{order_id}/returns/{id}/refund":{"patch":{"summary":"Refund a return","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Pays the customer back for a received return, to store credit or through the original payment.\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"}},{"name":"id","in":"path","required":true,"description":"Return prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"return refunded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Return"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnRefundParams"}}}}}},"/api/v3/admin/orders/{order_id}/returns/{id}/cancel":{"patch":{"summary":"Cancel a return","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Withdraws a return whose goods have not been received.\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"}},{"name":"id","in":"path","required":true,"description":"Return prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"return canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Return"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnCancelParams"}}}}}},"/api/v3/admin/orders/{order_id}/returns/{return_id}/labels":{"get":{"summary":"List return labels","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The shipping labels issued for sending one return back to the 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,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}},{"name":"return_id","in":"path","required":true,"description":"Return prefixed 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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `source` | One of `purchased`, `uploaded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `purchased`, `refund_requested`, `refunded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `source`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ShippingLabel","sortable":["carrier","created_at","id","source","status","tracking_number","updated_at"]},"responses":{"200":{"description":"labels listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `position`, `storefront_visible`, `type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PaymentMethod","sortable":["active","created_at","id","name","position","storefront_visible","type","updated_at"]},"responses":{"200":{"description":"payment methods found","content":{"application/json":{}}}}},"post":{"summary":"Create a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a payment method to the store. `type` is a shorthand from the\npayment method types endpoint, and `preferences` takes the values its\npreference schema declares (gateway credentials among them).\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":"payment method created","content":{"application/json":{}}},"422":{"description":"unknown payment method type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodCreateParams"}}},"required":true}}},"/api/v3/admin/payment_methods/types":{"get":{"summary":"List available payment provider types","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every registered payment provider with the JSON Schema of its `preferences`. `installed` marks a provider the store already has, which a \"Provider\" picker leaves out.\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":{}}}}},"patch":{"summary":"Update a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a payment method. Its `type` is fixed once created.\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":{"200":{"description":"payment method updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodUpdateParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[avs_response_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `avs_response` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cvv_response_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cvv_response_message` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `response_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state` | One of `checkout`, `processing`, `pending`, `completed`, `failed`, `void`, `invalid` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `checkout`, `processing`, `pending`, `completed`, `failed`, `void`, `invalid` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[order_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `payment_method_` | `active`, `created_at`, `id`, `name`, `position`, `storefront_visible`, `type`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `avs_response`, `created_at`, `cvv_response_code`, `cvv_response_message`, `id`, `response_code`, `state`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Payment","sortable":["amount","avs_response","created_at","cvv_response_code","cvv_response_message","id","response_code","state","status","updated_at"]},"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":{"$ref":"#/components/schemas/PaymentCreateParams"}}},"required":true}}},"/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, in full or for part of the authorized amount.\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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCaptureParams"}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `catalog_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `ends_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `match_policy` | One of `all`, `any` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `starts_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `draft`, `active`, `inactive`, `scheduled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PriceList","sortable":["catalog_id","created_at","ends_at","id","match_policy","name","position","starts_at","status","updated_at"]},"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":{"$ref":"#/components/schemas/PriceListCreateParams"}}},"required":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":{"$ref":"#/components/schemas/PriceListUpdateParams"}}},"required":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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches the variant's SKU, option value or product name, as variant search does."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `compare_at_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `min_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `price_list_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[price_list_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Price","sortable":["amount","compare_at_amount","created_at","currency","id","min_quantity","price_list_id","updated_at","variant_id"]},"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":{"$ref":"#/components/schemas/PriceCreateParams"}}},"required":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":{"$ref":"#/components/schemas/PriceUpdateParams"}}},"required":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":{"$ref":"#/components/schemas/PriceBulkUpsertParams"}}},"required":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":{"$ref":"#/components/schemas/PriceBulkDestroyParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/CustomFieldCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CustomFieldUpdateParams"}}},"required":true}},"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}/digital_assets":{"parameters":[{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"get":{"summary":"List product digital assets","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the downloadable files attached to the product's variants, oldest first.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DigitalAsset","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"digital assets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalAsset"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a product digital asset","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches a downloadable file to one of the product's variants (the\ndefault variant when `variant_id` is omitted). Upload the file first\nthrough `POST /api/v3/admin/files` with `visibility: 'private'`, then\nsend its `signed_id` here. A provider-backed asset sends\n`provider_type` and `provider_settings` instead of a file.\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":"digital asset created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAsset"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAssetCreateParams"}}},"required":true}}},"/api/v3/admin/products/{product_id}/digital_assets/{id}":{"parameters":[{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Digital asset ID","schema":{"type":"string"}}],"patch":{"summary":"Update a product digital asset","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes an asset's download limits, or replaces its file with a new\nprivate `signed_id`. Links customers already received keep working and\nserve the new file.\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":"digital asset updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAsset"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAssetUpdateParams"}}},"required":true}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\nAlso filters and sorts on the store's searchable custom fields, as `q[cf_<namespace>_<key>_<predicate>]` and `sort=cf_<namespace>_<key>`.\n\n**Sort by:** `available_on`, `best_selling`, `created_at`, `description`, `discontinue_on`, `id`, `manual`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","best_selling","created_at","description","discontinue_on","id","manual","name","price","seller_id","slug","status","updated_at"],"custom_fields":true},"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":{"$ref":"#/components/schemas/ProductCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ProductBulkStatusParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkCategoriesParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkCategoriesParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkCollectionsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkCollectionsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkChannelsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkChannelsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/BulkTagsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/BulkTagsParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductBulkDestroyParams"}}},"required":true}}},"/api/v3/admin/products/{id}/reject":{"parameters":[{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"patch":{"summary":"Reject a submitted product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down a product a seller submitted for review. The `reason` is\nsent back to the seller, who can fix the product and submit it again.\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":"product rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRejectParams"}}},"required":true}}},"/api/v3/admin/translations":{"get":{"summary":"Translation coverage for a resource type","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Reports how much of each record is translated into each of the store's non-default locales, plus per-locale totals. A record counts as covered for a locale only when every one of its translatable fields is filled in.\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":"resource_type","in":"query","required":true,"description":"A translatable resource type, e.g. `product`, `category`, `option_type`.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"search","in":"query","required":false,"description":"Free-text term, applied through whichever predicate the resource type whitelists (reported back as `search_field`).","schema":{"type":"string"}}],"responses":{"200":{"description":"coverage found","content":{"application/json":{}}},"404":{"description":"resource type is not translatable","content":{"application/json":{}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `owner_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `owner_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `owner_id`, `owner_type`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Policy","sortable":["created_at","id","name","owner_id","owner_type","updated_at"]},"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":{"$ref":"#/components/schemas/PolicyCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/PolicyUpdateParams"}}},"required":true}},"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/claim_reasons":{"get":{"summary":"List claim reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why a customer raised a claim — what the merchant got wrong, rather than a change of mind.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ClaimReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"claim reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a claim reason to this store. Names are unique per store, ignoring case.\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":"claim reason created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonCreateParams"}}},"required":true}}},"/api/v3/admin/claim_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Claim reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single claim reason 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"}}],"responses":{"200":{"description":"claim reason found","content":{"application/json":{}}},"404":{"description":"claim reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a claim reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"claim reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a claim reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a claim reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"claim reason deleted"}}}},"/api/v3/admin/order_cancellation_reasons":{"get":{"summary":"List order cancellation reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why an order was called off before it shipped. Staff pick one when canceling.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"OrderCancellationReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"order cancellation reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a order cancellation reason to this store. Names are unique per store, ignoring case.\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":"order cancellation reason created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonCreateParams"}}},"required":true}}},"/api/v3/admin/order_cancellation_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Order cancellation reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single order cancellation reason 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"}}],"responses":{"200":{"description":"order cancellation reason found","content":{"application/json":{}}},"404":{"description":"order cancellation reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a order cancellation reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"order cancellation reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a order cancellation reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a order cancellation reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"order cancellation reason deleted"}}}},"/api/v3/admin/refund_reasons":{"get":{"summary":"List refund reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why money went back. Some rows are seeded and looked up by name, so they refuse renaming and deletion.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"RefundReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"refund reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a refund reason to this store. Names are unique per store, ignoring case.\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":"refund reason created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonCreateParams"}}},"required":true}}},"/api/v3/admin/refund_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Refund reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single refund reason 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"}}],"responses":{"200":{"description":"refund reason found","content":{"application/json":{}}},"404":{"description":"refund reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a refund reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"refund reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a refund reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a refund reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"refund reason deleted"}}}},"/api/v3/admin/return_reasons":{"get":{"summary":"List return reasons","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Why a customer is sending items back. Shared by returns and exchanges.\n\nThe vocabulary is the merchant's own — seeded with a starting set and\nedited from the dashboard. Inactive rows stay for the records that\nalready reference them, but are not offered on new ones.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ReturnReason","sortable":["active","created_at","id","name","updated_at"]},"responses":{"200":{"description":"return reasons found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a return reason to this store. Names are unique per store, ignoring case.\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":"return reason created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonCreateParams"}}},"required":true}}},"/api/v3/admin/return_reasons/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Return reason ID","schema":{"type":"string"}}],"get":{"summary":"Get a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single return reason 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"}}],"responses":{"200":{"description":"return reason found","content":{"application/json":{}}},"404":{"description":"return reason not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a return reason or retires it. Deactivating keeps it on the records\nthat already carry it while removing it from the pickers.\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":{"200":{"description":"return reason updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a return reason","tags":["Reasons"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a return reason the store no longer uses. A reason already recorded\non a document is refused — deactivate it instead, so the history it\nexplains stays readable.\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":"return reason 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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[code_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `promotion_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state` | One of `unused`, `used` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[promotion_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `promotion_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CouponCode","sortable":["code","created_at","id","promotion_id","state","updated_at"]},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PromotionAction","sortable":["created_at","id","position","updated_at"]},"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`).\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":{"$ref":"#/components/schemas/PromotionActionCreateParams"}}},"required":true}}},"/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"}}],"patch":{"summary":"Update an action on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes an action's settings. For adjustment actions, `calculator`\nsets the calculator and its preferences; sending a different\ncalculator `type` swaps it. The action's own `type` is fixed once\ncreated.\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":{"200":{"description":"action updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionActionUpdateParams"}}},"required":true}},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PromotionRule","sortable":["created_at","id","updated_at"]},"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`).\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":{"$ref":"#/components/schemas/PromotionRuleCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/PromotionRuleUpdateParams"}}},"required":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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name and code (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `coupon_code`, `automatic` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `path` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `promotion_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `starts_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[coupon_codes_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `coupon_codes_` | `code`, `created_at`, `id`, `promotion_id`, `state`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Promotion","sortable":["code","created_at","expires_at","id","kind","name","path","promotion_category_id","starts_at","updated_at"]},"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":{"$ref":"#/components/schemas/PromotionCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/PromotionUpdateParams"}}},"required":true}},"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Refund","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/RefundCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/StoreUpdateParams"}}},"required":true}}},"/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":"Shorthand of the tagged resource: `product`, `order` or `customer`","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_categories":{"get":{"summary":"List tax categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the tax categories products and delivery methods can be assigned to, which tax rates then apply to.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `is_default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `tax_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxCategory","sortable":["created_at","id","is_default","name","tax_code","updated_at"]},"responses":{"200":{"description":"tax categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a tax category","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a tax category. `tax_code` is the code a tax provider uses to classify the goods in 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,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"tax category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCategory"}}}},"422":{"description":"validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCategoryCreateParams"}}},"required":true}}},"/api/v3/admin/tax_categories/{id}":{"parameters":[{"name":"id","in":"path","description":"Tax category ID","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a tax category","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 category updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCategory"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxCategoryUpdateParams"}}},"required":true}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `included_in_price` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `tax_category_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `amount`, `country_code`, `created_at`, `id`, `included_in_price`, `name`, `state_code`, `tax_category_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxRate","sortable":["amount","country_code","created_at","id","included_in_price","name","rate","state_code","tax_category_id","updated_at"]},"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 `rate` as a\ndecimal string (`\"0.19\"`) or `rate_percent` as a percentage string (`\"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":{"$ref":"#/components/schemas/TaxRateParams"}}},"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":{"$ref":"#/components/schemas/TaxRateParams"}}},"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":{"$ref":"#/components/schemas/TranslationBatchParams"}}},"required":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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[spree_roles_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"AdminUser","sortable":["created_at","email","first_name","id","last_name","updated_at"]},"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":{"$ref":"#/components/schemas/AdminUserUpdateParams"}}},"required":true}},"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. Removing a role needs the same rights as granting it, and the store always keeps at least one admin.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Invitation","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/InvitationCreateParams"}}},"required":true}}},"/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/{invitation_id}/acceptance_link":{"get":{"summary":"Get an invitation acceptance link","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the link the invitee opens to accept a pending invitation. The link carries the invitation token, so it needs write access to staff and the right to grant the invitation's role; invitation listings never include it.\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":"invitation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"acceptance link found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAcceptanceLink"}}}}}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Role","sortable":["created_at","id","name","updated_at"]},"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":{"$ref":"#/components/schemas/RoleCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/RoleUpdateParams"}}},"required":true}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `pickup_enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `returns_enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockLocation","sortable":["active","country_code","created_at","default","id","kind","name","pickup_enabled","returns_enabled","seller_id","state_code","updated_at"]},"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":{"$ref":"#/components/schemas/StockLocationCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/StockLocationUpdateParams"}}},"required":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/store_credits":{"get":{"summary":"List store credits","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every store credit in the current store, across all customers.\nRead-only: issuing, editing and deleting a credit stays nested under\nthe customer that holds it.\n\n`meta.totals` carries the outstanding balance as one row per currency,\nsummed over the same filter this request used — so filtering by a\ncustomer answers that customer's balance and no filter answers the\nstore's liability.\n\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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of memo (partial, case-insensitive)."},{"name":"q[from_gift_card]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `from_gift_card`."},{"name":"q[outstanding]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `outstanding`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (customer, created_by).","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `customer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `memo` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[created_by_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `created_by_` | `created_at`, `email`, `first_name`, `id`, `last_name`, `updated_at` |\n| `created_by_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `customer_addresses_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_customer_groups_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_orders_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `customer_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `customer_spree_roles_` | `created_at`, `id`, `name`, `updated_at` |\n| `customer_tags_` | `created_at`, `id`, `name`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `created_by_id`, `currency`, `customer_id`, `id`, `memo`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCredit","sortable":["amount","created_at","created_by_id","currency","customer_id","id","memo","updated_at"]},"responses":{"200":{"description":"store credits found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credits/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a store credit","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**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":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (customer, created_by).","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCredit"}}}},"404":{"description":"not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credits/{store_credit_id}/events":{"parameters":[{"name":"store_credit_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List a store credit's ledger","tags":["Store Credits"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every movement of the credit's balance, newest first: allocated when\nissued, authorized when a checkout starts against it, captured when\nthat order is paid, and voided or credited back if it is cancelled.\n\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":"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StoreCreditEvent","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"events found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditEvent"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/variants/{variant_id}/custom_fields":{"get":{"summary":"List variant custom fields","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the variant'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":"variant_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches SKU, option value or product name (partial, case-insensitive; at least three characters)."},{"name":"q[available_at_stock_location]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `available_at_stock_location` to the given value."},{"name":"q[product_name_or_sku_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `product_name_or_sku_cont` to the given value."},{"name":"q[search_by_product_name_or_sku]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_product_name_or_sku` to the given value."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[cost_currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carton_package_type_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `carton_weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cartons_per_pallet` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_of_origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `deleted_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `height` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `hs_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `minimum_order_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_multiple` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `product_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_unit` | One of `unit`, `carton` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `sku` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `track_inventory` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `units_per_carton` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `width` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_values_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `prices_price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `product_categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `product_channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `product_collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `product_labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `product_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Variant","sortable":["carton_package_type_id","carton_weight","cartons_per_pallet","cost_currency","cost_price","country_of_origin","created_at","deleted_at","depth","discontinue_on","height","hs_code","id","minimum_order_quantity","order_multiple","position","product_id","purchase_unit","sku","track_inventory","units_per_carton","updated_at","weight","width"]},"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":{"$ref":"#/components/schemas/VariantCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/VariantUpdateParams"}}},"required":true}},"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/variants":{"get":{"summary":"List variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every variant in the store across all products, for pickers and stock views that are not tied to one product.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches SKU, option value or product name (partial, case-insensitive; at least three characters)."},{"name":"q[available_at_stock_location]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `available_at_stock_location` to the given value."},{"name":"q[product_name_or_sku_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `product_name_or_sku_cont` to the given value."},{"name":"q[search_by_product_name_or_sku]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_product_name_or_sku` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[cost_currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carton_package_type_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `carton_weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cartons_per_pallet` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `cost_currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `cost_price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `country_of_origin` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `deleted_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `depth` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `height` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `hs_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `minimum_order_quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `order_multiple` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `product_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_unit` | One of `unit`, `carton` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `sku` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `track_inventory` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `units_per_carton` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `weight` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `width` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_values_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `prices_price_list_` | `catalog_id`, `created_at`, `ends_at`, `id`, `match_policy`, `name`, `position`, `starts_at`, `status`, `updated_at` |\n| `product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `product_categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `product_channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `product_collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `product_labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `product_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Variant","sortable":["carton_package_type_id","carton_weight","cartons_per_pallet","cost_currency","cost_price","country_of_origin","created_at","deleted_at","depth","discontinue_on","height","hs_code","id","minimum_order_quantity","order_multiple","position","product_id","purchase_unit","sku","track_inventory","units_per_carton","updated_at","weight","width"]},"responses":{"200":{"description":"variants found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of event name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[event_name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `delivered_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `event_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `execution_time` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `response_code` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `success` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `delivered_at`, `event_name`, `execution_time`, `id`, `response_code`, `success`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"WebhookDelivery","sortable":["created_at","delivered_at","event_name","execution_time","id","response_code","success","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of url (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"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"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `url` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `updated_at`, `url`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"WebhookEndpoint","sortable":["active","created_at","id","name","updated_at","url"]},"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":{"$ref":"#/components/schemas/WebhookEndpointCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/WebhookEndpointUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/WebhookEndpointDisableParams"}}},"required":true}}},"/api/v3/admin/webhook_events":{"get":{"summary":"List webhook events","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every event a webhook endpoint can subscribe to, including those installed extensions declare. Credential events reach only endpoints that name them, and subscribing to one needs the permission listed; deprecated events name their replacement.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"events returned","content":{"application/json":{}}}}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `active` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `active`, `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Catalog","sortable":["active","created_at","id","name","position","updated_at"]},"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":{"$ref":"#/components/schemas/CatalogParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CatalogAssignParams"}}},"required":true}}},"/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\ncarries no order.\n\n`expand=catalog_price` adds what a buyer on this agreement pays for\neach row and where the amount comes from: `explicit` (an amount\nentered on the catalog's own price list), `automatic` (that list's\npercentage applied to the shop price) or `base` (the shop price\nitself — this agreement does not price the product).\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":"catalog_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"expand","in":"query","required":false,"description":"Comma-separated. `catalog_price` adds the resolved price to every row.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"responses":{"200":{"description":"products found, with what the agreement charges","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProduct"}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}}},"/api/v3/admin/catalogs/{catalog_id}/order_minimums":{"get":{"summary":"List catalog order minimums","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The least a whole order must come to under this agreement. One row per currency — Spree holds no exchange rates, so a threshold is never stated once and converted.\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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CatalogOrderMinimum","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"order minimums found","content":{"application/json":{}}}}},"post":{"summary":"Create a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Requires orders in one currency to reach an amount. The buyer sees the shortfall on the cart while they can still act on it; completion is refused below it.\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":"order minimum created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogOrderMinimumParams"}}},"required":true}}},"/api/v3/admin/catalogs/{catalog_id}/order_minimums/{id}":{"patch":{"summary":"Update a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Restates one currency's threshold.\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"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"order minimum updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogOrderMinimumParams"}}},"required":true}},"delete":{"summary":"Delete a catalog order minimum","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Lifts the threshold for one currency, so orders in it may come to any total.\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"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"order minimum deleted"}}}},"/api/v3/admin/catalogs/{catalog_id}/quantity_rules":{"put":{"summary":"Set catalog quantity rules","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Writes the given products' quantity terms in one request, keyed by prefixed product id. The stated pair is written to every variant of the product, which is the grain the database keeps them at. Both fields null clears that product's terms; a product not yet in the assortment is added, since a term with nothing to apply to is not a reachable state. Products absent from the payload are left alone — an agreement may name terms for thousands of SKUs. Read them back on the assortment rows: `GET /catalogs/{id}/products?expand=quantity_rule`.\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":{"204":{"description":"quantity rules set"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProductTermsParams"}}},"required":true}}},"/api/v3/admin/catalogs/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Puts the agreement into effect: its audience starts seeing its\nassortment and paying its prices. Refused for a catalog nobody is\nassigned to, since activating it would reach no buyer — a channel's\ndefault catalog is reached through the channel instead, so it needs\nno assignment.\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":"catalog activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}},"/api/v3/admin/catalogs/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a catalog","tags":["Catalogs"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Takes the agreement out of effect. Everything it holds — assignments,\ncommercial terms, its price list — survives, so activating again\nresumes exactly what was there.\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":"catalog deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `automatic` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `permalink` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `products_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `sort_order` | One of `manual`, `best_selling`, `price asc`, `price desc`, `available_on desc`, `available_on asc`, `name asc`, `name desc` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Collection","sortable":["automatic","created_at","id","name","permalink","position","products_count","sort_order","updated_at"]},"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":{"$ref":"#/components/schemas/CollectionCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/CollectionUpdateParams"}}},"required":true}},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductMembershipRepositionParams"}}},"required":true}}},"/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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed (e.g., `commission_rate`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `percentage`, `fixed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `rate` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `total` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[commission_rate_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `commission_rate_` | `code`, `created_at`, `enabled`, `id`, `include_shipping`, `kind`, `name`, `position`, `tax_inclusive`, `updated_at`, `value` |\n| `commission_rate_commission_rules_` | `created_at`, `id`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `kind`, `order_id`, `rate`, `tax_amount`, `total`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CommissionLine","sortable":["amount","created_at","currency","id","kind","order_id","rate","tax_amount","total","updated_at"]},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-position`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `enabled` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `include_shipping` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `kind` | One of `percentage`, `fixed` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `tax_inclusive` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `value` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[commission_rules_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `commission_rules_` | `created_at`, `id`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `code`, `created_at`, `enabled`, `id`, `include_shipping`, `kind`, `name`, `position`, `tax_inclusive`, `updated_at`, `value`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CommissionRate","sortable":["code","created_at","enabled","id","include_shipping","kind","name","position","tax_inclusive","updated_at","value"]},"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":{"$ref":"#/components/schemas/CommissionRateCreateParams"}}},"required":true}}},"/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},"schema":{"type":"object","description":"JSON Schema of the type's `preferences`"},"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":{"$ref":"#/components/schemas/CommissionRateUpdateParams"}}},"required":true}},"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}/addresses":{"get":{"summary":"List company addresses","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the business's addresses: its sites, billing address and delivery points.\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":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[address1_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `address1` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `address2` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `company` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `first_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `last_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `postal_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `state_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Address","sortable":["address1","address2","city","company","country_code","created_at","first_name","id","last_name","phone","postal_code","state_code","updated_at"]},"responses":{"200":{"description":"addresses found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a company address","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds an address to the business. Pass `default_billing: true` or `default_shipping: true` to make it the default of that kind.\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":"company_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"address created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Address"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyAddressParams"}}},"required":true}}},"/api/v3/admin/companies/{company_id}/invitations":{"get":{"summary":"List company invitations","tags":["Companies"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the invitations into this business that are still waiting to be accepted.\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":"company_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[email_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `email`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CompanyInvitation","sortable":["created_at","email","id","updated_at"]},"responses":{"200":{"description":"invitations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyInvitation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CompanyMembership","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/CompanyMembershipCreateParams"}}},"required":true}}},"/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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[certificate_number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `certificate_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reason_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `pending`, `verified`, `expired`, `revoked` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `certificate_number`, `created_at`, `expires_at`, `id`, `reason_code`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxExemptionCertificate","sortable":["certificate_number","created_at","expires_at","id","reason_code","status","updated_at"]},"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_signed_id` takes the\n`signed_id` returned by `POST /api/v3/admin/files`.\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":{"$ref":"#/components/schemas/TaxExemptionCertificateParams"}}},"required":true}}},"/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).","parameters":[{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"TaxIdentifier","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/TaxIdentifierParams"}}},"required":true}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `company`, `division` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `parent_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `po_number_required` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[children_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `children_` | `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at` |\n| `children_external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `children_memberships_` | `created_at`, `id`, `updated_at` |\n| `external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `memberships_` | `created_at`, `id`, `updated_at` |\n| `parent_` | `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at` |\n| `parent_external_references_` | `created_at`, `external_id`, `id`, `resource_type`, `system`, `updated_at` |\n| `parent_memberships_` | `created_at`, `id`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `kind`, `name`, `parent_id`, `po_number_required`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Company","sortable":["created_at","id","kind","name","parent_id","po_number_required","updated_at"]},"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":{"$ref":"#/components/schemas/CompanyParams"}}},"required":true}}},"/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 — send the value 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/collections/{collection_id}/custom_fields":{"get":{"summary":"List collection custom fields","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the collection's custom field values.\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"}},{"name":"collection_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/sellers/{seller_id}/custom_fields":{"get":{"summary":"List seller custom fields","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the seller's custom field values.\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":"seller_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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"CustomField","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"custom fields found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryProfile","sortable":["created_at","id","name","position","updated_at"]},"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":{"$ref":"#/components/schemas/DeliveryProfileParams"}}},"required":true}}},"/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":{"parameters":[{"name":"delivery_profile_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List origin groups","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the profile's origin groups: the sets of warehouses that each quote their own delivery rates.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryOriginGroup","sortable":["created_at","id","name","position","updated_at"]},"responses":{"200":{"description":"origin groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryOriginGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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":{"$ref":"#/components/schemas/DeliveryOriginGroupParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/DeliveryProfileParams"}}},"required":true}},"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"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_to_sellers` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `storefront_visible` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_to_sellers`, `created_at`, `id`, `name`, `seller_id`, `storefront_visible`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryMethod","sortable":["available_to_sellers","created_at","id","name","seller_id","storefront_visible","updated_at"]},"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":{"$ref":"#/components/schemas/DeliveryMethodParams"}}},"required":true}}},"/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":{"get":{"summary":"List delivery zones","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the areas delivery methods ship to, each made of countries, states or postal code ranges.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `delivery_profile_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `delivery_profile_id`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryZone","sortable":["created_at","delivery_profile_id","id","name","updated_at"]},"responses":{"200":{"description":"delivery zones found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZone"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"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":{"$ref":"#/components/schemas/DeliveryZoneParams"}}},"required":true}}},"/api/v3/admin/delivery_methods/{delivery_method_id}/rules":{"get":{"summary":"List delivery method rules","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the conditions a delivery method must meet to be offered at checkout, such as an order total or weight range.\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":"delivery_method_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"DeliveryMethodRule","sortable":["created_at","id","updated_at"]},"responses":{"200":{"description":"rules found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodRule"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a delivery method rule","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a condition to a delivery method. `type` is a rule kind from the\ndelivery method rule types endpoint, and `preferences` takes the\nvalues its schema declares.\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"}},{"name":"delivery_method_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"rule created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMethodRule"}}}},"422":{"description":"unknown rule type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMethodRuleCreateParams"}}},"required":true}}},"/api/v3/admin/delivery_methods/{delivery_method_id}/rules/{id}":{"patch":{"summary":"Update a delivery method rule","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes a rule's settings or turns it off. Its `type` is fixed once created.\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":"delivery_method_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMethodRule"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMethodRuleUpdateParams"}}},"required":true}}},"/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"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Integration","sortable":["created_at","id","updated_at"]},"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":{"$ref":"#/components/schemas/IntegrationCreateParams"}}},"required":true}}},"/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}":{"patch":{"summary":"Update integration","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Changes an integration's credentials or turns it on or off. 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"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integration updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationUpdateParams"}}},"required":true}}},"/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":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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 `POST /api/v3/admin/files`, 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":{"$ref":"#/components/schemas/MediaLibraryCreateParams"}}},"required":true}}},"/api/v3/admin/media/{id}":{"parameters":[{"name":"id","in":"path","description":"Media ID","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a library file","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits a file in the library, such as its alt text.\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":{"200":{"description":"file updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaLibraryUpdateParams"}}},"required":true}}},"/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"}}],"get":{"summary":"List product media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the files placed on a product, in their display 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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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":"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":{"$ref":"#/components/schemas/MediaCreateParams"}}},"required":true}}},"/api/v3/admin/products/{product_id}/media/{id}":{"parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"Media ID","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update product media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits a file placed on a product: its alt text, position and focal\npoint, and which of the product's variants it shows for\n(`variant_ids`).\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":"media updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUpdateParams"}}},"required":true}}},"/api/v3/admin/products/{product_id}/variants/{variant_id}/media":{"parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"type":"string"}},{"name":"variant_id","in":"path","description":"Variant ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"List variant media","tags":["Media"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the files placed on one of a product's variants, in their display 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,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[attached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `attached`."},{"name":"q[filename_cont]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `filename_cont` to the given value."},{"name":"q[unattached]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `unattached`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[alt_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `alt` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `media_type` | One of `image`, `video`, `external_video` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `alt`, `created_at`, `id`, `media_type`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Media","sortable":["alt","created_at","id","media_type","position","updated_at"]},"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"]}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries":{"get":{"summary":"List deliveries","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The consignments of a parcel — one per tracking number, each with the carrier status last reported.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `pre_transit`, `in_transit`, `out_for_delivery`, `available_for_pickup`, `delivered`, `return_to_sender`, `failure`, `unknown` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Delivery","sortable":["carrier","created_at","id","status","tracking_number","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Record a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a tracked consignment to a parcel — a second box, or a freight PRO number covering several pallets. The carrier is free text.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery recorded","content":{"application/json":{}}},"422":{"description":"tracking number already recorded on this parcel","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}":{"patch":{"summary":"Correct a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Corrects the tracking number, carrier or link. A corrected number starts the carrier journey over.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a delivery","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a hand-entered consignment. One a label minted is refused — refund the label instead.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"204":{"description":"delivery deleted"}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}/mark_delivered":{"patch":{"summary":"Mark a delivery delivered","tags":["Deliveries"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Staff confirming one consignment arrived. The parcel becomes delivered once every one of its consignments has.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Delivery ID","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery marked delivered","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMarkDeliveredParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels":{"get":{"summary":"List shipping labels","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every label bought or uploaded for a parcel, refunded ones included.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[carrier_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `carrier` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `source` | One of `purchased`, `uploaded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `purchased`, `refund_requested`, `refunded` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `tracking_number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `carrier`, `created_at`, `id`, `source`, `status`, `tracking_number`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ShippingLabel","sortable":["carrier","created_at","id","source","status","tracking_number","updated_at"]},"responses":{"200":{"description":"labels found","content":{"application/json":{}}}}},"post":{"summary":"Buy or record a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"With no body, buys the label through the parcel's carrier account. With a `file`, records a label bought elsewhere. Either way the tracking number becomes a delivery on the parcel.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"201":{"description":"label purchased","content":{"application/json":{}}},"422":{"description":"provider does not produce labels","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShippingLabelCreateParams"}}},"required":true}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels/{id}":{"get":{"summary":"Get a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"One label, with what it cost and where to print it from.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"200":{"description":"label found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an uploaded label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an uploaded label. A purchased label is refunded instead, so the postage history stays honest.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"204":{"description":"label deleted"}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{fulfillment_id}/labels/{id}/refund":{"patch":{"summary":"Refund a shipping label","tags":["Shipping Labels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Asks the carrier to refund a purchased label. The consignment it minted is removed when the parcel never shipped.\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":"fulfillment_id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Shipping label ID","schema":{"type":"string"}}],"responses":{"200":{"description":"refund filed","content":{"application/json":{}}},"422":{"description":"uploaded labels cannot be refunded","content":{"application/json":{}}}}}},"/api/v3/admin/package_types":{"get":{"summary":"List package types","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's packaging vocabulary: the box it ships parcels in\nand the cartons, pallets and containers a wholesale order leaves on.\n\n`volume` is the cubic meters the package occupies, converted from\nwhatever unit its dimensions were recorded in — the figure freight\nvolume rules compare against. It is null until all three sides are\nmeasured.\n\n\n**Required scope:** `read_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `default` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `box`, `envelope`, `carton`, `pallet`, `container` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `default`, `id`, `kind`, `name`, `seller_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PackageType","sortable":["created_at","default","id","kind","name","seller_id","updated_at"]},"responses":{"200":{"description":"package types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PackageType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a kind of packaging to the store.\n\n`weight` is the empty package's own weight, added to content weight on\nevery quote; `max_weight` is what it can hold. Setting `default` makes\nthis the box every parcel quote is built on, and demotes whichever row\nheld that before.\n\nA variant references a `carton`-kind row to say what it is packed\ninto; other kinds are the merchant's own vocabulary.\n\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageTypeCreateParams"}}},"required":true}}},"/api/v3/admin/package_types/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Package type ID","schema":{"type":"string"}}],"get":{"summary":"Get a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single package type by prefixed ID.\n\n**Required scope:** `read_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}},"404":{"description":"package type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a package type. Every product packed in it follows the new geometry.\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackageTypeUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a package type","tags":["Package Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a kind of packaging. Refused while any variant is packed into\nit — repack those products first.\n\n\n**Required scope:** `write_package_types` (for API-key authentication).","parameters":[{"name":"x-spree-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":"package type deleted"}}}},"/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`expand=price_list_price` adds what the list charges for each variant, with its quantity\nbreaks as tiers, the same reading a catalog's products carry.\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":"price_list_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches product name or variant SKU (partial, case-insensitive), and the store's searchable custom fields."},{"name":"q[ascend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `ascend_by_price`."},{"name":"q[descend_by_price]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `descend_by_price`."},{"name":"q[in_categories][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `in_categories` to the given value."},{"name":"q[in_category]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_category` to the given value."},{"name":"q[in_collection]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_collection` to the given value."},{"name":"q[in_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `in_stock`."},{"name":"q[in_taxon]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `in_taxon` to the given value."},{"name":"q[not_discontinued]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `not_discontinued`."},{"name":"q[out_of_stock]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `out_of_stock`."},{"name":"q[price_between][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"Applies `price_between` to the given value."},{"name":"q[price_gte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_gte` to the given value."},{"name":"q[price_lte]","in":"query","required":false,"schema":{"type":"number"},"description":"Applies `price_lte` to the given value."},{"name":"q[search_by_name]","in":"query","required":false,"schema":{"type":"string"},"description":"Applies `search_by_name` to the given value."},{"name":"q[with_option_value_ids][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_option_value_ids` to the given value."},{"name":"expand","in":"query","required":false,"description":"Comma-separated. `price_list_price` adds the resolved price to every row.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `available_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `description` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `discontinue_on` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `price` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `slug` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `active`, `archived`, `proposed`, `rejected` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[categories_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `categories_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `categories_parent_` | `automatic`, `children_count`, `created_at`, `depth`, `id`, `name`, `parent_id`, `permalink`, `position`, `pretty_name`, `products_count`, `updated_at` |\n| `channels_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `collections_` | `automatic`, `created_at`, `id`, `name`, `permalink`, `position`, `products_count`, `sort_order`, `updated_at` |\n| `default_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `default_variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `default_variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `default_variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `default_variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `labels_` | `created_at`, `id`, `name`, `updated_at` |\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `product_categories_` | `category_id`, `created_at`, `id`, `position`, `product_id`, `updated_at` |\n| `product_type_` | `created_at`, `id`, `name`, `updated_at` |\n| `product_type_option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `store_` | `created_at`, `id`, `name`, `updated_at` |\n| `tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `variants_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variants_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variants_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variants_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variants_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Product","sortable":["available_on","created_at","description","discontinue_on","id","name","price","seller_id","slug","status","updated_at"]},"responses":{"200":{"description":"products found, with what the list charges","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceListProduct"}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/ProductMembershipParams"}}},"required":true}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[option_types_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `option_types_` | `created_at`, `id`, `kind`, `label`, `name`, `position`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `name`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"ProductType","sortable":["created_at","id","name","updated_at"]},"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":{"$ref":"#/components/schemas/ProductTypeCreateParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/ProductTypeUpdateParams"}}},"required":true}},"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/purchase_orders":{"get":{"summary":"List purchase orders","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stock bought from suppliers. A purchase order carries what a purchase\nhas and a stock transfer does not: a supplier, a unit cost per line and\nan expected arrival date.\n\nOrdered units never count toward availability. Nothing here changes\n`count_on_hand` until `receive` runs, because a merchant who has\nordered stock does not have it.\n\nStatuses are `draft`, `ordered`, `partially_received`, `received`, `over_received` and\n`canceled`. Each move between them is its own endpoint, not a `PATCH`\nthat writes `status`.\n\nFilter with Ransack predicates such as `q[status_eq]`,\n`q[supplier_id_eq]` or `q[expected_at_lteq]`. Expand `items`,\n`supplier` and `destination_location`.\n\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number and reference (partial, case-insensitive)."},{"name":"q[closed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `closed`."},{"name":"q[open]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `open`."},{"name":"q[overdue]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `overdue`."},{"name":"q[past_cancel_by]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `past_cancel_by`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, supplier, destination_location","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `cancel_by` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `closed_short_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `destination_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `expected_at` | Date | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `ordered_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `draft`, `ordered`, `partially_received`, `received`, `over_received`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `supplier_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[destination_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `destination_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `destination_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `items_` | `created_at`, `id`, `quantity_ordered`, `quantity_received`, `quantity_rejected`, `unit_cost`, `updated_at`, `variant_id` |\n| `items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `supplier_` | `city`, `contact_name`, `country_code`, `created_at`, `email`, `id`, `name`, `phone`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `cancel_by`, `closed_short_at`, `created_at`, `currency`, `destination_location_id`, `expected_at`, `id`, `number`, `ordered_at`, `received_at`, `reference`, `status`, `supplier_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"PurchaseOrder","sortable":["cancel_by","closed_short_at","created_at","currency","destination_location_id","expected_at","id","number","ordered_at","received_at","reference","status","supplier_id","updated_at"]},"responses":{"200":{"description":"purchase orders found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrder"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Drafts an order. Nothing is on order and nothing touches availability\nuntil the order is marked as ordered and then received.\n\n`currency` defaults to the store's; set it for a foreign-currency\norder. `expected_at` is a calendar date (`yyyy-mm-dd`) — the day the\nsupplier promised means the same day in every timezone.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"404":{"description":"supplier belongs to another store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderCreateParams"}}},"required":true}}},"/api/v3/admin/purchase_orders/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"get":{"summary":"Get a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, supplier, destination_location","schema":{"type":"string"}}],"responses":{"200":{"description":"purchase order found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"404":{"description":"purchase order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits a draft: its supplier, destination, dates, reference, notes and\nlines. Sending `items` replaces every line the order holds. Status\nmoves through the order's own actions, never through this endpoint.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderUpdateParams"}}},"required":true}}},"/api/v3/admin/purchase_orders/{id}/mark_ordered":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Place the order with the supplier","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a `draft` to `ordered`: the lines are frozen and `ordered_at` is\nstamped. Availability is still untouched — ordered stock is not stock\nthe merchant has.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}}}},"/api/v3/admin/purchase_orders/{purchase_order_id}/stock_receipts":{"parameters":[{"name":"purchase_order_id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"get":{"summary":"List the deliveries booked against an order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Each delivery the dock counted in, newest first — with its packing-slip reference and what it accepted and refused.\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `receivable_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `receivable_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_by_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `receivable_id`, `receivable_type`, `received_at`, `received_by_id`, `received_by_type`, `reference`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReceipt","sortable":["created_at","id","number","receivable_id","receivable_type","received_at","received_by_id","received_by_type","reference","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Book in a delivery","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The moment purchased goods first count toward availability. Records\none delivery as a stock receipt: what this delivery brought, per line,\nnot a running total — a second delivery adds to the first.\n\n`quantity_accepted` reaches the shelf; `quantity_rejected` is refused\nand recorded with a `rejection_reason` (`damaged`, `wrong_item`,\n`expired` or `other`), never stocked. Omit `items` to book in\neverything still outstanding, intact.\n\nEach `received` stock movement carries the line's `unit_cost` and\nnames the receipt, so a delivery can be reconciled against the ledger.\n\nThe order stays `partially_received` while any line is still owed,\nsettles in `received` once every line has what it expected, and in\n`over_received` once any line has more.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"delivery booked in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceipt"}}}},"422":{"description":"order has not been placed yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceiptCreateParams"}}},"required":true}}},"/api/v3/admin/purchase_orders/{id}/mark_draft":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Take an order back to draft","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Reopens a placed order for editing. Only while no delivery has been booked against it; `ordered_at` is cleared.\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"order back in draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}}}},"/api/v3/admin/purchase_orders/{id}/close":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Close an order short","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Ends a partially received order whose balance the supplier will not\ndeliver. Nothing moves: what arrived stays on the shelf, the\noutstanding count stays on each line, and the order settles in\n`received` with `closed_short_at` and the `reason` recorded.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"order closed short","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivableCloseParams"}}},"required":true}}},"/api/v3/admin/purchase_orders/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"description":"Purchase order ID","schema":{"type":"string"}}],"patch":{"summary":"Cancel a purchase order","tags":["Purchase Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Closes what is still outstanding. Nothing is unwound: a purchase order\nnever moved stock until units were received, and units already received\nstay on the shelf because the merchant has them.\n\nA `reason` is appended to the order's notes.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"purchase order cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderCancelParams"}}},"required":true}}},"/api/v3/admin/reporting/saved_reports":{"get":{"summary":"List saved reports","tags":["Reports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's saved reports, each a named query staff can run again.\n\n**Required scope:** `read_reports` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seeded` | True or false | `eq` `not_eq` `in` `not_in` `true` `false` `null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `seeded`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SavedReport","sortable":["created_at","id","name","seeded","updated_at"]},"responses":{"200":{"description":"saved reports found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SavedReport"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a saved report","tags":["Reports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Saves a reporting query under a name so staff can run it again. The query is validated against the reporting registry.\n\n**Required scope:** `write_reports` (for API-key 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":"saved report created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReportCreateParams"}}},"required":true}}},"/api/v3/admin/reporting/saved_reports/{id}":{"parameters":[{"name":"id","in":"path","description":"Saved report ID","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a saved report","tags":["Reports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_reports` (for API-key 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":"saved report updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReportUpdateParams"}}},"required":true}}},"/api/v3/admin/reporting/query":{"post":{"summary":"Run a reporting query","tags":["Reports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Runs a query against the store's registered metrics and dimensions, in\nthe store's time zone. A metric or dimension the registry does not know\nis refused with the names that are valid, and an API key needs the read\nscope of every resource the query touches.\n\n\n**Required scope:** `read_reports` (for API-key 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":"query results","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportingQueryParams"}}},"required":true}}},"/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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `position` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `name`, `position`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerRequirement","sortable":["created_at","id","name","position","updated_at"]},"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":{"$ref":"#/components/schemas/SellerRequirementCreateParams"}}},"required":true}}},"/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."},"schema":{"type":"object","description":"JSON Schema of the type's `preferences`"}}}}}}}}}}}},"/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":{"$ref":"#/components/schemas/SellerRequirementUpdateParams"}}},"required":true}},"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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `contact_email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `status` | One of `pending`, `invited`, `canceled`, `onboarding`, `ready_for_review`, `approved`, `rejected`, `suspended` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Seller","sortable":["contact_email","created_at","id","name","status","updated_at"]},"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":{"$ref":"#/components/schemas/SellerCreateParams"}}},"required":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":{"$ref":"#/components/schemas/SellerUpdateParams"}}},"required":true}},"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":{"$ref":"#/components/schemas/SellerInviteParams"}}},"required":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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerApproveParams"}}},"required":true}}},"/api/v3/admin/sellers/{id}/reopen_onboarding":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Send a seller back to onboarding","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a seller waiting for review to onboarding, with a `note`\nsaying what they have to fix. Unlike `reject`, this expects them back.\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":"onboarding reopened","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerReopenOnboardingParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/SellerSuspendParams"}}},"required":true}}},"/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":{"$ref":"#/components/schemas/SellerRejectParams"}}},"required":true}}},"/api/v3/admin/sellers/{seller_id}/balances":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"List a seller's balances","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Where one seller stands with the marketplace, one row per currency:\nwhat they have earned (completed transfers, refund reversals\nincluded), what has been paid to them, what is still owed, and\nearnings the payout provider has not yet confirmed.\n\nComputed from the ledger rather than stored, so the rows carry no id.\n\n\n**Required scope:** `read_payouts` (for API-key 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":"balances listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerBalance"}}},"required":["data"]}}}},"404":{"description":"seller not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{seller_id}/payouts":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"post":{"summary":"Settle a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sweeps everything this seller is owed into a payout — one per currency,\nsince nothing is ever converted between them.\n\nThis is what the `manual` payout interval means: the scheduled sweep\nruns on each seller's own interval and skips anyone set to `manual`,\nleaving the operator to decide when. It also settles any other seller\nearly.\n\nIt records the settlement rather than sending money: the built-in\nprovider waits to be told the bank transfer went out, which is\n`PATCH /api/v3/admin/seller_payouts/{id}/complete`.\n\nAnswers `422` when there is nothing to settle — no payout account,\nnothing unsettled, or a balance below the seller's minimum.\n\n\n**Required scope:** `write_payouts` (for API-key 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 settled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerPayout"}}},"required":["data"]}}}},"422":{"description":"nothing to settle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/sellers/{seller_id}/requirement_submissions":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}}],"get":{"summary":"List a seller's requirement submissions","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"What this seller submitted against the marketplace requirements, with the review decision on each.\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,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reviewed_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `status` | One of `pending`, `accepted`, `rejected`, `waived` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[requirement_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `requirement_` | `created_at`, `id`, `name`, `position`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `id`, `reviewed_at`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerRequirementSubmission","sortable":["created_at","id","reviewed_at","status","updated_at"]},"responses":{"200":{"description":"submissions listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerRequirementSubmission"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Waive a requirement for a seller","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Excuses this one seller from a requirement the marketplace asks of\neveryone, recorded as a `waived` submission. The operator never\nsubmits on the seller's behalf: this endpoint only waives.\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":"requirement waived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementSubmission"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementWaiveParams"}}},"required":true}}},"/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/accept":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Requirement submission ID","schema":{"type":"string"}}],"patch":{"summary":"Accept a seller's submission","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks what the seller submitted as meeting the requirement.\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":"submission accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementSubmission"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementReviewParams"}}}}}},"/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/reject":{"parameters":[{"name":"seller_id","in":"path","required":true,"description":"Seller prefixed ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Requirement submission ID","schema":{"type":"string"}}],"patch":{"summary":"Reject a seller's submission","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Turns down what the seller submitted. `review_note` is the reason sent\nback to the seller, who can then submit again.\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":"submission rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementSubmission"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerRequirementReviewParams"}}}}}},"/api/v3/admin/seller_transfers":{"get":{"summary":"List seller transfers","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The fund ledger: what each seller earned from an order, and any\nreversals. Read-only, since fulfilment and refunds write it.\n\n\n**Required scope:** `read_payouts` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of reference (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `earning`, `refund_reversal` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `payout_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `provider` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed`, `unresolved` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[payout_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `payout_` | `amount`, `created_at`, `currency`, `id`, `period_end`, `period_start`, `provider`, `reference`, `seller_id`, `status`, `updated_at` |\n| `payout_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `refund_` | `created_at`, `id`, `updated_at` |\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `kind`, `order_id`, `payout_id`, `provider`, `reference`, `seller_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerTransfer","sortable":["amount","created_at","currency","id","kind","order_id","payout_id","provider","reference","seller_id","status","updated_at"]},"responses":{"200":{"description":"transfers listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerTransfer"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/seller_payouts":{"get":{"summary":"List seller payouts","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Settlements to sellers, each batching the transfers that had\naccumulated since the last. `pending` and `processing` payouts are\nstill owed; `completed` ones reached the seller.\n\n\n**Required scope:** `read_payouts` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of reference (partial, case-insensitive)."},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page (max 100)","schema":{"type":"integer"}},{"name":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[currency_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `amount` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `currency` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `period_end` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `period_start` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `provider` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `seller_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `pending`, `processing`, `completed`, `failed`, `unresolved` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[seller_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `amount`, `created_at`, `currency`, `id`, `period_end`, `period_start`, `provider`, `reference`, `seller_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"SellerPayout","sortable":["amount","created_at","currency","id","period_end","period_start","provider","reference","seller_id","status","updated_at"]},"responses":{"200":{"description":"payouts listed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SellerPayout"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/seller_payouts/{id}/complete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Seller payout prefixed ID","schema":{"type":"string"}}],"patch":{"summary":"Mark a payout paid","tags":["Sellers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records that the money reached the seller, which is what debits their\nbalance — a balance is earnings less *completed* settlements.\n\nThis is the step the built-in provider waits for: it files the\nsettlement when the payout is created and expects an operator to say\nthe bank transfer went out. A connected provider marks its own payouts\npaid when its webhook reports the money landed.\n\nSend the provider's own id for the transfer as `reference` when there\nis one. Completing a payout that is already complete answers `200`\nwithout recording it twice, so a redelivered webhook or a double click\nis safe.\n\n\n**Required scope:** `write_payouts` (for API-key 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":"payout completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerPayout"}}}},"404":{"description":"payout not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerPayoutCompleteParams"}}},"required":true}}},"/api/v3/admin/stock_levels":{"get":{"summary":"List stock levels","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"One row per variant per stock location, carrying every figure the\nInventory page shows: `count_on_hand` (on hand), `allocated_count`\n(committed to placed orders), `reserved_count` (held by checkouts in\nprogress), `available_count` (on hand minus committed) and\n`incoming_count` (on its way on an open purchase order or a transfer\nin transit). The variant and location are named flat on the row\n(`variant_name`, `variant_sku`, `stock_location_name`, `thumbnail_url`)\nso a list needs no expansion.\n\nFilter with `q[stock_location_id_eq]`, `q[variant_id_eq]` or\n`q[variant_sku_or_variant_product_name_cont]`.\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,"schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of variant sku and variant product name (partial, case-insensitive)."},{"name":"q[with_stock_status][]","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Applies `with_stock_status` to the given value."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[allocated_count_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `allocated_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `count_on_hand` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `incoming_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reserved_count` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `stock_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `variant_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[stock_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `variant_option_values_` | `created_at`, `id`, `label`, `name`, `position`, `updated_at` |\n| `variant_prices_` | `amount`, `compare_at_amount`, `created_at`, `currency`, `id`, `min_quantity`, `price_list_id`, `updated_at`, `variant_id` |\n| `variant_product_` | `available_on`, `created_at`, `description`, `discontinue_on`, `id`, `name`, `price`, `seller_id`, `slug`, `status`, `updated_at` |\n| `variant_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `variant_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockLevel","sortable":["allocated_count","count_on_hand","created_at","id","incoming_count","reserved_count","stock_location_id","updated_at","variant_id"]},"responses":{"200":{"description":"stock levels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLevel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/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":{"$ref":"#/components/schemas/StockLevelBulkUpsertParams"}}},"required":true}}},"/api/v3/admin/stock_levels/{id}":{"patch":{"summary":"Update a stock level","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Corrects one shelf. Send `count_on_hand` for the count the shelf should\nend at, or `adjustment` for a signed change; either is recorded as a\nstock movement labelled with `reason`.\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"}},{"name":"id","in":"path","required":true,"description":"Stock level ID","schema":{"type":"string"}}],"responses":{"200":{"description":"stock level updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLevel"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLevelUpdateParams"}}},"required":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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[reason_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `exchange_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `fulfillment_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `kind` | One of `received`, `allocated`, `shipped`, `released`, `adjusted` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `purchase_order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reason` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `return_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_level_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_receipt_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `stock_transfer_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `unit_cost` | Amount | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[stock_level_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `stock_level_` | `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id` |\n| `stock_level_stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_level_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `exchange_id`, `fulfillment_id`, `id`, `kind`, `order_id`, `purchase_order_id`, `quantity`, `reason`, `return_id`, `stock_level_id`, `stock_receipt_id`, `stock_transfer_id`, `unit_cost`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockMovement","sortable":["created_at","exchange_id","fulfillment_id","id","kind","order_id","purchase_order_id","quantity","reason","return_id","stock_item_id","stock_level_id","stock_receipt_id","stock_transfer_id","unit_cost","updated_at"]},"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"}}}}}}},"/api/v3/admin/stock_reservations":{"get":{"summary":"List stock reservations","tags":["Stock"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the stock held for orders that are being checked out, so it cannot be sold twice before they complete or the hold expires.\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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[created_at_eq]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `expires_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `line_item_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `order_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `quantity` | Number | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `stock_level_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[line_item_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `line_item_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `line_item_order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `line_item_tax_category_` | `created_at`, `id`, `is_default`, `name`, `tax_code`, `updated_at` |\n| `line_item_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `order_` | `channel_id`, `completed_at`, `considered_risky`, `coupon_code`, `created_at`, `currency`, `customer_id`, `delivery_total`, `email`, `fulfillment_status`, `id`, `item_total`, `number`, `order_group_id`, `payment_status`, `po_number`, `seller_id`, `status`, `total`, `total_quantity`, `updated_at` |\n| `order_bill_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_channel_` | `active`, `code`, `created_at`, `default`, `id`, `name`, `store_id`, `updated_at` |\n| `order_customer_` | `accepts_email_marketing`, `created_at`, `email`, `first_name`, `id`, `last_name`, `phone`, `updated_at` |\n| `order_fulfillments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_line_items_` | `additional_tax_total`, `adjustment_total`, `cost_price`, `created_at`, `discount_total`, `id`, `included_tax_total`, `non_taxable_adjustment_total`, `order_id`, `pre_tax_amount`, `price`, `quantity`, `tax_category_id`, `taxable_adjustment_total`, `updated_at`, `variant_id` |\n| `order_order_group_` | `created_at`, `currency`, `email`, `id`, `number`, `updated_at` |\n| `order_promotions_` | `code`, `created_at`, `expires_at`, `id`, `kind`, `name`, `path`, `promotion_category_id`, `starts_at`, `updated_at` |\n| `order_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `order_ship_address_` | `address1`, `address2`, `city`, `company`, `country_code`, `created_at`, `first_name`, `id`, `last_name`, `phone`, `postal_code`, `state_code`, `updated_at` |\n| `order_shipments_` | `created_at`, `id`, `number`, `updated_at` |\n| `order_store_` | `created_at`, `id`, `name`, `updated_at` |\n| `order_tags_` | `created_at`, `id`, `name`, `updated_at` |\n| `stock_level_` | `allocated_count`, `count_on_hand`, `created_at`, `id`, `incoming_count`, `reserved_count`, `stock_location_id`, `updated_at`, `variant_id` |\n| `stock_level_stock_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `stock_level_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n\n</Accordion>\n\n**Sort by:** `created_at`, `expires_at`, `id`, `line_item_id`, `order_id`, `quantity`, `stock_level_id`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReservation","sortable":["created_at","expires_at","id","line_item_id","order_id","quantity","stock_item_id","stock_level_id","updated_at"]},"responses":{"200":{"description":"stock reservations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockReservation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}}},"/api/v3/admin/stock_transfers":{"get":{"summary":"List stock transfers","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Stock moving between two of the merchant's own warehouses.\n\nA transfer is a trip, not an instant. Units leave the source when the\ntransfer is marked in transit and land at the destination when somebody\ncounts them in — in between they are in flight, gone from one shelf and\nnot yet on the other.\n\nStatuses are `draft`, `ready_to_ship`, `in_transit`,\n`partially_received`, `received`, `over_received` and `canceled`. Each move between them\nis its own endpoint, not a `PATCH` that writes `status`.\n\nReceiving from a supplier is a purchase order, not a transfer with a\nmissing source.\n\nFilter with Ransack predicates such as `q[status_eq]`,\n`q[source_location_id_eq]` or `q[number_or_reference_cont]`. Expand\n`items`, `source_location` and `destination_location`.\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":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of number and reference (partial, case-insensitive)."},{"name":"q[closed]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `closed`."},{"name":"q[open]","in":"query","required":false,"schema":{"type":"boolean"},"description":"Set to `true` to apply `open`."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, source_location, destination_location","schema":{"type":"string"}}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `closed_short_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `destination_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `shipped_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `source_location_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `status` | One of `draft`, `ready_to_ship`, `in_transit`, `partially_received`, `received`, `over_received`, `canceled` | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n<Accordion title=\"Filters through associations\">\n\nPrefix an associated record's attribute with the association, as in `q[destination_location_id_eq]`. The same predicates apply.\n\n| Prefix | Attributes |\n|---|---|\n| `destination_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `destination_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n| `items_` | `created_at`, `id`, `quantity_received`, `quantity_rejected`, `quantity_shipped`, `updated_at`, `variant_id` |\n| `items_variant_` | `carton_package_type_id`, `carton_weight`, `cartons_per_pallet`, `cost_currency`, `cost_price`, `country_of_origin`, `created_at`, `deleted_at`, `depth`, `discontinue_on`, `height`, `hs_code`, `id`, `minimum_order_quantity`, `order_multiple`, `position`, `product_id`, `purchase_unit`, `sku`, `track_inventory`, `units_per_carton`, `updated_at`, `weight`, `width` |\n| `source_location_` | `active`, `country_code`, `created_at`, `default`, `id`, `kind`, `name`, `pickup_enabled`, `returns_enabled`, `seller_id`, `state_code`, `updated_at` |\n| `source_location_seller_` | `contact_email`, `created_at`, `id`, `name`, `status`, `updated_at` |\n\n</Accordion>\n\n**Sort by:** `closed_short_at`, `created_at`, `destination_location_id`, `id`, `number`, `received_at`, `reference`, `shipped_at`, `source_location_id`, `status`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockTransfer","sortable":["closed_short_at","created_at","destination_location_id","id","number","received_at","reference","shipped_at","source_location_id","status","updated_at"]},"responses":{"200":{"description":"stock transfers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockTransfer"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Persists a draft — a packing list the merchant can still edit. Nothing\nmoves until the transfer is marked in transit.\n\nA draft may legitimately open empty and gain lines as the merchant\npacks. Both warehouses are required and must belong to the same store.\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 transfer created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"404":{"description":"warehouse belongs to another store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferCreateParams"}}},"required":true}}},"/api/v3/admin/stock_transfers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**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":"expand","in":"query","required":false,"description":"Comma-separated associations to embed: items, source_location, destination_location","schema":{"type":"string"}}],"responses":{"200":{"description":"stock transfer found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"404":{"description":"stock transfer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Edits a draft: its reference, notes, either end, and its lines.\nSending `items` replaces every line the draft holds. Status moves\nthrough the transfer's own actions, never through this endpoint.\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 transfer updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Drafts only. Past `draft` the transfer describes a box that physically\nexists, so it is cancelled rather than deleted — a 422 says so.\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 transfer deleted"}}}},"/api/v3/admin/stock_transfers/{id}/mark_ready":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Mark a transfer ready to ship","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Freezes the lines so the warehouse and the merchant are looking at the\nsame list. Nothing leaves the shelf yet.\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":"transfer is ready to ship","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}}}},"/api/v3/admin/stock_transfers/{id}/mark_in_transit":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Send a transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The moment stock leaves the source warehouse: `shipped` movements are\nwritten against the source's levels and `shipped_at` is stamped. The\ndestination is deliberately untouched — the units are in flight.\n\nRefused with a 422 when the source does not hold enough. Pass\n`force: true` to record the departure anyway: a merchant forcing it has\ndecided the box left whatever the ledger claims.\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":"transfer is in transit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferMarkInTransitParams"}}},"required":true}}},"/api/v3/admin/stock_transfers/{stock_transfer_id}/stock_receipts":{"parameters":[{"name":"stock_transfer_id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"get":{"summary":"List the deliveries counted in against a transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Each delivery the destination counted in, with what it accepted and refused.\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":"q","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[number_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `number` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `receivable_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `receivable_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `received_by_id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `received_by_type` | Type | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `reference` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `created_at`, `id`, `number`, `receivable_id`, `receivable_type`, `received_at`, `received_by_id`, `received_by_type`, `reference`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"StockReceipt","sortable":["created_at","id","number","receivable_id","receivable_type","received_at","received_by_id","received_by_type","reference","updated_at"]},"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}}}},"post":{"summary":"Count a delivery in","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Records one delivery the destination warehouse counted in, as a stock\nreceipt. Partial receipt is the normal case: ten left, eight arrived,\ntwo were crushed in transit. Quantities are this delivery's counts —\na second box adds to the first rather than restating it.\n\n`quantity_accepted` lands on the destination's shelf;\n`quantity_rejected` is refused and recorded with a `rejection_reason`\n(`damaged`, `wrong_item`, `expired` or `other`), never stocked. A\nrefused unit still arrived, so it counts toward the trip being over.\nOmit `items` to count in everything still outstanding, intact.\n\nThe transfer stays `partially_received` while units are still on the\nroad, settles in `received` once everything has arrived, and in\n`over_received` once more arrived than was shipped.\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":"delivery counted in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceipt"}}}},"422":{"description":"transfer has not shipped yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockReceiptCreateParams"}}},"required":true}}},"/api/v3/admin/stock_transfers/{id}/mark_draft":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Take a transfer back to draft","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unfreezes a ready-to-ship transfer so its lines can be changed. Nothing has left the source, so nothing is undone.\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":"transfer back in draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}}}},"/api/v3/admin/stock_transfers/{id}/close":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Close a transfer short","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Ends a partially received transfer whose missing units are not going\nto turn up. Nothing moves — they already left the source — and the\ntransfer settles in `received` with `closed_short_at` and the\n`reason` recorded, the outstanding count left on each line.\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":"transfer closed short","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivableCloseParams"}}},"required":true}}},"/api/v3/admin/stock_transfers/{id}/cancel":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock transfer ID","schema":{"type":"string"}}],"patch":{"summary":"Cancel a stock transfer","tags":["Stock Transfers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Calls the trip off.\n\nCancelling a draft or a packed transfer costs nothing — no stock has\nmoved. Cancelling one already in transit needs `on_in_transit`, because\nthe units are physically gone from the source: either they come back\n(`restock`, as if the transfer had never shipped) or they are written\noff as lost (`write_off`). There is no default — guessing would either\ninvent stock or destroy it — so an in-flight cancellation without it is\nrefused with a 422.\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":"transfer cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransfer"}}}},"422":{"description":"in-transit cancellation needs a decision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockTransferCancelParams"}}},"required":true}}},"/api/v3/admin/suppliers":{"get":{"summary":"List suppliers","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Who the merchant buys stock from. A supplier is an address-book entry\nwith a purchasing history — not a party that sells on the store, which\nis a seller.\n\nSuppliers belong to one store, and are soft-deleted so the purchase\norders that name them stay readable.\n\nFilter with Ransack predicates such as\n`q[name_or_contact_name_or_email_cont]` or `q[country_code_eq]`.\n\n\n**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"q[search]","in":"query","required":false,"schema":{"type":"string"},"description":"Matches any of name, contact name, and email (partial, case-insensitive)."},{"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","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":true},"description":"Attribute filters, as `q[<attribute>_<predicate>]=value`. See Filters above for the list."}],"x-mint":{"content":"## Filters\n\nFilter with `q[<attribute>_<predicate>]=value`, for example `q[name_cont]=…`. Send a list as `q[<attribute>_in][]=a&q[<attribute>_in][]=b`. [How filters work](/api-reference/admin-api/querying#which-filters-an-endpoint-accepts).\n\n| Attribute | Kind | Predicates |\n|---|---|---|\n| `city` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `contact_name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `country_code` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `created_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n| `email` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `id` | Prefixed ID | `eq` `not_eq` `in` `not_in` `null` `not_null` |\n| `name` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `phone` | Text | `eq` `not_eq` `in` `not_in` `cont` `i_cont` `not_cont` `start` `end` `null` `not_null` `present` `blank` |\n| `updated_at` | Date and time | `eq` `not_eq` `in` `not_in` `lt` `lteq` `gt` `gteq` `null` `not_null` |\n\n**Sort by:** `city`, `contact_name`, `country_code`, `created_at`, `email`, `id`, `name`, `phone`, `updated_at`. Prefix a field with `-` to sort descending."},"x-spree-filters":{"table":"Supplier","sortable":["city","contact_name","country_code","created_at","email","id","name","phone","updated_at"]},"responses":{"200":{"description":"suppliers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a supplier to this store's address book. The address is inline —\nstreet, city, state and country live on the supplier itself, the same\nshape a stock location uses.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierCreateParams"}}},"required":true}}},"/api/v3/admin/suppliers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Supplier ID","schema":{"type":"string"}}],"get":{"summary":"Get a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"404":{"description":"supplier not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierUpdateParams"}}},"required":true}},"delete":{"summary":"Delete a supplier","tags":["Suppliers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the supplier, so the purchase orders naming it stay\nreadable. Refused with a 422 while a purchase order still points at it.\n\n\n**Required scope:** `write_purchasing` (for API-key authentication).","parameters":[{"name":"x-spree-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":"supplier deleted"}}}}},"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 short names, e.g. [\"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"]},"PreferenceSchema":{"type":"object","description":"The JSON Schema (draft 2020-12) of a type's `preferences`: one property per setting, with `format` (`money`, `currency`, `iso-country`, `prefixed-id`, …), `enum`, `default`, `x-spree-secret` for a secret and `x-spree-prefix` for an id list. Unknown keys are refused.","additionalProperties":true},"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"]},"Actor":{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"label":{"type":"string","nullable":true}},"required":["id","type","label"],"x-typelizer":true},"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","enum":["publishable","secret"]},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by_label":{"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","created_by_type","created_by_label"],"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"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","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},"po_number_required":{"type":"boolean"},"po_document_filename":{"type":"string","nullable":true},"po_document_byte_size":{"type":"number","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"po_number":{"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},"adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"fee_total":{"type":"string","nullable":true},"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"}},"order_minimum":{"type":"string","nullable":true},"order_minimum_shortfall":{"type":"string","nullable":true},"below_order_minimum":{"type":"boolean","nullable":true},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true},"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","po_number_required","po_document_filename","po_document_byte_size","number","token","email","customer_note","po_number","currency","locale","total_quantity","warnings","coupon_code","item_total","adjustment_total","discount_total","tax_total","included_tax_total","additional_tax_total","total","gift_card_total","amount_due","delivery_total","fee_total","store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","order_minimum","order_minimum_shortfall","below_order_minimum","freight_summary","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},"CatalogOrderMinimum":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"}},"required":["id","currency","created_at","updated_at","amount"],"x-typelizer":true},"CatalogPrice":{"type":"object","properties":{"id":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"currency":{"type":"string"},"source":{"type":"string","enum":["explicit","automatic","base"]},"break_count":{"type":"number"},"amount":{"type":"string"},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPriceTier"}}},"required":["id","label","sku","currency","source","break_count","amount","tiers"],"x-typelizer":true},"CatalogPriceTier":{"type":"object","properties":{"min_quantity":{"type":"number"},"amount":{"type":"string"}},"required":["min_quantity","amount"],"x-typelizer":true},"CatalogProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"quantity_rule":{"allOf":[{"$ref":"#/components/schemas/CatalogProductTerm"}],"nullable":true},"catalog_variants":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPrice"}}},"required":["id","name","thumbnail_url"],"x-typelizer":true},"CatalogProductTerm":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"product_name":{"type":"string","nullable":true},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"mixed":{"type":"boolean"}},"required":["id","product_id","product_name","minimum_order_quantity","order_multiple","mixed"],"x-typelizer":true},"CatalogQuantityRule":{"type":"object","properties":{"id":{"type":"string"},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant_id":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"product_name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","minimum_order_quantity","order_multiple","created_at","updated_at","variant_id","variant_sku","product_name","options_text"],"x-typelizer":true},"Catalog":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"position":{"type":"number","nullable":true},"metadata":{"type":"object","nullable":true},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"products_count":{"type":"number"},"pricing_strategy":{"type":"string"},"order_minimums":{"type":"array","items":{"$ref":"#/components/schemas/CatalogOrderMinimum"}},"price_list":{"$ref":"#/components/schemas/PriceList"},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/CatalogAssignment"}}},"required":["id","name","description","active","position","metadata","minimum_order_quantity","order_multiple","created_at","updated_at","products_count","pricing_strategy"],"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","nullable":true,"enum":["public","prices_hidden","login_required"]},"guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_routing_strategy":{"type":"string","nullable":true,"description":"Order routing strategy; null inherits the store setting. Built-in: rules. Extensions may register more."},"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","created_at","updated_at","order_routing_strategy","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"},"pre_tax_amount":{"type":"string"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"tax_total":{"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","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","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":{"anyOf":[{"type":"string","enum":["open","approved","resolved","denied","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id","created_by_type"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["is_equal_to","is_not_equal_to","contains","does_not_contain"]},"type":{"type":"string","description":"Rule type. Built-in: tag, available_on, sale. Extensions may register more."}},"required":["id","value","match_policy","type"],"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","enum":["all","any"]},"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","enum":["percentage","fixed"]},"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"},"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},"commission_rate":{"$ref":"#/components/schemas/CommissionRate"}},"required":["id","kind","currency","taxability_reason","country_code","state_code","created_at","updated_at","rate","tax_rate","amount","tax_amount","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","enum":["percentage","fixed"]},"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","description":"Rule type. Built-in: seller_rule, category_rule, product_rule, item_total_rule. Extensions may register more."},"commission_rate_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/CommissionRulePreferences"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"seller_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"sellers":{"type":"array","items":{"$ref":"#/components/schemas/Seller"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}},"required":["id","created_at","updated_at","type","commission_rate_id","preferences","product_ids","seller_ids","category_ids"],"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","enum":["pending","accepted","revoked","expired"]},"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","enum":["company","division"]},"po_number_required":{"type":"boolean"},"parent_id":{"type":"string","nullable":true},"ancestors":{"type":"array","items":{"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","po_number_required","parent_id","ancestors","external_references","metadata","created_at","updated_at","children_count","members_count"],"x-typelizer":true},"ConsentRecord":{"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"source":{"type":"string","enum":["checkout","registration","account","admin","newsletter","anonymization","unknown","import","storefront"]},"accepted":{"type":"boolean"},"email":{"type":"string","nullable":true},"ip_address":{"type":"string","nullable":true},"created_at":{"type":"string"},"recorded_at":{"type":"string","nullable":true},"documents":{"type":"array","items":{"type":"object"}}},"required":["id","purpose","source","accepted","email","ip_address","created_at","recorded_at","documents"],"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"]},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"resource_type":{"type":"string","description":"Shorthand of the resource the field attaches to, for example product, variant, order, customer or category. Discover the full list from the resource_types endpoint; extensions may register more."}},"required":["id","namespace","key","label","field_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at","resource_type"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","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"},"email_marketing_consent_updated_at":{"type":"string","nullable":true},"full_name":{"type":"string"},"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"},"email_marketing_consent_source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"anonymized_at":{"type":"string","nullable":true},"anonymized":{"type":"boolean"},"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"},"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"}},"companies":{"type":"array","items":{"$ref":"#/components/schemas/Company"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","email_marketing_consent_updated_at","full_name","available_store_credit_total","failed_attempts","metadata","email_marketing_consent_source","created_at","updated_at","anonymized_at","anonymized","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DashboardCounter":{"type":"object","properties":{"key":{"type":"string","description":"Registered counter name. The dashboard translates it; built-in: orders_to_fulfill, payments_to_collect, open_returns, open_exchanges, open_claims, low_stock_items, out_of_stock_items."},"value":{"type":"number"},"link":{"type":"object","nullable":true,"description":"The list filter that shows exactly the rows counted, or null when no list can."},"nav":{"type":"string","nullable":true,"description":"Sidebar entry key this count badges, or null."}},"required":["key","value","link","nav"],"x-typelizer":true},"DataRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["access","erasure"]},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"requested_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"email":{"type":"string"},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"requested_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"}},"required":["id","number","kind","status","requested_at","completed_at","expires_at","email","error_message","created_at","updated_at","customer_id","requested_by_id"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more."},"preferences":{"$ref":"#/components/schemas/DeliveryMethodRulePreferences"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","preferences","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},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"available_to_sellers":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"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"}},"fulfillment_provider":{"type":"string","description":"Fulfillment provider. Built-in: manual, digital, pickup, pickup_point. Provider gems register more (e.g. easy_post)."},"pickup_point_provider":{"type":"string","nullable":true,"description":"Pickup point network. None built in; provider gems register them."},"rate_provider":{"type":"string","nullable":true,"description":"Rate provider; null prices through the calculator. Built-in: internal, freight. Provider gems register more (e.g. easy_post)."},"calculator":{"allOf":[{"$ref":"#/components/schemas/DeliveryMethodCalculator"}],"nullable":true}},"required":["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","storefront_visible","tracking_url","available_to_sellers","created_at","updated_at","deleted_at","markup_flat","markup_percent","seller_id","seller_name","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","fulfillment_provider","pickup_point_provider","rate_provider","calculator"],"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","description":"Profile kind. Built-in: shipping, digital. Extensions may register more."},"digital":{"type":"boolean"},"offers_pickup":{"type":"boolean"},"offers_shipping":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"origin_groups":{"type":"array","items":{"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},"unpriced":{"type":"boolean"},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true},"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","unpriced","freight_summary","metadata","created_at","updated_at"],"x-typelizer":true},"Delivery":{"type":"object","properties":{"id":{"type":"string"},"tracking_number":{"type":"string"},"carrier":{"type":"string","nullable":true},"carrier_name":{"type":"string","nullable":true},"service":{"type":"string","nullable":true},"status":{"type":"string","enum":["pending","pre_transit","in_transit","out_for_delivery","available_for_pickup","delivered","return_to_sender","failure","unknown"]},"tracking_url":{"type":"string","nullable":true},"estimated_delivery_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"details":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"shipping_label_id":{"type":"string","nullable":true}},"required":["id","tracking_number","carrier","carrier_name","service","status","tracking_url","estimated_delivery_at","delivered_at","details","created_at","updated_at","shipping_label_id"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"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},"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_settings":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"provider_type":{"type":"string","nullable":true,"description":"Digital asset provider; null is an uploaded file. Built-in: file. Extensions may register more."},"provider_name":{"type":"string","description":"Digital asset provider name. Built-in: File. Extensions may register more."},"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_settings","created_at","updated_at","provider_type","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","enum":["promotion","manual"]},"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"},"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","metadata","created_at","updated_at"],"x-typelizer":true},"EmailTemplateDraft":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"lock_version":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"updated_by_id":{"type":"string","nullable":true},"updated_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"updated_by":{"$ref":"#/components/schemas/Actor"}},"required":["id","subject","body","lock_version","created_at","updated_at","updated_by_id","updated_by_type"],"x-typelizer":true},"EmailTemplatePreview":{"type":"object","properties":{"id":{"type":"string","nullable":true},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"email_key":{"type":"string"},"variables":{"type":"object"}},"required":["id","subject","html","text","email_key","variables"],"x-typelizer":true},"EmailTemplateRevision":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"created_at":{"type":"string"},"published_by_id":{"type":"string","nullable":true},"published_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"published_by":{"$ref":"#/components/schemas/Actor"}},"required":["id","subject","body","created_at","published_by_id","published_by_type"],"x-typelizer":true},"EmailTemplateSampleRecord":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"created_at":{"type":"string"}},"required":["id","label","created_at"],"x-typelizer":true},"EmailTemplate":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"language":{"type":"string"},"customized_languages":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["email","layout","partial"]},"customized":{"type":"boolean"},"published_at":{"type":"string","nullable":true},"default_subject":{"type":"string","nullable":true},"default_body":{"type":"string"},"published_language":{"type":"string","nullable":true},"default_changed":{"type":"boolean"},"base_subject":{"type":"string","nullable":true},"base_body":{"type":"string","nullable":true},"draft":{"allOf":[{"$ref":"#/components/schemas/EmailTemplateDraft"}],"nullable":true}},"required":["id","key","subject","body","language","customized_languages","kind","customized","published_at","default_subject","default_body","published_language","default_changed","base_subject","base_body","draft"],"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_tax_total":{"type":"string"},"new_tax_total":{"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_tax_total","new_tax_total","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":{"anyOf":[{"type":"string","enum":["requested","approved","received","fulfilled","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"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","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type"],"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":{"anyOf":[{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty","exchange"]},{"type":"string"}],"description":"What sort of charge this is. `duty` is a customs duty on a cross-border order and is not taxed; the other kinds are. Extensions may register further kinds."},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"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","metadata","created_at","updated_at"],"x-typelizer":true},"FileUpload":{"type":"object","properties":{"signed_id":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"number"},"visibility":{"type":"string","enum":["public","private"]},"expires_at":{"type":"string"},"upload":{"allOf":[{"$ref":"#/components/schemas/FileUploadTarget"}],"nullable":true}},"required":["signed_id","filename","content_type","byte_size","visibility","expires_at","upload"],"x-typelizer":true},"FileUploadTarget":{"type":"object","properties":{"method":{"type":"string"},"url":{"type":"string"},"headers":{"type":"object"}},"required":["method","url","headers"],"x-typelizer":true},"FreightSummaryLine":{"type":"object","properties":{"variant_id":{"type":"string","nullable":true},"sku":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"units":{"type":"number"},"cartons":{"type":"number","nullable":true},"pallets":{"type":"number","nullable":true},"units_per_carton":{"type":"number","nullable":true},"cartons_per_pallet":{"type":"number","nullable":true},"complete":{"type":"boolean"},"weight_per_carton":{"type":"string","nullable":true},"volume":{"type":"string"},"weight":{"type":"string"}},"required":["variant_id","sku","name","units","cartons","pallets","units_per_carton","cartons_per_pallet","complete","weight_per_carton","volume","weight"],"x-typelizer":true},"FreightSummary":{"type":"object","properties":{"total_units":{"type":"number"},"total_cartons":{"type":"number"},"total_pallets":{"type":"number","nullable":true},"total_volume":{"type":"string"},"total_weight":{"type":"string"},"complete":{"type":"boolean"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/FreightSummaryLine"}}},"required":["total_units","total_cartons","total_pallets","total_volume","total_weight","complete","lines"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"anyOf":[{"type":"string","enum":["on_hand","backordered","shipped","returned"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"unpriced":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["unfulfilled","fulfilled","delivered","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"fulfillment_type":{"type":"string","enum":["shipping","digital","pickup","pickup_point"]},"fulfilled_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"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"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"documents":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"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","pickup_point_data","selected_delivery_rate_id","unpriced","cost","total","discount_total","additional_tax_total","included_tax_total","tax_total","status","fulfillment_type","fulfilled_at","delivered_at","items","deliveries","metadata","created_at","updated_at","adjustment_total","pre_tax_amount","order_id","stock_location_id","documents","labels","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":{"anyOf":[{"type":"string","enum":["active","partially_redeemed","redeemed","canceled","expired"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"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","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":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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,"description":"Import type. Built-in: products, product_translations, customers, price_list_prices. Extensions may register more."},"status":{"anyOf":[{"type":"string","enum":["pending","mapping","completed_mapping","processing","completed","failed"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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},"delimiter":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"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","delimiter","price_list_id","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","description":"Integration type, registered by the provider gem that owns it (for example the EasyPost provider). Core ships none."},"group":{"type":"string","nullable":true},"preferences":{"$ref":"#/components/schemas/IntegrationPreferences"}},"required":["id","name","active","created_at","updated_at","type","group","preferences"],"x-typelizer":true},"InvitationAcceptanceLink":{"type":"object","properties":{"id":{"type":"string"},"acceptance_url":{"type":"string"}},"required":["id","acceptance_url"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","accepted"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"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","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"},"total":{"type":"string"},"adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"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"},"price_source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"catalog_price":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"price_list_name":{"type":"string","nullable":true},"catalog_id":{"type":"string","nullable":true},"catalog_name":{"type":"string","nullable":true},"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","total","adjustment_total","additional_tax_total","included_tax_total","discount_total","pre_tax_amount","discounted_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","price_source","created_at","updated_at","catalog_price","price_list_id","price_list_name","catalog_id","catalog_name","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"}},"country_isos":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tax_provider":{"type":"string","nullable":true,"description":"Tax provider; null uses the store default. Built-in: internal. Provider gems register more."}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_codes","country_isos","supported_locales","created_at","updated_at","tax_provider"],"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","enum":["image","video","external_video"]},"external_video_url":{"type":"string","nullable":true},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","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","external_video_url","focal_point_x","focal_point_y","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},"MembershipProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","name","thumbnail_url"],"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","enum":["dropdown","color_swatch","buttons"]},"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},"OrderCancellationReason":{"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},"OrderGroup":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"email":{"type":"string","nullable":true},"currency":{"type":"string"},"total":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true,"enum":["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},"payment_status":{"type":"string","nullable":true,"enum":["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},"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"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}},"required":["id","number","email","currency","total","item_total","fulfillment_status","payment_status","completed_at","billing_address","shipping_address","orders","customer_id","cart_id","seller_count","includes_first_party","confirmation_delivered","store_owner_notification_delivered","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","description":"Rule type. Built-in: preferred_location, default_location, minimize_splits. Extensions may register more."},"channel_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/OrderRoutingRulePreferences"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"withdrawal_period_ends_at":{"type":"string","nullable":true},"within_withdrawal_period":{"type":"boolean"},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"po_document_filename":{"type":"string","nullable":true},"po_document_byte_size":{"type":"number","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"po_number":{"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,"enum":["backorder","canceled","partial","unfulfilled","fulfilled","delivered","pending","ready","shipped"]},"payment_status":{"type":"string","nullable":true,"enum":["none","authorized","partially_paid","paid","partially_refunded","refunded","overcharged","voided"]},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"total":{"type":"string"},"gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"delivery_total":{"type":"string"},"fee_total":{"type":"string"},"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","enum":["draft","placed","canceled"]},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean","nullable":true},"metadata":{"type":"object"},"cancel_note":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment_total":{"type":"string"},"commission_amount_total":{"type":"string"},"commission_tax_total":{"type":"string"},"commission_total":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"po_document_url":{"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},"approver_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"approver":{"$ref":"#/components/schemas/Actor"},"canceler_id":{"type":"string","nullable":true},"canceler_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"canceler":{"$ref":"#/components/schemas/Actor"},"created_by_id":{"type":"string","nullable":true},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"cancel_reason_id":{"type":"string","nullable":true},"cancel_reason_name":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"payment_splits":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSplit"}},"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"},"cancel_reason":{"$ref":"#/components/schemas/OrderCancellationReason"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"freight_summary":{"allOf":[{"$ref":"#/components/schemas/FreightSummary"}],"nullable":true}},"required":["id","market_id","withdrawal_period_ends_at","within_withdrawal_period","cart_id","channel_id","company_id","company_name","po_document_filename","po_document_byte_size","number","email","customer_note","po_number","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","adjustment_total","discount_total","tax_total","included_tax_total","additional_tax_total","total","gift_card_total","amount_due","delivery_total","fee_total","store_credit_total","covered_by_store_credit","gift_card","market","external_references","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","metadata","cancel_note","canceled_at","approved_at","created_at","updated_at","payment_total","commission_amount_total","commission_tax_total","commission_total","preferred_stock_location_id","po_document_url","seller_id","order_group_id","tags","internal_note","internal_note_html","approver_id","approver_type","canceler_id","canceler_type","created_by_id","created_by_type","cancel_reason_id","cancel_reason_name","customer_id","freight_summary"],"x-typelizer":true},"PackageType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"]},"length":{"type":"string","nullable":true},"width":{"type":"string","nullable":true},"height":{"type":"string","nullable":true},"weight":{"type":"string","nullable":true},"max_weight":{"type":"string","nullable":true},"default":{"type":"boolean"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"volume":{"type":"string","nullable":true},"seller_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true}},"required":["id","name","kind","length","width","height","weight","max_weight","default","metadata","created_at","updated_at","dimensions_unit","weight_unit","volume","seller_id","seller_name"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","description":"Payment method type. Built-in: check, store_credit, custom_payment_source_method, bogus (test only); payment provider gems register their own, for example stripe."},"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":{"$ref":"#/components/schemas/PaymentMethodPreferences"},"logo_url":{"type":"string","nullable":true},"docs_url":{"type":"string","nullable":true},"third_party":{"type":"boolean"}},"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","logo_url","docs_url","third_party"],"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":{"anyOf":[{"type":"string","enum":["checkout","processing","pending","completed","failed","void","invalid"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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"}},"payment_splits":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSplit"}}},"required":["id","payment_method_id","response_code","number","status","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},"PaymentSplit":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"authorized_amount":{"type":"string"},"captured_amount":{"type":"string"},"refunded_amount":{"type":"string"},"claimed_amount":{"type":"string"},"net_captured_amount":{"type":"string"},"refundable_amount":{"type":"string"},"payment_id":{"type":"string"},"payment_number":{"type":"string","nullable":true},"order_id":{"type":"string"},"order_number":{"type":"string","nullable":true}},"required":["id","currency","created_at","updated_at","authorized_amount","captured_amount","refunded_amount","claimed_amount","net_captured_amount","refundable_amount","payment_id","payment_number","order_id","order_number"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string","enum":["read","write"]},"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},"PriceAdjustmentTier":{"type":"object","properties":{"id":{"type":"string"},"min_quantity":{"type":"number"},"percentage":{"type":"string"}},"required":["id","min_quantity","percentage"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"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","currency","amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceListProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"price_list_variants":{"type":"array","items":{"$ref":"#/components/schemas/CatalogPrice"}}},"required":["id","name","thumbnail_url"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"anyOf":[{"type":"string","enum":["draft","active","inactive","scheduled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"position":{"type":"number"},"match_policy":{"type":"string","enum":["all","any"]},"adjust_compare_at":{"type":"boolean"},"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"},"price_adjustment_percentage":{"type":"string","nullable":true},"automatic_pricing":{"type":"boolean"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"price_adjustment_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentTier"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","adjust_compare_at","starts_at","ends_at","deleted_at","created_at","updated_at","price_adjustment_percentage","automatic_pricing","currently_active","products_count","prices_count","price_adjustment_tiers"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: channel_rule, customer_group_rule, market_rule, user_rule, volume_rule, zone_rule. Extensions may register more."},"price_list_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/PriceRulePreferences"},"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"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"min_quantity":{"type":"number"},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","currency","amount","compare_at_amount","price_list_id","min_quantity","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":{"anyOf":[{"type":"string","enum":["draft","active","archived","proposed","rejected"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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":{"anyOf":[{"type":"string","enum":["pending","approved","rejected","withdrawn"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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","description":"Action type. Built-in: create_adjustment, create_item_adjustments, create_line_items, free_shipping. Extensions may register more."},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"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","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","description":"Rule type. Built-in: currency, country, channel, market, item_total, product, customer, customer_group, first_order, customer_logged_in, one_use_per_user, category, option_value. Extensions may register more."},"promotion_id":{"type":"string"},"preferences":{"$ref":"#/components/schemas/PromotionRulePreferences"},"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},"option_value_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"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","product_ids","category_ids","customer_ids","option_value_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},"PurchaseOrderItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_ordered":{"type":"number"},"quantity_received":{"type":"number"},"quantity_rejected":{"type":"number"},"quantity_over":{"type":"number"},"outstanding":{"type":"number"},"currency":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"unit_cost":{"type":"string"},"total_cost":{"type":"string"},"purchase_order_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_ordered","quantity_received","quantity_rejected","quantity_over","outstanding","currency","created_at","updated_at","unit_cost","total_cost","purchase_order_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":true},"PurchaseOrder":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"close_reason":{"type":"string","nullable":true},"items_count":{"type":"number"},"quantity_received_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"ordered_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"closed_short_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expected_at":{"type":"string","nullable":true},"cancel_by":{"type":"string","nullable":true},"closed_short":{"type":"boolean"},"quantity_ordered_total":{"type":"number"},"editable":{"type":"boolean"},"subtotal":{"type":"string"},"supplier_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItem"}},"stock_receipts":{"type":"array","items":{"$ref":"#/components/schemas/StockReceipt"}},"supplier":{"$ref":"#/components/schemas/Supplier"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","status","currency","reference","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","ordered_at","received_at","closed_short_at","created_at","updated_at","expected_at","cancel_by","closed_short","quantity_ordered_total","editable","subtotal","supplier_id","destination_location_id"],"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"},"tax_amount":{"type":"string"},"refunder_id":{"type":"string","nullable":true},"refunder_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"refunder":{"$ref":"#/components/schemas/Actor"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at","tax_amount","refunder_id","refunder_type"],"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"},"included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"tax_total":{"type":"string"},"refund_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"},"tax_lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","included_tax_total","additional_tax_total","tax_total","refund_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":{"anyOf":[{"type":"string","enum":["requested","approved","received","refunded","canceled"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"refund_tax_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},"created_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"created_by":{"$ref":"#/components/schemas/Actor"},"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"}},"documents":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"$ref":"#/components/schemas/ShippingLabel"}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}}},"required":["id","number","status","order_id","reason_id","refund_total","refund_tax_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","created_by_type","refunded_total","refundable_total","documents","labels","deliveries"],"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},"SavedReport":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"query":{"type":"object"},"seeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_id":{"type":"string","nullable":true},"author_name":{"type":"string","nullable":true}},"required":["id","name","description","query","seeded","created_at","updated_at","user_id","author_name"],"x-typelizer":true},"SellerBalance":{"type":"object","properties":{"currency":{"type":"string"},"settlement_currency":{"type":"string"},"converted":{"type":"boolean"},"seller_id":{"type":"string"},"earned":{"type":"string"},"pending":{"type":"string"},"payable":{"type":"string"},"paid":{"type":"string"},"balance":{"type":"string"}},"required":["currency","settlement_currency","converted","seller_id","earned","pending","payable","paid","balance"],"x-typelizer":true},"SellerPayout":{"type":"object","properties":{"id":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed","unresolved"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"period_start":{"type":"string","nullable":true},"period_end":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"},"seller_id":{"type":"string"},"seller_name":{"type":"string","nullable":true},"transfers_count":{"type":"number"},"provider":{"type":"string","description":"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},"required":["id","status","currency","reference","metadata","period_start","period_end","created_at","updated_at","amount","seller_id","seller_name","transfers_count","provider"],"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","description":"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"preferences":{"$ref":"#/components/schemas/SellerRequirementPreferences"},"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","description":"Requirement kind. Built-in: accept_terms, complete_profile, billing_address, returns_address, delivery_method, package_type, minimum_products, payout_account, required_custom_fields, policy, attestation, operator_review, document. Extensions may register more."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"position":{"type":"number"},"status":{"type":"string","enum":["complete","incomplete","pending","rejected"]},"action_url":{"type":"string","nullable":true},"blocker":{"type":"object","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","blocker","blocking","required_policy_name"],"x-typelizer":true},"SellerRequirementSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","accepted","rejected","waived"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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":{"anyOf":[{"type":"string","enum":["pending","invited","canceled","onboarding","ready_for_review","approved","rejected","suspended"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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},"SellerTransfer":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["earning","refund_reversal"]},"status":{"anyOf":[{"type":"string","enum":["pending","processing","completed","failed","unresolved"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"currency":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string"},"settled_amount":{"type":"string","nullable":true},"settled_currency":{"type":"string","nullable":true},"converted":{"type":"boolean"},"seller_id":{"type":"string"},"order_id":{"type":"string","nullable":true},"payout_id":{"type":"string","nullable":true},"reversed_from_id":{"type":"string","nullable":true},"refund_id":{"type":"string","nullable":true},"seller_name":{"type":"string","nullable":true},"order_number":{"type":"string","nullable":true},"provider":{"type":"string","description":"Payout provider. Built-in: system. Provider gems register more (e.g. stripe)."}},"required":["id","kind","status","currency","reference","metadata","created_at","updated_at","amount","settled_amount","settled_currency","converted","seller_id","order_id","payout_id","reversed_from_id","refund_id","seller_name","order_number","provider"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"ShippingLabel":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["purchased","uploaded"]},"status":{"anyOf":[{"type":"string","enum":["purchased","refund_requested","refunded"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"carrier":{"type":"string","nullable":true},"carrier_name":{"type":"string","nullable":true},"service":{"type":"string","nullable":true},"tracking_number":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"refunded_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"owner_id":{"type":"string"},"owner_type":{"type":"string","enum":["fulfillment","return"]},"cost":{"type":"string"},"integration_id":{"type":"string","nullable":true},"file_pending":{"type":"boolean"},"download_url":{"type":"string","nullable":true}},"required":["id","source","status","carrier","carrier_name","service","tracking_number","currency","format","external_id","metadata","refunded_at","created_at","updated_at","owner_id","owner_type","cost","integration_id","file_pending","download_url"],"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"},"reserved_count":{"type":"number"},"incoming_count":{"type":"number"},"purchasable_count":{"type":"number"},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_name":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"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","reserved_count","incoming_count","purchasable_count","variant_name","variant_sku","created_at","updated_at","stock_location_name","product_id","options_text","thumbnail_url","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":{"anyOf":[{"type":"string","enum":["warehouse","store","fulfillment_center"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"returns_enabled":{"type":"boolean"},"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","returns_enabled","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,"enum":["received","allocated","shipped","released","adjusted"]},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_level_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"stock_location_name":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"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},"stock_receipt_id":{"type":"string","nullable":true},"purchase_order_id":{"type":"string","nullable":true},"order_number":{"type":"string","nullable":true},"return_number":{"type":"string","nullable":true},"exchange_number":{"type":"string","nullable":true},"stock_transfer_number":{"type":"string","nullable":true},"purchase_order_number":{"type":"string","nullable":true},"unit_cost":{"type":"string","nullable":true}},"required":["id","quantity","kind","reason","created_at","updated_at","stock_level_id","stock_location_id","stock_location_name","variant_id","variant_name","variant_sku","order_id","fulfillment_id","return_id","exchange_id","stock_transfer_id","stock_receipt_id","purchase_order_id","order_number","return_number","exchange_number","stock_transfer_number","purchase_order_number","unit_cost"],"x-typelizer":true},"StockReceiptItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_accepted":{"type":"number"},"quantity_rejected":{"type":"number"},"rejection_reason":{"type":"string","nullable":true,"enum":["damaged","wrong_item","expired","other"]},"notes":{"type":"string","nullable":true},"line_type":{"type":"string","enum":["purchase_order_item","stock_transfer_item"]},"line_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_accepted","quantity_rejected","rejection_reason","notes","line_type","line_id","variant_id","product_id","variant_name","variant_sku","thumbnail_url"],"x-typelizer":true},"StockReceipt":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"quantity_accepted_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"received_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"receivable_type":{"type":"string","enum":["purchase_order","stock_transfer"]},"receivable_id":{"type":"string"},"received_by_id":{"type":"string","nullable":true},"received_by_type":{"anyOf":[{"type":"string","enum":["admin_user","api_key"]},{"type":"string"}],"nullable":true,"description":"The values listed are the built-in ones; extensions may add more."},"received_by":{"$ref":"#/components/schemas/Actor"},"items_count":{"type":"number"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockReceiptItem"}}},"required":["id","number","reference","notes","metadata","quantity_accepted_total","quantity_rejected_total","received_at","created_at","updated_at","receivable_type","receivable_id","received_by_id","received_by_type","items_count"],"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},"StockTransferItem":{"type":"object","properties":{"id":{"type":"string"},"quantity_shipped":{"type":"number"},"quantity_received":{"type":"number"},"quantity_rejected":{"type":"number"},"quantity_over":{"type":"number"},"outstanding":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_transfer_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"product_id":{"type":"string","nullable":true},"variant_name":{"type":"string","nullable":true},"variant_sku":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","quantity_shipped","quantity_received","quantity_rejected","quantity_over","outstanding","created_at","updated_at","stock_transfer_id","variant_id","product_id","variant_name","variant_sku","options_text","thumbnail_url"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string"},"destination_location_id":{"type":"string"},"status":{"type":"string"},"notes":{"type":"string","nullable":true},"metadata":{"type":"object"},"close_reason":{"type":"string","nullable":true},"items_count":{"type":"number"},"quantity_received_total":{"type":"number"},"quantity_rejected_total":{"type":"number"},"shipped_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"closed_short_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"closed_short":{"type":"boolean"},"quantity_shipped_total":{"type":"number"},"editable":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItem"}},"stock_receipts":{"type":"array","items":{"$ref":"#/components/schemas/StockReceipt"}},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","created_at","updated_at","source_location_id","destination_location_id","status","notes","metadata","close_reason","items_count","quantity_received_total","quantity_rejected_total","shipped_at","received_at","closed_short_at","deleted_at","closed_short","quantity_shipped_total","editable"],"x-typelizer":true},"StoreCreditEvent":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"authorization_code":{"type":"string","nullable":true},"display_action":{"type":"string","nullable":true},"amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"store_credit_id":{"type":"string"},"originator_type":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true}},"required":["id","action","authorization_code","display_action","amount","created_at","updated_at","store_credit_id","originator_type","originator_id"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount_authorized":{"type":"string"},"outstanding":{"type":"boolean"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"}},"required":["id","amount","amount_used","amount_remaining","currency","memo","metadata","created_at","updated_at","amount_authorized","outstanding","customer_id","created_by_id","originator_type","originator_id"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"default_country_code":{"type":"string","nullable":true},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_routing_strategy":{"type":"string","description":"Order routing strategy. Built-in: rules. Extensions may register more."},"payout_provider":{"type":"string","nullable":true,"description":"Payout provider; null uses the installation default. Built-in: system. Provider gems register more (e.g. stripe)."},"admin_locale":{"type":"string","nullable":true},"timezone":{"type":"string"},"storefront_url":{"type":"string","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"unit_system":{"type":"string","enum":["metric","imperial"]},"storefront_access":{"type":"string","enum":["public","prices_hidden","login_required"]},"guest_checkout":{"type":"boolean"},"always_include_confirm_step":{"type":"boolean"},"company_field_enabled":{"type":"boolean"},"address_requires_company":{"type":"boolean"},"address_requires_phone":{"type":"boolean"},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"]},"track_inventory_levels":{"type":"boolean"},"stock_reservations_enabled":{"type":"boolean"},"low_stock_threshold":{"type":"number"},"tax_using_ship_address":{"type":"boolean"},"track_price_history":{"type":"boolean"},"show_products_without_price":{"type":"boolean"},"disable_sku_validation":{"type":"boolean"},"pricing_provider":{"type":"string"},"inventory_provider":{"type":"string"},"pricing_provider_failure_policy":{"type":"string","enum":["fallback","strict"]},"inventory_provider_failure_policy":{"type":"string","enum":["fallback","strict"]},"default_payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"]},"auto_approve_sellers":{"type":"boolean"},"auto_approve_seller_products":{"type":"boolean"},"send_seller_transactional_emails":{"type":"boolean"},"document_number_format":{"type":"string","enum":["sequential","random"]},"order_number_prefix":{"type":"string"},"order_number_suffix":{"type":"string"},"order_number_sequence_start":{"type":"number"},"limit_digital_download_count":{"type":"boolean"},"digital_asset_authorized_clicks":{"type":"number"},"limit_digital_download_days":{"type":"boolean"},"digital_asset_authorized_days":{"type":"number"},"send_consumer_transactional_emails":{"type":"boolean"},"email_accent_color":{"type":"string","nullable":true},"email_background_color":{"type":"string","nullable":true},"email_card_color":{"type":"string","nullable":true},"email_text_color":{"type":"string","nullable":true},"email_heading_color":{"type":"string","nullable":true},"email_font":{"type":"string","nullable":true,"enum":["inter","system","helvetica","georgia","roboto","lato","merriweather"]},"order_number_sequence_started":{"type":"boolean"},"default_minimum_payout_amount":{"type":"string","nullable":true},"default_commission_tax_rate":{"type":"string","nullable":true},"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","default_currency","default_locale","default_country_code","mail_from_address","customer_support_email","new_order_notifications_email","created_at","updated_at","order_routing_strategy","payout_provider","admin_locale","timezone","storefront_url","weight_unit","unit_system","storefront_access","guest_checkout","always_include_confirm_step","company_field_enabled","address_requires_company","address_requires_phone","capture_method","track_inventory_levels","stock_reservations_enabled","low_stock_threshold","tax_using_ship_address","track_price_history","show_products_without_price","disable_sku_validation","pricing_provider","inventory_provider","pricing_provider_failure_policy","inventory_provider_failure_policy","default_payouts_schedule_interval","auto_approve_sellers","auto_approve_seller_products","send_seller_transactional_emails","document_number_format","order_number_prefix","order_number_suffix","order_number_sequence_start","limit_digital_download_count","digital_asset_authorized_clicks","limit_digital_download_days","digital_asset_authorized_days","send_consumer_transactional_emails","email_accent_color","email_background_color","email_card_color","email_text_color","email_heading_color","email_font","order_number_sequence_started","default_minimum_payout_amount","default_commission_tax_rate","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"Supplier":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"purchase_orders_count":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true},"can_be_deleted":{"type":"boolean"}},"required":["id","name","contact_name","email","phone","notes","address1","address2","city","state_name","state_code","country_code","postal_code","purchase_orders_count","metadata","created_at","updated_at","deleted_at","can_be_deleted"],"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":{"anyOf":[{"type":"string","enum":["pending","verified","expired","revoked"]},{"type":"string"}],"description":"The values listed are the built-in ones; extensions may add more."},"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","description":"Tax identifier kind, keyed to a registered validator. Built-in: eu_vat. Extensions may register more."},"value":{"type":"string"},"validation_status":{"type":"string","nullable":true,"enum":["pending","verified","unverified","unavailable","unsupported"]},"validation_evidence":{"type":"object","nullable":true},"source":{"type":"string","nullable":true,"enum":["override","company","customer"]},"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"},"credit":{"type":"boolean"},"rate":{"type":"string","nullable":true},"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},"return_line_item_id":{"type":"string","nullable":true},"claim_line_item_id":{"type":"string","nullable":true},"exchange_line_item_id":{"type":"string","nullable":true},"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"},"original_tax_line_id":{"type":"string","nullable":true}},"required":["id","label","included","credit","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","return_line_item_id","claim_line_item_id","exchange_line_item_id","amount","provider_id","metadata","taxability_reason","country_code","state_code","data","created_at","updated_at","original_tax_line_id"],"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},"rate":{"type":"string","nullable":true},"rate_percent":{"type":"string","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","rate","rate_percent","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},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"minimum_order_quantity":{"type":"number","nullable":true},"order_multiple":{"type":"number","nullable":true},"purchase_unit":{"type":"string","nullable":true,"enum":["unit","carton"]},"units_per_carton":{"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_currency":{"type":"string","nullable":true},"barcode":{"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},"carton_weight":{"type":"string","nullable":true},"cartons_per_pallet":{"type":"number","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"carton_package_type_id":{"type":"string","nullable":true},"units_per_pallet":{"type":"number","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","weight_unit","dimensions_unit","minimum_order_quantity","order_multiple","purchase_unit","units_per_carton","price","original_price","seller_id","option_values","external_references","metadata","position","cost_currency","barcode","backorder_limit","hs_code","country_of_origin","customs_description","carton_weight","cartons_per_pallet","deleted_at","created_at","updated_at","cost_price","preorderable","tax_category_id","carton_package_type_id","units_per_pallet","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","nullable":true},"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},"WebhookEvent":{"type":"object","properties":{"name":{"type":"string"},"group":{"type":"string"},"credential_permission":{"type":"string","nullable":true},"credential":{"type":"boolean"},"deprecated":{"type":"boolean"},"replaced_by":{"type":"string","nullable":true}},"required":["name","group","credential_permission","credential","deprecated","replaced_by"],"x-typelizer":true},"CommissionRuleCategoryRulePreferences":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ctg_[A-Za-z0-9]+$","x-spree-prefix":"ctg"},"default":[]}},"additionalProperties":false},"CommissionRuleItemTotalRulePreferences":{"type":"object","properties":{"min_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"max_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"CommissionRuleProductRulePreferences":{"type":"object","properties":{},"additionalProperties":false},"CommissionRuleSellerRulePreferences":{"type":"object","properties":{"seller_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^sel_[A-Za-z0-9]+$","x-spree-prefix":"sel"},"default":[]}},"additionalProperties":false},"CommissionRulePreferences":{"description":"Settings of a commission rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/CommissionRuleCategoryRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleItemTotalRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleProductRulePreferences"},{"$ref":"#/components/schemas/CommissionRuleSellerRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"category_rule":"#/components/schemas/CommissionRuleCategoryRulePreferences","item_total_rule":"#/components/schemas/CommissionRuleItemTotalRulePreferences","product_rule":"#/components/schemas/CommissionRuleProductRulePreferences","seller_rule":"#/components/schemas/CommissionRuleSellerRulePreferences"}},"DeliveryCalculatorDigitalDeliveryPreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorFlatPercentItemTotalPreferences":{"type":"object","properties":{"flat_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"DeliveryCalculatorFlatRatePreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorFlexiRatePreferences":{"type":"object","properties":{"first_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"additional_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"max_items":{"type":"integer","default":0},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPerItemPreferences":{"type":"object","properties":{"amounts":{"type":"object","additionalProperties":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"default":{},"x-spree-property-names":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPriceSackPreferences":{"type":"object","properties":{"minimal_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"normal_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"discount_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"DeliveryCalculatorPreferences":{"description":"Settings of a delivery calculator, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/DeliveryCalculatorDigitalDeliveryPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlatPercentItemTotalPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlatRatePreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorFlexiRatePreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorPerItemPreferences"},{"$ref":"#/components/schemas/DeliveryCalculatorPriceSackPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"digital_delivery":"#/components/schemas/DeliveryCalculatorDigitalDeliveryPreferences","flat_percent_item_total":"#/components/schemas/DeliveryCalculatorFlatPercentItemTotalPreferences","flat_rate":"#/components/schemas/DeliveryCalculatorFlatRatePreferences","flexi_rate":"#/components/schemas/DeliveryCalculatorFlexiRatePreferences","per_item":"#/components/schemas/DeliveryCalculatorPerItemPreferences","price_sack":"#/components/schemas/DeliveryCalculatorPriceSackPreferences"}},"DeliveryMethodRuleChannelRulePreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"DeliveryMethodRuleCompanyRulePreferences":{"type":"object","properties":{"company_orders_only":{"type":"boolean","default":true}},"additionalProperties":false},"DeliveryMethodRuleExcludedProductsRulePreferences":{"type":"object","properties":{},"additionalProperties":false},"DeliveryMethodRuleItemTotalRulePreferences":{"type":"object","properties":{"minimum_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRuleVolumeRulePreferences":{"type":"object","properties":{"minimum_volume":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_volume":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRuleWeightRulePreferences":{"type":"object","properties":{"minimum_weight":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"maximum_weight":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"additionalProperties":false},"DeliveryMethodRulePreferences":{"description":"Settings of a delivery method rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/DeliveryMethodRuleChannelRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleCompanyRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleExcludedProductsRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleItemTotalRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleVolumeRulePreferences"},{"$ref":"#/components/schemas/DeliveryMethodRuleWeightRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"channel_rule":"#/components/schemas/DeliveryMethodRuleChannelRulePreferences","company_rule":"#/components/schemas/DeliveryMethodRuleCompanyRulePreferences","excluded_products_rule":"#/components/schemas/DeliveryMethodRuleExcludedProductsRulePreferences","item_total_rule":"#/components/schemas/DeliveryMethodRuleItemTotalRulePreferences","volume_rule":"#/components/schemas/DeliveryMethodRuleVolumeRulePreferences","weight_rule":"#/components/schemas/DeliveryMethodRuleWeightRulePreferences"}},"IntegrationPreferences":{"description":"Settings of a integration, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{}},"OrderRoutingRuleDefaultLocationPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRuleMinimizeSplitsPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRulePreferredLocationPreferences":{"type":"object","properties":{},"additionalProperties":false},"OrderRoutingRulePreferences":{"description":"Settings of a order routing rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/OrderRoutingRuleDefaultLocationPreferences"},{"$ref":"#/components/schemas/OrderRoutingRuleMinimizeSplitsPreferences"},{"$ref":"#/components/schemas/OrderRoutingRulePreferredLocationPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"default_location":"#/components/schemas/OrderRoutingRuleDefaultLocationPreferences","minimize_splits":"#/components/schemas/OrderRoutingRuleMinimizeSplitsPreferences","preferred_location":"#/components/schemas/OrderRoutingRulePreferredLocationPreferences"}},"PaymentMethodBogusPreferences":{"type":"object","properties":{"dummy_key":{"type":"string","default":"PUBLICKEY123"},"dummy_secret_key":{"type":"string","x-spree-secret":true,"nullable":true}},"additionalProperties":false},"PaymentMethodCheckPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodCustomPaymentSourceMethodPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodStoreCreditPreferences":{"type":"object","properties":{},"additionalProperties":false},"PaymentMethodPreferences":{"description":"Settings of a payment method, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PaymentMethodBogusPreferences"},{"$ref":"#/components/schemas/PaymentMethodCheckPreferences"},{"$ref":"#/components/schemas/PaymentMethodCustomPaymentSourceMethodPreferences"},{"$ref":"#/components/schemas/PaymentMethodStoreCreditPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"bogus":"#/components/schemas/PaymentMethodBogusPreferences","check":"#/components/schemas/PaymentMethodCheckPreferences","custom_payment_source_method":"#/components/schemas/PaymentMethodCustomPaymentSourceMethodPreferences","store_credit":"#/components/schemas/PaymentMethodStoreCreditPreferences"}},"PriceRuleChannelRulePreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"PriceRuleCustomerGroupRulePreferences":{"type":"object","properties":{"customer_group_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cg_[A-Za-z0-9]+$","x-spree-prefix":"cg"},"default":[]}},"additionalProperties":false},"PriceRuleMarketRulePreferences":{"type":"object","properties":{"market_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^mkt_[A-Za-z0-9]+$","x-spree-prefix":"mkt"},"default":[]}},"additionalProperties":false},"PriceRuleUserRulePreferences":{"type":"object","properties":{"user_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cust_[A-Za-z0-9]+$","x-spree-prefix":"cust"},"default":[]}},"additionalProperties":false},"PriceRuleVolumeRulePreferences":{"type":"object","properties":{"min_quantity":{"type":"integer","default":1},"max_quantity":{"type":"integer","nullable":true}},"additionalProperties":false},"PriceRulePreferences":{"description":"Settings of a price rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PriceRuleChannelRulePreferences"},{"$ref":"#/components/schemas/PriceRuleCustomerGroupRulePreferences"},{"$ref":"#/components/schemas/PriceRuleMarketRulePreferences"},{"$ref":"#/components/schemas/PriceRuleUserRulePreferences"},{"$ref":"#/components/schemas/PriceRuleVolumeRulePreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"channel_rule":"#/components/schemas/PriceRuleChannelRulePreferences","customer_group_rule":"#/components/schemas/PriceRuleCustomerGroupRulePreferences","market_rule":"#/components/schemas/PriceRuleMarketRulePreferences","user_rule":"#/components/schemas/PriceRuleUserRulePreferences","volume_rule":"#/components/schemas/PriceRuleVolumeRulePreferences"}},"PromotionCalculatorFlatPercentItemTotalPreferences":{"type":"object","properties":{"flat_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"PromotionCalculatorFlatRatePreferences":{"type":"object","properties":{"amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorFlexiRatePreferences":{"type":"object","properties":{"first_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"additional_item":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"max_items":{"type":"integer","default":0},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorPercentOnLineItemPreferences":{"type":"object","properties":{"percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"apply_only_on_full_priced_items":{"type":"boolean","default":false}},"additionalProperties":false},"PromotionCalculatorTieredFlatRatePreferences":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"threshold":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"value":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["threshold","value"],"additionalProperties":false},"default":[]},"base_amount":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$"}},"additionalProperties":false},"PromotionCalculatorTieredPercentPreferences":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"threshold":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$"},"value":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["threshold","value"],"additionalProperties":false},"default":[]},"base_percent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"}},"additionalProperties":false},"PromotionCalculatorPreferences":{"description":"Settings of a promotion calculator, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PromotionCalculatorFlatPercentItemTotalPreferences"},{"$ref":"#/components/schemas/PromotionCalculatorFlatRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorFlexiRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorPercentOnLineItemPreferences"},{"$ref":"#/components/schemas/PromotionCalculatorTieredFlatRatePreferences"},{"$ref":"#/components/schemas/PromotionCalculatorTieredPercentPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"flat_percent_item_total":"#/components/schemas/PromotionCalculatorFlatPercentItemTotalPreferences","flat_rate":"#/components/schemas/PromotionCalculatorFlatRatePreferences","flexi_rate":"#/components/schemas/PromotionCalculatorFlexiRatePreferences","percent_on_line_item":"#/components/schemas/PromotionCalculatorPercentOnLineItemPreferences","tiered_flat_rate":"#/components/schemas/PromotionCalculatorTieredFlatRatePreferences","tiered_percent":"#/components/schemas/PromotionCalculatorTieredPercentPreferences"}},"PromotionRuleCategoryPreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any","all"],"default":"any"}},"additionalProperties":false},"PromotionRuleChannelPreferences":{"type":"object","properties":{"channel_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^ch_[A-Za-z0-9]+$","x-spree-prefix":"ch"},"default":[]}},"additionalProperties":false},"PromotionRuleCountryPreferences":{"type":"object","properties":{"country_codes":{"type":"array","items":{"type":"string","format":"iso-country","pattern":"^[A-Z]{2}$"},"default":[]},"country_id":{"type":"integer","nullable":true},"country_code":{"type":"string","format":"iso-country","pattern":"^[A-Z]{2}$","nullable":true}},"additionalProperties":false},"PromotionRuleCurrencyPreferences":{"type":"object","properties":{"currency":{"type":"string","format":"currency","pattern":"^[A-Z]{3}$","nullable":true}},"additionalProperties":false},"PromotionRuleCustomerPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleCustomerGroupPreferences":{"type":"object","properties":{"customer_group_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^cg_[A-Za-z0-9]+$","x-spree-prefix":"cg"},"default":[]}},"additionalProperties":false},"PromotionRuleCustomerLoggedInPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleFirstOrderPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleItemTotalPreferences":{"type":"object","properties":{"amount_min":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","default":"100"},"operator_min":{"type":"string","default":">"},"amount_max":{"type":"string","format":"money","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"operator_max":{"type":"string","default":"<"}},"additionalProperties":false},"PromotionRuleMarketPreferences":{"type":"object","properties":{"market_ids":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^mkt_[A-Za-z0-9]+$","x-spree-prefix":"mkt"},"default":[]}},"additionalProperties":false},"PromotionRuleOneUsePerUserPreferences":{"type":"object","properties":{},"additionalProperties":false},"PromotionRuleOptionValuePreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any"],"default":"any"},"eligible_values":{"type":"array","items":{"type":"string","format":"prefixed-id","pattern":"^optval_[A-Za-z0-9]+$","x-spree-prefix":"optval"},"default":[]}},"additionalProperties":false},"PromotionRuleProductPreferences":{"type":"object","properties":{"match_policy":{"type":"string","enum":["any","all","none"],"default":"any"}},"additionalProperties":false},"PromotionRulePreferences":{"description":"Settings of a promotion rule, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/PromotionRuleCategoryPreferences"},{"$ref":"#/components/schemas/PromotionRuleChannelPreferences"},{"$ref":"#/components/schemas/PromotionRuleCountryPreferences"},{"$ref":"#/components/schemas/PromotionRuleCurrencyPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerGroupPreferences"},{"$ref":"#/components/schemas/PromotionRuleCustomerLoggedInPreferences"},{"$ref":"#/components/schemas/PromotionRuleFirstOrderPreferences"},{"$ref":"#/components/schemas/PromotionRuleItemTotalPreferences"},{"$ref":"#/components/schemas/PromotionRuleMarketPreferences"},{"$ref":"#/components/schemas/PromotionRuleOneUsePerUserPreferences"},{"$ref":"#/components/schemas/PromotionRuleOptionValuePreferences"},{"$ref":"#/components/schemas/PromotionRuleProductPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"category":"#/components/schemas/PromotionRuleCategoryPreferences","channel":"#/components/schemas/PromotionRuleChannelPreferences","country":"#/components/schemas/PromotionRuleCountryPreferences","currency":"#/components/schemas/PromotionRuleCurrencyPreferences","customer":"#/components/schemas/PromotionRuleCustomerPreferences","customer_group":"#/components/schemas/PromotionRuleCustomerGroupPreferences","customer_logged_in":"#/components/schemas/PromotionRuleCustomerLoggedInPreferences","first_order":"#/components/schemas/PromotionRuleFirstOrderPreferences","item_total":"#/components/schemas/PromotionRuleItemTotalPreferences","market":"#/components/schemas/PromotionRuleMarketPreferences","one_use_per_user":"#/components/schemas/PromotionRuleOneUsePerUserPreferences","option_value":"#/components/schemas/PromotionRuleOptionValuePreferences","product":"#/components/schemas/PromotionRuleProductPreferences"}},"SellerRequirementAcceptTermsPreferences":{"type":"object","properties":{"terms_body":{"type":"string","x-spree-widget":"textarea","nullable":true},"terms_effective_from":{"type":"string","format":"date","nullable":true},"terms_url":{"type":"string","nullable":true}},"additionalProperties":false},"SellerRequirementAttestationPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementBillingAddressPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementCompleteProfilePreferences":{"type":"object","properties":{"require_about":{"type":"boolean","default":true},"require_logo":{"type":"boolean","default":true},"require_cover_photo":{"type":"boolean","default":false},"require_contact_email":{"type":"boolean","default":true}},"additionalProperties":false},"SellerRequirementDeliveryMethodPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementDocumentPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementMinimumProductsPreferences":{"type":"object","properties":{"minimum_count":{"type":"integer","default":1}},"additionalProperties":false},"SellerRequirementOperatorReviewPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPackageTypePreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPayoutAccountPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPolicyPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementRequiredCustomFieldsPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementReturnsAddressPreferences":{"type":"object","properties":{},"additionalProperties":false},"SellerRequirementPreferences":{"description":"Settings of a seller requirement, shaped by its `type` (see `x-spree-preferences-by-type`). A type an extension registers is a plain object, described by the `schema` its `/types` entry carries.","anyOf":[{"$ref":"#/components/schemas/SellerRequirementAcceptTermsPreferences"},{"$ref":"#/components/schemas/SellerRequirementAttestationPreferences"},{"$ref":"#/components/schemas/SellerRequirementBillingAddressPreferences"},{"$ref":"#/components/schemas/SellerRequirementCompleteProfilePreferences"},{"$ref":"#/components/schemas/SellerRequirementDeliveryMethodPreferences"},{"$ref":"#/components/schemas/SellerRequirementDocumentPreferences"},{"$ref":"#/components/schemas/SellerRequirementMinimumProductsPreferences"},{"$ref":"#/components/schemas/SellerRequirementOperatorReviewPreferences"},{"$ref":"#/components/schemas/SellerRequirementPackageTypePreferences"},{"$ref":"#/components/schemas/SellerRequirementPayoutAccountPreferences"},{"$ref":"#/components/schemas/SellerRequirementPolicyPreferences"},{"$ref":"#/components/schemas/SellerRequirementRequiredCustomFieldsPreferences"},{"$ref":"#/components/schemas/SellerRequirementReturnsAddressPreferences"},{"type":"object","additionalProperties":true}],"x-spree-preferences-by-type":{"accept_terms":"#/components/schemas/SellerRequirementAcceptTermsPreferences","attestation":"#/components/schemas/SellerRequirementAttestationPreferences","billing_address":"#/components/schemas/SellerRequirementBillingAddressPreferences","complete_profile":"#/components/schemas/SellerRequirementCompleteProfilePreferences","delivery_method":"#/components/schemas/SellerRequirementDeliveryMethodPreferences","document":"#/components/schemas/SellerRequirementDocumentPreferences","minimum_products":"#/components/schemas/SellerRequirementMinimumProductsPreferences","operator_review":"#/components/schemas/SellerRequirementOperatorReviewPreferences","package_type":"#/components/schemas/SellerRequirementPackageTypePreferences","payout_account":"#/components/schemas/SellerRequirementPayoutAccountPreferences","policy":"#/components/schemas/SellerRequirementPolicyPreferences","required_custom_fields":"#/components/schemas/SellerRequirementRequiredCustomFieldsPreferences","returns_address":"#/components/schemas/SellerRequirementReturnsAddressPreferences"}},"DeliveryMethodCalculator":{"type":"object","description":"How the delivery method prices a shipment","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"preferences":{"$ref":"#/components/schemas/DeliveryCalculatorPreferences"}},"required":["type","preferences"]},"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"},"preferences":{"$ref":"#/components/schemas/PromotionCalculatorPreferences"}},"required":["type","preferences"]},"AddressInputParams":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"firstname":{"type":"string","description":"Legacy spelling of `first_name` / `last_name`; send only one of the two."},"lastname":{"type":"string","description":"Legacy spelling of `first_name` / `last_name`; send only one of the two."},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"zipcode":{"type":"string","description":"Legacy spelling of `postal_code`; send only one of the two."},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string","description":"For countries without states in the database."},"phone":{"type":"string"},"alternative_phone":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"}}},"AdminUserUpdateParams":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"role_ids":{"type":"array","items":{"type":"string"},"description":"Role IDs of the current store the user should hold. Replaces the user's roles on this store; an empty list removes them all."}}},"AllowedOriginCreateParams":{"type":"object","properties":{"origin":{"type":"string","description":"Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]` (no path, query or fragment) using `http` or `https`."}},"required":["origin"]},"AllowedOriginUpdateParams":{"type":"object","properties":{"origin":{"type":"string","description":"Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]` (no path, query or fragment) using `http` or `https`."}}},"ApiKeyCreateParams":{"type":"object","properties":{"name":{"type":"string"},"key_type":{"type":"string","enum":["publishable","secret"]},"scopes":{"type":"array","items":{"type":"string"},"description":"Required for secret keys. You can only grant scopes you hold yourself. Fixed once created: to change them, create a new key and revoke the old one."},"channel_id":{"type":"string","description":"Binds a publishable key to one channel of the store (`ch_...`), so it rejects requests for other channels. Fixed once created; omit it for a store-wide key."}},"required":["name","key_type"]},"ApiKeyUpdateParams":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"BulkTagsParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"The records to change. Records the caller cannot update are skipped; an empty list changes nothing."},"tags":{"type":"array","items":{"type":"string"}}},"required":["ids","tags"]},"CatalogAssignParams":{"type":"object","properties":{"assignable_type":{"type":"string","enum":["customer_group","company"],"description":"Buyer audiences only. A company assignment covers its subtree."},"assignable_id":{"type":"string"}},"required":["assignable_type","assignable_id"]},"CatalogAssignmentParams":{"type":"object","properties":{"assignable_type":{"type":"string","enum":["customer_group","company"],"description":"Buyer audiences only. A company assignment covers its subtree."},"assignable_id":{"type":"string"}},"required":["assignable_type","assignable_id"]},"CatalogOrderMinimumParams":{"type":"object","properties":{"currency":{"type":"string","description":"ISO 4217 code. Required on create; one minimum per currency."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"}}},"CatalogParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","description":"Internal note on what the agreement is, never shown to shoppers.","nullable":true},"active":{"type":"boolean"},"position":{"type":"integer"},"minimum_order_quantity":{"type":"integer","description":"The catalog-wide quantity terms, between a variant's own rule and a per-variant override. Null leaves the field to the variant's own rule.","nullable":true},"order_multiple":{"type":"integer","description":"The catalog-wide quantity terms, between a variant's own rule and a per-variant override. Null leaves the field to the variant's own rule.","nullable":true},"metadata":{"type":"object","additionalProperties":true},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/CatalogAssignmentParams"},"description":"The whole audience. An entry left out is withdrawn; omitting the key leaves the audience alone."},"order_minimums":{"type":"array","items":{"$ref":"#/components/schemas/CatalogOrderMinimumParams"},"description":"The whole order-minimum set. A currency left out has its minimum lifted; omitting the key leaves them alone."},"price_list":{"allOf":[{"$ref":"#/components/schemas/CatalogPriceListParams"}],"description":"The price list this catalog prices through, written inline: an object creates the owned list or updates it. Null deletes the list (a soft delete). Omit the key, or send `{}`, to leave the pricing alone. A catalog with an empty assortment prices without hiding anything; curate or import products to make it restrictive.","nullable":true}}},"CatalogPriceListParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string"},"match_policy":{"type":"string"},"starts_at":{"type":"string","format":"date-time","nullable":true},"ends_at":{"type":"string","format":"date-time","nullable":true},"price_adjustment_percentage":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Signed: negative discounts off base prices, positive marks up.","nullable":true},"adjust_compare_at":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceListRuleParams"},"description":"Contextual rules, in practice a `volume_rule`. Audience rules are left as they are, and an empty list clears the contextual rules."},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceListPriceOverrideParams"},"description":"Explicit per-variant amounts. An empty list clears them, which is what switching to a percentage sends."},"price_adjustment_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentTierParams"},"description":"Quantity bands on the percentage. The payload is the whole ladder, so an empty list clears it."}}},"CatalogProductTermsParams":{"type":"object","properties":{"terms":{"type":"object","additionalProperties":true,"description":"Quantity terms keyed by product: `{ minimum_order_quantity, order_multiple }`, each a whole number or null. A product whose pair is both null has its terms cleared; a product not yet in the assortment is added."}},"required":["terms"]},"CategoryCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"parent_id":{"type":"string","description":"The parent category. Omitted or null, a new category goes to the top level and an existing one keeps its parent: moving one to the top level is the reposition endpoint.","nullable":true},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the landscape image, or null to remove it.","nullable":true},"square_image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the square image, or null to remove it.","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}},"required":["name"]},"CategoryRepositionParams":{"type":"object","properties":{"new_parent_id":{"type":"string","description":"The new parent. Omit or null to move the category to the top level.","nullable":true},"new_position":{"type":"integer","description":"0-based index among the new parent's children."}},"required":["new_position"]},"CategoryUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"parent_id":{"type":"string","description":"The parent category. Omitted or null, a new category goes to the top level and an existing one keeps its parent: moving one to the top level is the reposition endpoint.","nullable":true},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the landscape image, or null to remove it.","nullable":true},"square_image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the square image, or null to remove it.","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}}},"ChannelAddProductsParams":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}},"published_at":{"type":"string","format":"date-time","description":"When the publications go live. Null means immediately.","nullable":true},"unpublished_at":{"type":"string","format":"date-time","description":"When the publications come down. Null means never.","nullable":true}},"required":["product_ids"]},"ChannelCreateParams":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","description":"URL-safe slug, derived from `name` when blank (`Point of Sale` becomes `point-of-sale`)."},"active":{"type":"boolean"},"default":{"type":"boolean"},"order_routing_strategy":{"type":"string","description":"Order routing strategy shorthand (built-in: `rules`). Null inherits the store setting.","nullable":true},"storefront_access":{"type":"string","enum":["public","prices_hidden","login_required"],"description":"What anonymous visitors can see. Null inherits the store setting.","nullable":true},"guest_checkout":{"type":"boolean","description":"Whether guests can check out without an account. Null inherits the store setting.","nullable":true},"default_catalog_id":{"type":"string","description":"Catalog (`cat_...`) shown to shoppers no company or customer group catalog covers. Null means every product published on the channel.","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Stock locations (`sloc_...`) that fulfill this channel. Replaces the whole set; an empty list means every location of the store."}},"required":["name"]},"ChannelRemoveProductsParams":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"}}},"required":["product_ids"]},"ChannelUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","description":"URL-safe slug, derived from `name` when blank (`Point of Sale` becomes `point-of-sale`)."},"active":{"type":"boolean"},"default":{"type":"boolean"},"order_routing_strategy":{"type":"string","description":"Order routing strategy shorthand (built-in: `rules`). Null inherits the store setting.","nullable":true},"storefront_access":{"type":"string","enum":["public","prices_hidden","login_required"],"description":"What anonymous visitors can see. Null inherits the store setting.","nullable":true},"guest_checkout":{"type":"boolean","description":"Whether guests can check out without an account. Null inherits the store setting.","nullable":true},"default_catalog_id":{"type":"string","description":"Catalog (`cat_...`) shown to shoppers no company or customer group catalog covers. Null means every product published on the channel.","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Stock locations (`sloc_...`) that fulfill this channel. Replaces the whole set; an empty list means every location of the store."}}},"ClaimCancelParams":{"type":"object","properties":{"reason":{"type":"string","description":"A note on why the claim was canceled."}}},"ClaimCreateParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"line_item_id":{"type":"string"},"quantity":{"type":"integer"},"description":{"type":"string"},"send_replacement":{"type":"boolean"},"replacement_variant_id":{"type":"string","description":"Defaults to the variant that was bought."},"refund_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["line_item_id","quantity"]},"description":"Affected items, and how each should be made right."},"reason_id":{"type":"string","description":"One of the store's claim reasons."},"memo":{"type":"string"}},"required":["items"]},"ClaimDenyParams":{"type":"object","properties":{"reason":{"type":"string","description":"Recorded on the claim for the customer."}}},"ClaimResolveParams":{"type":"object","properties":{"resolution":{"type":"string","enum":["refund","replacement","refund_and_replacement"],"description":"Money back, a replacement shipment, or both."},"refund_method":{"type":"string","enum":["original_payment","store_credit"],"description":"Defaults to `store_credit`."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Defaults to the claim total."},"replacement_line_item_ids":{"type":"array","items":{"type":"string"},"description":"Which claim lines to send a replacement for. Omit to keep what the claim was opened with."}},"required":["resolution"]},"ClaimUpdateParams":{"type":"object","properties":{"reason_id":{"type":"string","description":"One of the store's claim reasons."},"memo":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"CollectionCreateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"permalink":{"type":"string"},"position":{"type":"integer","description":"1-based position among the store's collections; the server shifts its siblings. The nested products reposition endpoints, unlike this, take 0-based indexes."},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the landscape image, or null to remove it.","nullable":true},"square_image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the square image, or null to remove it.","nullable":true},"automatic":{"type":"boolean","description":"When true, membership is materialized from `rules` instead of curated by hand."},"rules_match_policy":{"type":"string","enum":["all","any"],"description":"Whether a product must match all rules or any of them. Defaults to `all`."},"sort_order":{"type":"string","enum":["manual","best_selling","price asc","price desc","available_on desc","available_on asc","name asc","name desc"],"description":"Default product sort for the storefront listing; a shopper's own sort wins. Defaults to `manual`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRuleParams"},"description":"The complete desired rule set. Entries with an `id` update, entries without one are created, and existing rules left out are removed."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}},"required":["name"]},"CollectionRuleParams":{"type":"object","properties":{"id":{"type":"string","description":"Omit to create a new rule."},"type":{"type":"string","description":"Wire shorthand for the rule kind, from the collection rule types endpoint."},"value":{"type":"string"},"match_policy":{"type":"string","enum":["is_equal_to","is_not_equal_to","contains","does_not_contain"]}}},"CollectionUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"permalink":{"type":"string"},"position":{"type":"integer","description":"1-based position among the store's collections; the server shifts its siblings. The nested products reposition endpoints, unlike this, take 0-based indexes."},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the landscape image, or null to remove it.","nullable":true},"square_image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the square image, or null to remove it.","nullable":true},"automatic":{"type":"boolean","description":"When true, membership is materialized from `rules` instead of curated by hand."},"rules_match_policy":{"type":"string","enum":["all","any"],"description":"Whether a product must match all rules or any of them. Defaults to `all`."},"sort_order":{"type":"string","enum":["manual","best_selling","price asc","price desc","available_on desc","available_on asc","name asc","name desc"],"description":"Default product sort for the storefront listing; a shopper's own sort wins. Defaults to `manual`."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRuleParams"},"description":"The complete desired rule set. Entries with an `id` update, entries without one are created, and existing rules left out are removed."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}}},"CommissionRateCreateParams":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","description":"Your own identifier for this rate; unique per store.","nullable":true},"enabled":{"type":"boolean"},"position":{"type":"integer","description":"Place in the list. Rates resolve top-down and the first whose rules match wins, so 1 is tried first. New rates are created at the top; send this to move one. A rate with no rules matches every sale, so the marketplace default belongs at the bottom."},"kind":{"type":"string","enum":["percentage","fixed"],"description":"`percentage` charges a share of the sale; `fixed` charges a flat fee."},"value":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"A percentage (10 = 10%) or a flat amount, per `kind`."},"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. Percentage rates only."},"commission_tax_rate":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"VAT on the commission itself, as a fraction rather than a percentage. Null lets the store's tax engine answer for the seller's jurisdiction.","nullable":true},"metadata":{"type":"object","additionalProperties":true},"amounts":{"type":"object","additionalProperties":true,"description":"What a flat fee charges, keyed by currency, as decimal strings. A sale in a currency with no amount falls to the next matching rate. Replaces the whole set."},"bounds":{"type":"object","additionalProperties":true,"description":"The floor and cap a percentage charges within, keyed by currency: `{ min_amount, max_amount }` decimal strings. A sale in a currency with no bounds is charged unbounded. Replaces the whole set."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRuleDraftParams"},"description":"The full targeting; what you send replaces what the rate holds."}},"required":["name","kind","value"]},"CommissionRateUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","description":"Your own identifier for this rate; unique per store.","nullable":true},"enabled":{"type":"boolean"},"position":{"type":"integer","description":"Place in the list. Rates resolve top-down and the first whose rules match wins, so 1 is tried first. New rates are created at the top; send this to move one. A rate with no rules matches every sale, so the marketplace default belongs at the bottom."},"kind":{"type":"string","enum":["percentage","fixed"],"description":"`percentage` charges a share of the sale; `fixed` charges a flat fee."},"value":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"A percentage (10 = 10%) or a flat amount, per `kind`."},"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. Percentage rates only."},"commission_tax_rate":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"VAT on the commission itself, as a fraction rather than a percentage. Null lets the store's tax engine answer for the seller's jurisdiction.","nullable":true},"metadata":{"type":"object","additionalProperties":true},"amounts":{"type":"object","additionalProperties":true,"description":"What a flat fee charges, keyed by currency, as decimal strings. A sale in a currency with no amount falls to the next matching rate. Replaces the whole set."},"bounds":{"type":"object","additionalProperties":true,"description":"The floor and cap a percentage charges within, keyed by currency: `{ min_amount, max_amount }` decimal strings. A sale in a currency with no bounds is charged unbounded. Replaces the whole set."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CommissionRuleDraftParams"},"description":"The full targeting; what you send replaces what the rate holds."}}},"CommissionRuleDraftParams":{"type":"object","properties":{"id":{"type":"string","description":"Present for an existing rule; omit to create one.","nullable":true},"type":{"type":"string","description":"A kind from `GET /commission_rates/rule_types`."},"preferences":{"type":"object","additionalProperties":true,"description":"Configuration for the kind, per its type's `schema`."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For kinds that name products, which are kept outside preferences."}},"required":["type"]},"CompanyAddressParams":{"type":"object","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"},"zipcode":{"type":"string"},"phone":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 code, such as `US`."},"state_code":{"type":"string","description":"The state or province abbreviation, such as `NY`."},"default_billing":{"type":"boolean","description":"True makes this the default address of that kind, false gives the slot up, and leaving it out keeps the current default."},"default_shipping":{"type":"boolean","description":"True makes this the default address of that kind, false gives the slot up, and leaving it out keeps the current default."}}},"CompanyMembershipCreateParams":{"type":"object","properties":{"customer_email":{"type":"string","description":"An existing customer becomes a member immediately; an unknown email becomes an invitation, and the response is an invitation instead of a membership."},"metadata":{"type":"object","additionalProperties":true}},"required":["customer_email"]},"CompanyParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string","description":"Required when creating."},"kind":{"type":"string","enum":["company","division"],"description":"`company` is a legal entity (may hold tax registrations), `division` an organizational unit. Roots must be `company`."},"parent_id":{"type":"string","description":"The parent node. Omit or null for a root.","nullable":true},"po_number_required":{"type":"boolean","description":"Whether this buyer's own procurement process demands a PO reference on every order: checkout asks for one and refuses to complete without it."},"metadata":{"type":"object","additionalProperties":true}}},"CustomFieldCreateParams":{"type":"object","properties":{"custom_field_definition_id":{"type":"string"},"value":{"description":"A value matching the definition's `field_type`: a scalar for text, number and boolean fields; a list or a hash for JSON fields."}},"required":["custom_field_definition_id","value"]},"CustomFieldDefinitionCreateParams":{"type":"object","properties":{"namespace":{"type":"string","description":"Defaults to `custom`."},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to the titleized `key`."},"field_type":{"type":"string","description":"Custom field type token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension type that has no token is named by its registered class instead."},"resource_type":{"type":"string","description":"Shorthand of the resource the field attaches to, from the resource types endpoint."},"storefront_visible":{"type":"boolean","description":"When false, the definition is admin-only and never exposed in the Store API."},"searchable":{"type":"boolean","description":"Include values in storefront product text search. Supported for `short_text`, `long_text` and `number` fields; other types are refused."},"sortable":{"type":"boolean","description":"Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`). Supported for `short_text` and `number` fields; other types are refused."}},"required":["key","field_type","resource_type"]},"CustomFieldDefinitionUpdateParams":{"type":"object","properties":{"namespace":{"type":"string","description":"Defaults to `custom`."},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to the titleized `key`."},"field_type":{"type":"string","description":"Custom field type token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension type that has no token is named by its registered class instead."},"resource_type":{"type":"string","description":"Shorthand of the resource the field attaches to, from the resource types endpoint."},"storefront_visible":{"type":"boolean","description":"When false, the definition is admin-only and never exposed in the Store API."},"searchable":{"type":"boolean","description":"Include values in storefront product text search. Supported for `short_text`, `long_text` and `number` fields; other types are refused."},"sortable":{"type":"boolean","description":"Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`). Supported for `short_text` and `number` fields; other types are refused."}}},"CustomFieldUpdateParams":{"type":"object","properties":{"value":{"description":"A value matching the definition's `field_type`: a scalar for text, number and boolean fields; a list or a hash for JSON fields."}},"required":["value"]},"CustomFieldValueParams":{"type":"object","properties":{"id":{"type":"string"},"custom_field_definition_id":{"type":"string"},"value":{"description":"A scalar for text, number and boolean fields; a list or a hash for JSON fields."}}},"CustomerAddressParams":{"type":"object","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"},"zipcode":{"type":"string"},"phone":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 code, such as `US`."},"state_code":{"type":"string","description":"The state or province abbreviation, such as `NY`."},"firstname":{"type":"string","description":"Older spellings of `first_name` and `last_name`."},"lastname":{"type":"string","description":"Older spellings of `first_name` and `last_name`."},"alternative_phone":{"type":"string"},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean","description":"Makes this the customer's default address of that kind."},"is_default_shipping":{"type":"boolean","description":"Makes this the customer's default address of that kind."}}},"CustomerBulkGroupsParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"},"description":"Groups from other stores are ignored."}},"required":["ids","customer_group_ids"]},"CustomerCreateParams":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"password":{"type":"string","description":"Optional: a customer created without one claims the account through a password reset."},"password_confirmation":{"type":"string","description":"Optional: a customer created without one claims the account through a password reset."},"selected_locale":{"type":"string"},"avatar_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()`."},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string","description":"Rich text HTML. Reads come back as this plus `internal_note_html`."},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"},"description":"Replaces the customer's group membership."}},"required":["email"]},"CustomerGroupCreateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"description":"Replaces the group's members."}},"required":["name"]},"CustomerGroupUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"description":"Replaces the group's members."}}},"CustomerStoreCreditCreateParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"},"currency":{"type":"string"},"memo":{"type":"string"}},"required":["amount","currency"]},"CustomerStoreCreditUpdateParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"},"memo":{"type":"string"}}},"CustomerUpdateParams":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"password":{"type":"string","description":"Optional: a customer created without one claims the account through a password reset."},"password_confirmation":{"type":"string","description":"Optional: a customer created without one claims the account through a password reset."},"selected_locale":{"type":"string"},"avatar_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()`."},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string","description":"Rich text HTML. Reads come back as this plus `internal_note_html`."},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"},"description":"Replaces the customer's group membership."}}},"DataRequestCreateParams":{"type":"object","properties":{"customer_id":{"type":"string"},"kind":{"type":"string","enum":["access","erasure"],"description":"`access` asks for a copy of the customer's personal data; `erasure` asks for it to be erased."}},"required":["customer_id","kind"]},"DeliveryCreateParams":{"type":"object","properties":{"tracking_number":{"type":"string","description":"A carrier tracking number, a freight PRO or container number, or a full tracking link. A corrected number resets the carrier status to `pending`."},"carrier":{"type":"string","description":"Free text; detected from the number's format when omitted."},"service":{"type":"string"},"tracking_url":{"type":"string"}},"required":["tracking_number"]},"DeliveryMarkDeliveredParams":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When it arrived. Defaults to now."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification once the parcel completes. Defaults to true."}}},"DeliveryMethodParams":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string","description":"Fulfillment provider shorthand (see the fulfillment providers endpoint), e.g. `manual`."},"pickup_point_provider":{"type":"string","nullable":true},"rate_provider":{"type":"string","description":"Rate provider shorthand (see the rate providers endpoint), e.g. `easy_post`. Omit or send null for the built-in provider, which prices through the method's calculator.","nullable":true},"storefront_visible":{"type":"boolean"},"available_to_sellers":{"type":"boolean","description":"Marketplace only: whether a seller's packages may be quoted by this method. Off by default, and refused on a method that belongs to a seller."},"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","description":"Prefixed tax category ID (`taxcat_...`), or null to clear.","nullable":true},"markup_flat":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Method-level flat handling fee added on top of provider-quoted rates.","nullable":true},"markup_percent":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Method-level percentage handling fee added on top of provider-quoted rates. Ignored for calculator-priced methods.","nullable":true},"delivery_profile_id":{"type":"string","description":"Delivery profile this method belongs to (`fp_...`); defaults to the store default profile."},"delivery_origin_group_id":{"type":"string","description":"Origin group offering this method (`og_...`); defaults to the zone's group, else the profile's default group."},"delivery_zone_id":{"type":"string","description":"Delivery zone narrowing destinations (`dz_...`), or null for no restriction. Must belong to the method's profile.","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Pickup locations (`sloc_...`); replaces the full set."},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"description":"How the method prices a shipment: a type from the calculators endpoint and its preferences, matching that type's `schema`."},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"A rule kind from the delivery method rule types endpoint."},"active":{"type":"boolean"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"},"description":"Products an association-backed rule (`excluded_products_rule`) applies to."}}},"description":"Eligibility rules. Replaces the full set: omitted rules are removed."},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodServiceParams"},"description":"Carrier service rows: which provider services this method offers. Replaces the full set: omitted rows are removed; no rows means every service the provider returns is offered."}}},"DeliveryMethodRuleCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"A rule kind from the delivery method rule types endpoint."},"active":{"type":"boolean","description":"Defaults to true on create."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's preference schema."},"product_ids":{"type":"array","items":{"type":"string"},"description":"Products an association-backed rule (`excluded_products_rule`) applies to. An empty list clears them."}},"required":["type"]},"DeliveryMethodRuleUpdateParams":{"type":"object","properties":{"active":{"type":"boolean","description":"Defaults to true on create."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's preference schema."},"product_ids":{"type":"array","items":{"type":"string"},"description":"Products an association-backed rule (`excluded_products_rule`) applies to. An empty list clears them."}}},"DeliveryMethodServiceParams":{"type":"object","properties":{"id":{"type":"string","description":"Prefixed row ID (`dms_...`) when updating an existing row."},"carrier":{"type":"string","description":"Carrier identifier as the provider's API knows it."},"service":{"type":"string","description":"Service identifier as the provider's API knows it."},"label":{"type":"string","description":"Display label shown to customers instead of the carrier-derived name.","nullable":true},"markup_flat":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Overrides the method-level flat markup for this service.","nullable":true},"markup_percent":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Overrides the method-level percentage markup for this service.","nullable":true},"position":{"type":"integer"}},"required":["carrier","service"]},"DeliveryOriginGroupParams":{"type":"object","properties":{"name":{"type":"string","nullable":true},"position":{"type":"integer"},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location."}}},"DeliveryProfileParams":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","description":"Registered profile kind (`shipping`, `digital`, extension kinds) from the kinds endpoint. Read on create only; defaults to shipping."},"default":{"type":"boolean","description":"Promotes this profile to the store default; the previous default is demoted."},"position":{"type":"integer"},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location."}}},"DeliveryUpdateParams":{"type":"object","properties":{"tracking_number":{"type":"string","description":"A carrier tracking number, a freight PRO or container number, or a full tracking link. A corrected number resets the carrier status to `pending`."},"carrier":{"type":"string","description":"Free text; detected from the number's format when omitted."},"service":{"type":"string"},"tracking_url":{"type":"string"}}},"DeliveryZoneMemberParams":{"type":"object","properties":{"member_type":{"type":"string","enum":["country","state","postal_code"]},"country_code":{"type":"string"},"state_code":{"type":"string","description":"A subdivision code or name. Without `country_code` the country is inferred when only one country matches."},"postal_code_prefix":{"type":"string"},"postal_code_from":{"type":"string"},"postal_code_to":{"type":"string"}},"required":["member_type"]},"DeliveryZoneParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string","description":"Delivery profile this zone belongs to (`fp_...`); defaults to the store default profile."},"delivery_origin_group_id":{"type":"string","description":"Origin group this zone belongs to (`og_...`)."},"members":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneMemberParams"},"description":"Replaces the zone's full member set atomically."}}},"DigitalAssetCreateParams":{"type":"object","properties":{"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for an uploaded file, omitted for a provider-backed asset. On update it replaces the file for everyone who already bought it."},"variant_id":{"type":"string","description":"Defaults to the product's default variant when omitted."},"provider_type":{"type":"string","description":"A provider shorthand from the providers endpoint. Omit for an uploaded file."},"provider_settings":{"type":"object","additionalProperties":true,"description":"Values for the provider's settings schema, keyed by field name."},"authorized_clicks":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true},"authorized_days":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true}}},"DigitalAssetUpdateParams":{"type":"object","properties":{"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for an uploaded file, omitted for a provider-backed asset. On update it replaces the file for everyone who already bought it."},"variant_id":{"type":"string","description":"Defaults to the product's default variant when omitted."},"provider_type":{"type":"string","description":"A provider shorthand from the providers endpoint. Omit for an uploaded file."},"provider_settings":{"type":"object","additionalProperties":true,"description":"Values for the provider's settings schema, keyed by field name."},"authorized_clicks":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true},"authorized_days":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true}}},"DiscountCodeApplyParams":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]},"DiscountCreateParams":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"An amount in the order currency for a `flat` discount, or a percentage for a `percent` one."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"On create, an older spelling of `value`, read when `value` is absent. On update, the new amount of the row."},"value_type":{"type":"string","enum":["flat","percent"],"description":"Defaults to `flat`."},"line_item_id":{"type":"string","description":"The line item the discount applies to. Omitted, the value is distributed across the line items.","nullable":true}},"required":["label"]},"DiscountUpdateParams":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"On create, an older spelling of `value`, read when `value` is absent. On update, the new amount of the row."}}},"EmailTemplateDraftParams":{"type":"object","properties":{"language":{"type":"string","description":"A language code, or `any` (the default) for the version every language uses."},"subject":{"type":"string","nullable":true},"body":{"type":"string"},"lock_version":{"type":"integer","description":"The `lock_version` the draft was loaded with, or null when there was no draft; a save from an older copy is refused with 409. Omit it to save without checking.","nullable":true},"rebase":{"type":"boolean","description":"Marks the draft as based on Spree's current default, after reviewing what changed in it."}}},"EmailTemplatePreviewParams":{"type":"object","properties":{"language":{"type":"string","description":"A language code, or `any` (the default) for the version every language uses."},"subject":{"type":"string","description":"An unsaved subject, in place of the current one.","nullable":true},"body":{"type":"string","description":"An unsaved body, in place of the current one."},"record_id":{"type":"string","description":"The record to build sample data from; the store's latest matching record otherwise."},"email_key":{"type":"string","description":"For the layout or a partial, the email to show it in."},"branding":{"type":"object","properties":{"accent_color":{"type":"string","nullable":true},"background_color":{"type":"string","nullable":true},"card_color":{"type":"string","nullable":true},"text_color":{"type":"string","nullable":true},"heading_color":{"type":"string","nullable":true},"font":{"type":"string","enum":["inter","system","helvetica","georgia","roboto","lato","merriweather"],"nullable":true}},"description":"Unsaved colors and font to preview, named like the store's `email_*` settings."}}},"EmailTemplateRestoreParams":{"type":"object","properties":{"language":{"type":"string","description":"A language code, or `any` (the default) for the version every language uses."},"lock_version":{"type":"integer","description":"The open draft's `lock_version`, or null when there is none; checked as when saving.","nullable":true}}},"EmailTemplateVersionParams":{"type":"object","properties":{"language":{"type":"string","description":"A language code, or `any` (the default) for the version every language uses."},"lock_version":{"type":"integer","description":"The draft's `lock_version` as reviewed. A draft saved since is refused with 409."}}},"ExchangeCancelParams":{"type":"object","properties":{"reason":{"type":"string","description":"A note on why the exchange was canceled."}}},"ExchangeCreateParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"fulfillment_item_id":{"type":"string"},"new_variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["fulfillment_item_id","new_variant_id","quantity"]},"description":"Items coming back, and what goes out in their place."},"stock_location_id":{"type":"string","description":"Where the goods come back to."},"reason_id":{"type":"string","description":"One of the store's return reasons."},"memo":{"type":"string"}},"required":["items"]},"ExchangeFulfillParams":{"type":"object","properties":{"refund_method":{"type":"string","enum":["original_payment","store_credit"],"description":"How a credit is returned when the replacements cost less than what came back. Defaults to `store_credit`. A balance the customer owes is left for the merchant to collect."}}},"ExchangeReceiveParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"exchange_line_item_id":{"type":"string"},"quantity":{"type":"integer"},"resellable":{"type":"boolean","description":"Goods that cannot be resold are received but never restocked. Defaults to true."}},"required":["exchange_line_item_id","quantity"]},"description":"What actually arrived. Omit to receive everything as requested and resellable."}}},"ExchangeUpdateParams":{"type":"object","properties":{"stock_location_id":{"type":"string","description":"Where the goods come back to."},"reason_id":{"type":"string","description":"One of the store's return reasons."},"memo":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"ExportCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"Which dataset to export, as its shorthand: `products`, `orders`, `customers`, `product_translations`, `gift_cards`, `coupon_codes`, `newsletter_subscribers`, `price_list_prices`, `purchase_orders`, or a type an extension registers."},"record_selection":{"type":"string","enum":["filtered","all"],"description":"`filtered` (the default) keeps `search_params`; `all` ignores them and exports every record in scope."},"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 allowed origins."},"search_params":{"type":"object","additionalProperties":true,"description":"A Ransack query, with the predicates the list endpoint accepts. A `price_list_prices` export requires `price_list_id_eq` naming a price list of the current store, and refuses `record_selection: \"all\"`."}},"required":["type"]},"FeeCreateParams":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty","exchange"],"description":"Defaults to `surcharge`."},"line_item_id":{"type":"string","description":"The line item or fulfillment the fee belongs to. Omitted, the fee is order-level.","nullable":true},"fulfillment_id":{"type":"string","description":"The line item or fulfillment the fee belongs to. Omitted, the fee is order-level.","nullable":true}},"required":["label","amount"]},"FeeUpdateParams":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment","duty","exchange"],"description":"Defaults to `surcharge`."}}},"FileUploadCreateParams":{"type":"object","properties":{"filename":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"integer"},"checksum":{"type":"string","description":"Base64-encoded MD5 digest of the file; the storage service checks the bytes against it."},"visibility":{"type":"string","enum":["public","private"],"description":"`public` (the default) for images and videos customers see, `private` for anything else."},"file":{"type":"string","format":"binary","description":"The bytes, for a multipart upload."}},"required":["filename","content_type"]},"FulfillmentCreateParams":{"type":"object","properties":{"stock_location_id":{"type":"string","description":"The location the fulfillment ships from. On update, moving it re-prices the fulfillment against that location's rates."},"source_fulfillment_id":{"type":"string","description":"The only fulfillment of this order to move units from, its exchange and claim replacements included: how a canceled replacement is sent again. Omitted, the customer's bought units are taken from every unshipped fulfillment."},"tracking":{"type":"string","description":"Carrier tracking number, or a full `https://` tracking link, which is served back as `tracking_url` unchanged."},"delivery_method_id":{"type":"string","description":"Delivery method attached as the selected rate. Defaults to the delivery method of the fully drained source fulfillments."},"cost":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Explicit shipping cost, such as the 3PL price. Defaults to the summed cost of the fully drained source fulfillments, which keeps the order total unchanged. Persists only with `status: shipped`; pending fulfillments are re-priced by the rate engine."},"status":{"type":"string","enum":["shipped"],"description":"Pass `shipped` to register an already-shipped external fulfillment."},"metadata":{"type":"object","additionalProperties":true},"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]},"description":"Line item quantities to fulfill. Omit to fulfill every unit not yet shipped."}},"required":["stock_location_id"]},"FulfillmentFulfillParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]},"description":"Line item quantities to ship. Omit to ship everything the fulfillment holds; a subset is split onto a new fulfillment, which is the one that ships."},"tracking":{"type":"string","description":"Carrier tracking number or a full `https://` tracking link, stored on the fulfillment that ships."},"tracking_carrier":{"type":"string","description":"Which carrier the number belongs to; detected from the number when omitted."},"notify_customer":{"type":"boolean","description":"Whether the customer gets the shipment email. Defaults to true; pass false to suppress it for this dispatch only."},"force":{"type":"boolean","description":"Hand the goods over even though the order is unpaid or holds backordered units."}}},"FulfillmentMarkDeliveredParams":{"type":"object","properties":{"delivered_at":{"type":"string","format":"date-time","description":"When it arrived. Defaults to now; return windows run from this time."},"notify_customer":{"type":"boolean","description":"Whether the customer gets a delivery notification. Defaults to true."}}},"FulfillmentSplitParams":{"type":"object","properties":{"variant_id":{"type":"string","description":"The variant being moved out."},"quantity":{"type":"integer"},"stock_location_id":{"type":"string","description":"Origin of the new fulfillment. Defaults to the source fulfillment's location."}},"required":["variant_id","quantity"]},"FulfillmentUpdateParams":{"type":"object","properties":{"stock_location_id":{"type":"string","description":"The location the fulfillment ships from. On update, moving it re-prices the fulfillment against that location's rates."},"tracking":{"type":"string","description":"Carrier tracking number, or a full `https://` tracking link, which is served back as `tracking_url` unchanged."},"tracking_carrier":{"type":"string","description":"Which carrier the tracking number belongs to: a slug from the tracking carriers endpoint. Left blank, it is detected from the number's format where possible."},"selected_delivery_rate_id":{"type":"string"}}},"GiftCardApplyParams":{"type":"object","properties":{"code":{"type":"string","description":"The gift card code; matched case-insensitively."}},"required":["code"]},"GiftCardBatchCreateParams":{"type":"object","properties":{"prefix":{"type":"string","description":"Lowercased and prepended to every generated code."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"The amount of each card, greater than zero."},"codes_count":{"type":"integer","description":"How many cards to generate. Capped at `gift_card_batch_limit`; batches over `gift_card_batch_web_limit` generate in the background."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"expires_at":{"type":"string","format":"date","nullable":true}},"required":["prefix","amount","codes_count"]},"GiftCardCreateParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Generated when omitted."},"expires_at":{"type":"string","format":"date","nullable":true},"customer_id":{"type":"string","description":"The customer the card belongs to. Needs the `read_customers` permission; null detaches it.","nullable":true}},"required":["amount"]},"GiftCardUpdateParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Generated when omitted."},"expires_at":{"type":"string","format":"date","nullable":true},"customer_id":{"type":"string","description":"The customer the card belongs to. Needs the `read_customers` permission; null detaches it.","nullable":true}}},"ImportCompleteMappingParams":{"type":"object","properties":{"mappings":{"type":"array","items":{"type":"object","properties":{"schema_field":{"type":"string","description":"A schema field name from the import's `schema_fields`."},"file_column":{"type":"string","description":"The CSV header to read the field from; null unmaps the field.","nullable":true}},"required":["schema_field"]},"description":"Column assignments to apply before processing starts. Omit to accept the ones assigned on create."}}},"ImportCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"Which dataset to import, as its shorthand: `products`, `customers`, `product_translations`, `price_list_prices`, `purchase_orders`, or a type an extension registers."},"attachment_signed_id":{"type":"string","description":"The `signed_id` of the uploaded CSV, from `files.upload()` with `visibility: \"private\"`."},"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 allowed origins."},"price_list_id":{"type":"string","description":"For `price_list_prices` imports: the price list the rows are merged into. Must belong to the current store; other types ignore it."}},"required":["type","attachment_signed_id"]},"IntegrationCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from the integration types endpoint."},"active":{"type":"boolean","description":"Activating runs the connection check, and a failed check is a 422."},"preferences":{"type":"object","additionalProperties":true,"description":"Credential values. Secret preferences come back masked, and sending a masked value back keeps the stored secret."}},"required":["type"]},"IntegrationUpdateParams":{"type":"object","properties":{"active":{"type":"boolean","description":"Activating runs the connection check, and a failed check is a 422."},"preferences":{"type":"object","additionalProperties":true,"description":"Credential values. Secret preferences come back masked, and sending a masked value back keeps the stored secret."}}},"InvitationAcceptParams":{"type":"object","properties":{"password":{"type":"string","description":"Required when the invitee has no account yet: it creates one. An existing account signs in without it."},"password_confirmation":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}},"InvitationCreateParams":{"type":"object","properties":{"email":{"type":"string"},"role_id":{"type":"string","description":"The role (`role_...`) the invitee gets on accepting."}},"required":["email","role_id"]},"LineItemCreateParams":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer","description":"Defaults to 1 when adding an item."},"price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Negotiated unit price. Stamps the line `price_source: 'manual'`, so quantity changes and recalculation never re-price it; an explicit null reverts the line to catalog pricing. Omit to leave pricing alone. Draft (incomplete) orders only.","nullable":true},"options":{"type":"object","additionalProperties":true}},"required":["variant_id"]},"LineItemUpdateParams":{"type":"object","properties":{"quantity":{"type":"integer","description":"Defaults to 1 when adding an item."},"price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Negotiated unit price. Stamps the line `price_source: 'manual'`, so quantity changes and recalculation never re-price it; an explicit null reverts the line to catalog pricing. Omit to leave pricing alone. Draft (incomplete) orders only.","nullable":true},"metadata":{"type":"object","additionalProperties":true}}},"MarketCreateParams":{"type":"object","properties":{"name":{"type":"string","description":"Display name, unique within the store."},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"Locale used as the market default. Always part of `supported_locales`."},"tax_inclusive":{"type":"boolean","description":"Display prices with tax included."},"tax_provider":{"type":"string","description":"Shorthand of the tax engine that prices this market, from the tax providers endpoint. Null uses the installation default.","nullable":true},"default":{"type":"boolean","description":"Setting true demotes the previous default market of the store."},"position":{"type":"integer","description":"Sort order within the store; lower comes first."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locales available in this market. The default locale is always included."},"country_codes":{"type":"array","items":{"type":"string"},"description":"ISO 3166-1 alpha-2 codes of the countries in this market. At least one is required."}},"required":["name","currency","default_locale","country_codes"]},"MarketUpdateParams":{"type":"object","properties":{"name":{"type":"string","description":"Display name, unique within the store."},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"Locale used as the market default. Always part of `supported_locales`."},"tax_inclusive":{"type":"boolean","description":"Display prices with tax included."},"tax_provider":{"type":"string","description":"Shorthand of the tax engine that prices this market, from the tax providers endpoint. Null uses the installation default.","nullable":true},"default":{"type":"boolean","description":"Setting true demotes the previous default market of the store."},"position":{"type":"integer","description":"Sort order within the store; lower comes first."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locales available in this market. The default locale is always included."},"country_codes":{"type":"array","items":{"type":"string"},"description":"ISO 3166-1 alpha-2 codes of the countries in this market. At least one is required."}}},"MeUpdateParams":{"type":"object","properties":{"selected_locale":{"type":"string","description":"The dashboard display language."},"first_name":{"type":"string"},"last_name":{"type":"string"},"avatar_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` to set the avatar, or null to remove it. Omit it to keep the current photo.","nullable":true}}},"MediaCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"alt":{"type":"string","nullable":true},"position":{"type":"integer"},"media_type":{"type":"string","enum":["image","video","external_video"],"description":"Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`."},"external_video_url":{"type":"string","description":"YouTube or Vimeo link. Required when `media_type` is `external_video`.","nullable":true},"poster_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for a video's poster frame."},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"attachment":{"type":"string","description":"The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`."},"url":{"type":"string","description":"Fetch an image from this URL, in the background. Images only: an external video uses `external_video_url`."},"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the media file itself."},"source_media_id":{"type":"string","description":"Place a file that is already in the library. The new row shares the source file rather than copying it, and takes its own alt, position and variant links from here."},"variant_ids":{"type":"array","items":{"type":"string"},"description":"Variants to link this product-level media to. Variants of other products are dropped."}}},"MediaLibraryCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"alt":{"type":"string","nullable":true},"position":{"type":"integer"},"media_type":{"type":"string","enum":["image","video","external_video"],"description":"Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`."},"external_video_url":{"type":"string","description":"YouTube or Vimeo link. Required when `media_type` is `external_video`.","nullable":true},"poster_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for a video's poster frame."},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"attachment":{"type":"string","description":"The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`."},"url":{"type":"string","description":"Fetch an image from this URL, in the background. Images only: an external video uses `external_video_url`."},"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the media file itself."},"source_media_id":{"type":"string","description":"Place a file that is already in the library. The new row shares the source file rather than copying it, and takes its own alt, position and variant links from here."},"variant_ids":{"type":"array","items":{"type":"string"},"description":"Variants to link this product-level media to. Variants of other products are dropped."}}},"MediaLibraryUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"alt":{"type":"string","nullable":true},"position":{"type":"integer"},"media_type":{"type":"string","enum":["image","video","external_video"],"description":"Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`."},"external_video_url":{"type":"string","description":"YouTube or Vimeo link. Required when `media_type` is `external_video`.","nullable":true},"poster_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for a video's poster frame."},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"attachment":{"type":"string","description":"The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`."},"url":{"type":"string","description":"Fetch an image from this URL, in the background. Images only: an external video uses `external_video_url`."},"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the media file itself."},"source_media_id":{"type":"string","description":"Place a file that is already in the library. The new row shares the source file rather than copying it, and takes its own alt, position and variant links from here."},"variant_ids":{"type":"array","items":{"type":"string"},"description":"Variants to link this product-level media to. Variants of other products are dropped."}}},"MediaUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"alt":{"type":"string","nullable":true},"position":{"type":"integer"},"media_type":{"type":"string","enum":["image","video","external_video"],"description":"Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`."},"external_video_url":{"type":"string","description":"YouTube or Vimeo link. Required when `media_type` is `external_video`.","nullable":true},"poster_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for a video's poster frame."},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"attachment":{"type":"string","description":"The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`."},"url":{"type":"string","description":"Fetch an image from this URL, in the background. Images only: an external video uses `external_video_url`."},"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the media file itself."},"source_media_id":{"type":"string","description":"Place a file that is already in the library. The new row shares the source file rather than copying it, and takes its own alt, position and variant links from here."},"variant_ids":{"type":"array","items":{"type":"string"},"description":"Variants to link this product-level media to. Variants of other products are dropped."}}},"OptionTypeCreateParams":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"kind":{"type":"string","enum":["dropdown","color_swatch","buttons"]},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValueParams"},"description":"Inline option values. Values left out of the list on update are destroyed, so send the full set every time."}},"required":["name","label"]},"OptionTypeUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"kind":{"type":"string","enum":["dropdown","color_swatch","buttons"]},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValueParams"},"description":"Inline option values. Values left out of the list on update are destroyed, so send the full set every time."}}},"OptionValueParams":{"type":"object","properties":{"id":{"type":"string","description":"Present for existing values. Omit to create a new one."},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"color_code":{"type":"string","description":"Hex color. Only meaningful when the option type's `kind` is `color_swatch`.","nullable":true},"image_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()`, or null to remove the image.","nullable":true}}},"OrderCancelParams":{"type":"object","properties":{"cancel_reason_id":{"type":"string","description":"Why the order was canceled: the id of one of the store's cancellation reasons."},"cancel_note":{"type":"string","description":"Staff-facing note about the cancellation."},"refund_payments":{"type":"boolean","description":"Whether this order's share of a payment shared across a split checkout is handed back."},"refund_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"How much of that share to return. Defaults to all of it; refused on an order whose payment is not shared."},"notify_customer":{"type":"boolean","description":"Send the order cancellation email after canceling."}}},"OrderCompleteParams":{"type":"object","properties":{"payment_pending":{"type":"boolean"},"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}},"OrderCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"email":{"type":"string"},"customer_id":{"type":"string"},"use_customer_default_address":{"type":"boolean","description":"With `customer_id`, copies the customer's saved billing and shipping addresses onto the order."},"currency":{"type":"string"},"market_id":{"type":"string"},"channel_id":{"type":"string","description":"Defaults to the store primary channel when omitted."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note."},"internal_note":{"type":"string","description":"Staff-only note. Rich text HTML; reads come back as this plus `internal_note_html`."},"po_number":{"type":"string","description":"The buyer's own purchase-order reference. Searchable alongside the order number, and rendered on every order-facing document."},"po_document_signed_id":{"type":"string","description":"The `signed_id` of the buyer's purchase order, from `files.upload()` with `visibility: 'private'`. Null removes the document the order carries.","nullable":true},"shipping_address_id":{"type":"string","description":"An existing address of the customer."},"billing_address_id":{"type":"string","description":"An existing address of the customer."},"preferred_stock_location_id":{"type":"string","description":"Stock location to prefer for fulfillment. Order Routing's built-in preferred-location rule ranks it first; routing falls back to the next rule when the location can't cover the cart."},"company_id":{"type":"string","description":"Makes the order a company purchase, with that company's catalog prices and tax treatment. Null makes a draft a plain customer order again.","nullable":true},"coupon_code":{"type":"string","description":"Applied non-fatally: an invalid code does not block creation."},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}},"shipping_address":{"$ref":"#/components/schemas/AddressInputParams"},"billing_address":{"$ref":"#/components/schemas/AddressInputParams"},"items":{"type":"array","items":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"},"price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Negotiated unit price; stamps `price_source: 'manual'`. Null reverts the line to catalog pricing. Draft orders only.","nullable":true},"metadata":{"type":"object","additionalProperties":true}},"required":["variant_id"]},"description":"Line items to upsert, keyed by variant. An entry sets that variant's quantity, creating the line item when the order has none; `quantity: 0` removes it. Variants you do not send are left alone."}}},"OrderRoutingRuleCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand for the rule kind, from the order routing rule types endpoint."},"active":{"type":"boolean"},"position":{"type":"integer","description":"1-based priority in the channel's rule list. Omitted on create, the rule goes last; a new position reorders the rest of the list around it."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's preference schema."}},"required":["type"]},"OrderRoutingRuleUpdateParams":{"type":"object","properties":{"active":{"type":"boolean"},"position":{"type":"integer","description":"1-based priority in the channel's rule list. Omitted on create, the rule goes last; a new position reorders the rest of the list around it."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's preference schema."}}},"OrderUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"email":{"type":"string"},"customer_id":{"type":"string"},"currency":{"type":"string"},"market_id":{"type":"string"},"channel_id":{"type":"string","description":"Defaults to the store primary channel when omitted."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note."},"internal_note":{"type":"string","description":"Staff-only note. Rich text HTML; reads come back as this plus `internal_note_html`."},"po_number":{"type":"string","description":"The buyer's own purchase-order reference. Searchable alongside the order number, and rendered on every order-facing document."},"po_document_signed_id":{"type":"string","description":"The `signed_id` of the buyer's purchase order, from `files.upload()` with `visibility: 'private'`. Null removes the document the order carries.","nullable":true},"preferred_stock_location_id":{"type":"string","description":"Stock location to prefer for fulfillment. Order Routing's built-in preferred-location rule ranks it first; routing falls back to the next rule when the location can't cover the cart."},"company_id":{"type":"string","description":"Makes the order a company purchase, with that company's catalog prices and tax treatment. Null makes a draft a plain customer order again.","nullable":true},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"}},"shipping_address":{"$ref":"#/components/schemas/AddressInputParams"},"billing_address":{"$ref":"#/components/schemas/AddressInputParams"},"items":{"type":"array","items":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"},"price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Negotiated unit price; stamps `price_source: 'manual'`. Null reverts the line to catalog pricing. Draft orders only.","nullable":true},"metadata":{"type":"object","additionalProperties":true}},"required":["variant_id"]},"description":"Line items to upsert, keyed by variant. An entry sets that variant's quantity, creating the line item when the order has none; `quantity: 0` removes it. Variants you do not send are left alone."}}},"PackageTypeCreateParams":{"type":"object","properties":{"name":{"type":"string","description":"Unique within the store."},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"],"description":"What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale order leaves on."},"length":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"],"description":"Unit the three dimensions are in; falls back to the store's unit system.","nullable":true},"weight":{"type":"number","description":"The empty package's own weight, added to content weight on every quote.","nullable":true},"max_weight":{"type":"number","description":"What the package can hold, not the same as its own weight.","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"],"nullable":true},"default":{"type":"boolean","description":"The box every parcel quote is built on. Setting this demotes whichever row held it."},"metadata":{"type":"object","additionalProperties":true}},"required":["name","kind"]},"PackageTypeUpdateParams":{"type":"object","properties":{"name":{"type":"string","description":"Unique within the store."},"kind":{"type":"string","enum":["box","envelope","carton","pallet","container"],"description":"What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale order leaves on."},"length":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"],"description":"Unit the three dimensions are in; falls back to the store's unit system.","nullable":true},"weight":{"type":"number","description":"The empty package's own weight, added to content weight on every quote.","nullable":true},"max_weight":{"type":"number","description":"What the package can hold, not the same as its own weight.","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"],"nullable":true},"default":{"type":"boolean","description":"The box every parcel quote is built on. Setting this demotes whichever row held it."},"metadata":{"type":"object","additionalProperties":true}}},"PasswordResetParams":{"type":"object","properties":{"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["password","password_confirmation"]},"PasswordResetRequestParams":{"type":"object","properties":{"email":{"type":"string","format":"email"},"redirect_url":{"type":"string","description":"The page the emailed reset link points at, with the reset token appended. Honored only on the dashboard origin, for an account that is staff of the store; ignored otherwise."}},"required":["email"]},"PaymentCaptureParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Captures part of the authorized amount. Defaults to all of it."}}},"PaymentCreateParams":{"type":"object","properties":{"payment_method_id":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Defaults to the order total left after store credit."},"source_id":{"type":"string","description":"A saved payment source of the order's customer (a credit card), for an off-session charge. Used only by payment methods that require a source."}},"required":["payment_method_id"]},"PaymentMethodCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from the payment method types endpoint."},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"storefront_visible":{"type":"boolean","description":"False keeps the method to the dashboard; true also offers it on the storefront."},"auto_capture":{"type":"boolean","description":"Deprecated: use `capture_method`. Removed in 6.1.","nullable":true},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"description":"When customers are charged for this method. Null inherits the store setting.","nullable":true},"position":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the provider's preference schema, from the payment method types endpoint."}},"required":["type","name"]},"PaymentMethodUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"storefront_visible":{"type":"boolean","description":"False keeps the method to the dashboard; true also offers it on the storefront."},"auto_capture":{"type":"boolean","description":"Deprecated: use `capture_method`. Removed in 6.1.","nullable":true},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"description":"When customers are charged for this method. Null inherits the store setting.","nullable":true},"position":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the provider's preference schema, from the payment method types endpoint."}}},"PolicyCreateParams":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string","nullable":true}},"required":["name"]},"PolicyUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"body":{"type":"string","nullable":true}}},"PriceAdjustmentTierParams":{"type":"object","properties":{"min_quantity":{"type":"integer","description":"Above 1; quantity 1 is the list's own `price_adjustment_percentage`."},"percentage":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Signed: negative discounts, positive marks up."}},"required":["min_quantity","percentage"]},"PriceBulkDestroyParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]},"PriceBulkUpsertParams":{"type":"object","properties":{"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceBulkUpsertRowParams"},"description":"Send an empty list to change nothing."}},"required":["prices"]},"PriceBulkUpsertRowParams":{"type":"object","properties":{"id":{"type":"string","description":"Present: updates that row. Absent: upserts on `(variant_id, currency, price_list_id, min_quantity)`.","nullable":true},"variant_id":{"type":"string"},"currency":{"type":"string"},"price_list_id":{"type":"string","description":"Omit or null for a base price.","nullable":true},"min_quantity":{"type":"integer","description":"The rung of the variant's ladder. Omit for the bottom rung; anything above 1 requires a `price_list_id`. A variant carries at most ten rungs on one list per currency."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"compare_at_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"required":["variant_id","currency"]},"PriceCreateParams":{"type":"object","properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"min_quantity":{"type":"integer","description":"The quantity a line must reach for this price to apply. Omit for the bottom rung of the ladder. Anything above 1 requires a `price_list_id`."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"compare_at_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"price_list_id":{"type":"string","description":"Omit or null for a base price; a price list for a list override.","nullable":true}},"required":["variant_id","currency"]},"PriceListCreateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer"},"starts_at":{"type":"string","format":"date-time","description":"Pair with `ends_at` to schedule the list: activating a list whose start is in the future marks it `scheduled`.","nullable":true},"ends_at":{"type":"string","format":"date-time","nullable":true},"match_policy":{"type":"string","enum":["all","any"],"description":"`all`: every rule must match. `any`: one matching rule is enough."},"price_adjustment_percentage":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Signed: negative discounts off base prices, positive marks up.","nullable":true},"adjust_compare_at":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceListRuleParams"},"description":"The complete rule set: rules are matched by `id` and updated, new ones are built, and rules left out are removed."},"price_adjustment_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentTierParams"},"description":"Quantity bands on the list's percentage. The payload is the whole ladder: a band left out is removed."},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceListPriceOverrideParams"},"description":"Per-variant price overrides. Each row upserts, so the variants it names become part of the list. Curating whole products goes through the nested products endpoint instead."}},"required":["name"]},"PriceListPriceOverrideParams":{"type":"object","properties":{"id":{"type":"string","description":"Updates this price row. Without it, the row upserts on `(variant_id, currency, min_quantity)`."},"variant_id":{"type":"string"},"currency":{"type":"string"},"min_quantity":{"type":"integer","description":"The rung of the variant's ladder. Omit for the bottom rung."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"compare_at_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}}},"PriceListRuleParams":{"type":"object","properties":{"id":{"type":"string","description":"Present for existing rules. Omit to create a new one.","nullable":true},"type":{"type":"string","description":"Wire shorthand for the rule kind, from the price rule types endpoint."},"preferences":{"type":"object","additionalProperties":true,"description":"The rule kind's settings, keyed by preference name."}},"required":["type"]},"PriceListUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer"},"starts_at":{"type":"string","format":"date-time","description":"Pair with `ends_at` to schedule the list: activating a list whose start is in the future marks it `scheduled`.","nullable":true},"ends_at":{"type":"string","format":"date-time","nullable":true},"match_policy":{"type":"string","enum":["all","any"],"description":"`all`: every rule must match. `any`: one matching rule is enough."},"price_adjustment_percentage":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Signed: negative discounts off base prices, positive marks up.","nullable":true},"adjust_compare_at":{"type":"boolean"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceListRuleParams"},"description":"The complete rule set: rules are matched by `id` and updated, new ones are built, and rules left out are removed."},"price_adjustment_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceAdjustmentTierParams"},"description":"Quantity bands on the list's percentage. The payload is the whole ladder: a band left out is removed."},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceListPriceOverrideParams"},"description":"Per-variant price overrides. Each row upserts, so the variants it names become part of the list. Curating whole products goes through the nested products endpoint instead."}}},"PriceParams":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"A canonical decimal string (`\"1234.56\"`: period decimal, no grouping). The API does not parse localized input."},"compare_at_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true}},"required":["currency","amount"]},"PriceUpdateParams":{"type":"object","properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"min_quantity":{"type":"integer","description":"The quantity a line must reach for this price to apply. Omit for the bottom rung of the ladder. Anything above 1 requires a `price_list_id`."},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"compare_at_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"price_list_id":{"type":"string","description":"Omit or null for a base price; a price list for a list override.","nullable":true}}},"ProductBulkCategoriesParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}},"required":["ids","category_ids"]},"ProductBulkChannelsParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}},"required":["ids","channel_ids"]},"ProductBulkCollectionsParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}},"required":["ids","collection_ids"]},"ProductBulkDestroyParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Products the caller cannot delete are skipped."}},"required":["ids"]},"ProductBulkStatusParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","active","archived"],"description":"Products in review are skipped and counted in `skipped_in_review_count`."}},"required":["ids","status"]},"ProductCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"tax_category_id":{"type":"string"},"product_type_id":{"type":"string","description":"The product type this product is created from (`pt_...`). Its option types and categories seed onto the product and its custom field definitions drive the product form. Editing the type later never rewrites existing products.","nullable":true},"delivery_profile_id":{"type":"string","description":"The delivery profile deciding how this product ships (`fp_...`); null falls back to the store default.","nullable":true},"promotionable":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"},"description":"Manual collections this product belongs to. Automatic collections are kept as they are, since their rules decide membership."},"metadata":{"type":"object","additionalProperties":true},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceParams"},"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. Don't pass both."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."},"media":{"type":"array","items":{"$ref":"#/components/schemas/ProductMediaParams"},"description":"Media written with the product. Entries with `id` update an existing asset; entries with `signed_id` attach a fresh upload; an external video needs only its URL."},"digital_assets":{"type":"array","items":{"$ref":"#/components/schemas/ProductDigitalAssetParams"},"description":"Downloadable files written with the product. Each entry carries a `signed_id` (an upload to private storage) or a `provider_type` (a provider-backed asset), and attaches to the default variant unless `variant_id` is given. An `id` updates that asset in place, so replaying the list does not duplicate it; removal uses the nested digital assets endpoint."},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublicationParams"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariantParams"},"description":"Every purchasable attribute (sku, prices, stock, weight, dimensions) lives on variants. An entry without `options` upserts onto the default variant of a simple product; pass `id` to update an existing variant."}},"required":["name"]},"ProductDigitalAssetParams":{"type":"object","properties":{"id":{"type":"string"},"signed_id":{"type":"string"},"variant_id":{"type":"string"},"provider_type":{"type":"string","description":"A provider shorthand from the digital asset providers endpoint."},"provider_settings":{"type":"object","additionalProperties":true,"description":"Values for the provider's settings schema, keyed by field name."},"authorized_clicks":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true},"authorized_days":{"type":"integer","description":"Null means the store's download settings apply.","nullable":true}}},"ProductMediaParams":{"type":"object","properties":{"id":{"type":"string"},"signed_id":{"type":"string","description":"A `signed_id` from `files.upload()`."},"source_media_id":{"type":"string","description":"Copies an asset from the media library."},"alt":{"type":"string","nullable":true},"position":{"type":"integer"},"media_type":{"type":"string","enum":["image","video","external_video"]},"external_video_url":{"type":"string","nullable":true},"poster_signed_id":{"type":"string"},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"variant_ids":{"type":"array","items":{"type":"string"},"description":"Replaces the variants this media is linked to. An empty list clears them."}}},"ProductMembershipParams":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string"},"description":"Products from other stores, or ones the caller cannot see, are ignored."}},"required":["product_ids"]},"ProductMembershipRepositionParams":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the parent's products."}},"required":["new_position"]},"ProductPublicationParams":{"type":"object","properties":{"id":{"type":"string"},"channel_id":{"type":"string"},"published_at":{"type":"string","format":"date-time","nullable":true},"unpublished_at":{"type":"string","format":"date-time","nullable":true}}},"ProductRejectParams":{"type":"object","properties":{"reason":{"type":"string","description":"Why the submission was turned down. Sent back to the seller."}}},"ProductTypeCreateParams":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","description":"Delivery profile stamped onto products created with this type. Null leaves new products on the store default profile.","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products that get this type. Use apply to products to backfill existing ones."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products that get this type. Categories from other stores are ignored."},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinitionParams"},"description":"The custom field definitions the product form shows. Definitions not listed are removed from the type."}},"required":["name"]},"ProductTypeCustomFieldDefinitionParams":{"type":"object","properties":{"id":{"type":"string","description":"The custom field definition."},"required":{"type":"boolean"},"sort_order":{"type":"integer"}},"required":["id"]},"ProductTypeUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","description":"Delivery profile stamped onto products created with this type. Null leaves new products on the store default profile.","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products that get this type. Use apply to products to backfill existing ones."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products that get this type. Categories from other stores are ignored."},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinitionParams"},"description":"The custom field definitions the product form shows. Definitions not listed are removed from the type."}}},"ProductUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"description":{"type":"string","description":"Rich text HTML. Reads come back as this (plain text) plus `description_html`."},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"tax_category_id":{"type":"string"},"product_type_id":{"type":"string","description":"The product type this product is created from (`pt_...`). Its option types and categories seed onto the product and its custom field definitions drive the product form. Editing the type later never rewrites existing products.","nullable":true},"delivery_profile_id":{"type":"string","description":"The delivery profile deciding how this product ships (`fp_...`); null falls back to the store default.","nullable":true},"promotionable":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"},"description":"Manual collections this product belongs to. Automatic collections are kept as they are, since their rules decide membership."},"metadata":{"type":"object","additionalProperties":true},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceParams"},"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. Don't pass both."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."},"media":{"type":"array","items":{"$ref":"#/components/schemas/ProductMediaParams"},"description":"Media written with the product. Entries with `id` update an existing asset; entries with `signed_id` attach a fresh upload; an external video needs only its URL."},"digital_assets":{"type":"array","items":{"$ref":"#/components/schemas/ProductDigitalAssetParams"},"description":"Downloadable files written with the product. Each entry carries a `signed_id` (an upload to private storage) or a `provider_type` (a provider-backed asset), and attaches to the default variant unless `variant_id` is given. An `id` updates that asset in place, so replaying the list does not duplicate it; removal uses the nested digital assets endpoint."},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublicationParams"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariantParams"},"description":"Every purchasable attribute (sku, prices, stock, weight, dimensions) lives on variants. An entry without `options` upserts onto the default variant of a simple product; pass `id` to update an existing variant."}}},"ProductVariantParams":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"barcode":{"type":"string"},"cost_price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"cost_currency":{"type":"string"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"hs_code":{"type":"string"},"country_of_origin":{"type":"string"},"customs_description":{"type":"string"},"minimum_order_quantity":{"type":"integer","nullable":true},"order_multiple":{"type":"integer","nullable":true},"purchase_unit":{"type":"string"},"units_per_carton":{"type":"integer","description":"How many units fill one carton.","nullable":true},"carton_package_type_id":{"type":"string","description":"The carton this variant is packed into: a package type of kind `carton`. Its dimensions are shared by every product packed the same way, so a corrected carton size fixes all of them at once.","nullable":true},"carton_weight":{"type":"number","description":"What one packed carton weighs, in the variant's weight unit.","nullable":true},"cartons_per_pallet":{"type":"integer","description":"How many cartons stack on one pallet.","nullable":true},"seller_id":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"track_inventory":{"type":"boolean"},"preorderable":{"type":"boolean","description":"Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap comes from `backorder_limit`, an incoming stock count, or backorder."},"preorder_ships_at":{"type":"string","format":"date-time","description":"The \"ships by\" date shown to customers while the variant is a pre-order. Once it passes, the variant is no longer a pre-order. Null clears it.","nullable":true},"backorder_limit":{"type":"integer","description":"Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is unlimited.","nullable":true},"tax_category_id":{"type":"string"},"position":{"type":"integer"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceParams"},"description":"Per-currency prices. Upserted by currency."},"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevelParams"},"description":"Stock per location. Upserted by location; omitted locations are removed."},"options":{"type":"array","items":{"$ref":"#/components/schemas/VariantOptionParams"},"description":"One pair per option type the variant takes part in (size, color). Option types and values are created when missing."}}},"PromotionActionCalculatorParams":{"type":"object","properties":{"type":{"type":"string","description":"The calculator kind, from `GET /promotion_actions/calculators`. Changing it swaps the calculator."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the calculator's settings, such as `amount` or `flat_percent`."}}},"PromotionActionCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"The action kind, from `GET /promotion_actions/types`."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the action kind's settings schema, from `GET /promotion_actions/types`."},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculatorParams"}],"description":"For adjustment actions."},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItemParams"},"description":"For `create_line_items`: the variants to add and their quantities. Variants left out are removed."}},"required":["type"]},"PromotionActionDraftParams":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"The action kind, from `GET /promotion_actions/types`."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the action kind's settings schema, from `GET /promotion_actions/types`."},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculatorParams"}],"description":"For adjustment actions."},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItemParams"},"description":"For `create_line_items`: the variants to add and their quantities. Variants left out are removed."}},"required":["type"]},"PromotionActionLineItemParams":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"PromotionActionUpdateParams":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true,"description":"Values for the action kind's settings schema, from `GET /promotion_actions/types`."},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculatorParams"}],"description":"For adjustment actions."},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItemParams"},"description":"For `create_line_items`: the variants to add and their quantities. Variants left out are removed."}}},"PromotionCreateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","description":"Required for single-code coupon promotions. Ignored when `multi_codes` is true.","nullable":true},"path":{"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"],"description":"`coupon_code` needs a code (or `multi_codes`); `automatic` applies without one."},"multi_codes":{"type":"boolean","description":"Generates `number_of_codes` codes starting with `code_prefix`."},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PromotionRuleDraftParams"},"description":"The rules the promotion should have: entries with `id` update, entries without are created, and rules left out are removed."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionDraftParams"},"description":"The actions the promotion should have, matched the same way as `rules`."}},"required":["name"]},"PromotionRuleCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"The rule kind, from `GET /promotion_rules/types`."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's settings schema, from `GET /promotion_rules/types`."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For the `product` rule."},"category_ids":{"type":"array","items":{"type":"string"},"description":"For the `category` rule."},"customer_ids":{"type":"array","items":{"type":"string"},"description":"For the `user` rule: the customers who qualify."}},"required":["type"]},"PromotionRuleDraftParams":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"The rule kind, from `GET /promotion_rules/types`."},"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's settings schema, from `GET /promotion_rules/types`."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For the `product` rule."},"category_ids":{"type":"array","items":{"type":"string"},"description":"For the `category` rule."},"customer_ids":{"type":"array","items":{"type":"string"},"description":"For the `user` rule: the customers who qualify."}},"required":["type"]},"PromotionRuleUpdateParams":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true,"description":"Values for the rule kind's settings schema, from `GET /promotion_rules/types`."},"product_ids":{"type":"array","items":{"type":"string"},"description":"For the `product` rule."},"category_ids":{"type":"array","items":{"type":"string"},"description":"For the `category` rule."},"customer_ids":{"type":"array","items":{"type":"string"},"description":"For the `user` rule: the customers who qualify."}}},"PromotionUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","description":"Required for single-code coupon promotions. Ignored when `multi_codes` is true.","nullable":true},"path":{"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"],"description":"`coupon_code` needs a code (or `multi_codes`); `automatic` applies without one."},"multi_codes":{"type":"boolean","description":"Generates `number_of_codes` codes starting with `code_prefix`."},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"$ref":"#/components/schemas/PromotionRuleDraftParams"},"description":"The rules the promotion should have: entries with `id` update, entries without are created, and rules left out are removed."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionDraftParams"},"description":"The actions the promotion should have, matched the same way as `rules`."}}},"PurchaseOrderCancelParams":{"type":"object","properties":{"reason":{"type":"string","description":"Appended to the order's notes."}}},"PurchaseOrderCreateParams":{"type":"object","properties":{"supplier_id":{"type":"string"},"destination_location_id":{"type":"string"},"currency":{"type":"string","description":"Defaults to the store's currency; set it for a foreign-currency order.","nullable":true},"expected_at":{"type":"string","format":"date","description":"The day the supplier promised. `null` clears it.","nullable":true},"cancel_by":{"type":"string","format":"date","description":"The day after which the goods are no longer wanted. `null` clears it.","nullable":true},"reference":{"type":"string","description":"The supplier's own order number. `null` clears it.","nullable":true},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemParams"},"description":"Sending the list replaces whatever the order currently holds."}},"required":["supplier_id","destination_location_id"]},"PurchaseOrderItemParams":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity_ordered":{"type":"integer"},"unit_cost":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"What the merchant agreed to pay per unit."}},"required":["variant_id","quantity_ordered"]},"PurchaseOrderUpdateParams":{"type":"object","properties":{"supplier_id":{"type":"string"},"destination_location_id":{"type":"string"},"currency":{"type":"string","description":"Defaults to the store's currency; set it for a foreign-currency order.","nullable":true},"expected_at":{"type":"string","format":"date","description":"The day the supplier promised. `null` clears it.","nullable":true},"cancel_by":{"type":"string","format":"date","description":"The day after which the goods are no longer wanted. `null` clears it.","nullable":true},"reference":{"type":"string","description":"The supplier's own order number. `null` clears it.","nullable":true},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemParams"},"description":"Sending the list replaces whatever the order currently holds."},"metadata":{"type":"object","additionalProperties":true,"nullable":true}}},"ReasonCreateParams":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"Whether the reason is offered on new records."}},"required":["name"]},"ReasonUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean","description":"Whether the reason is offered on new records."}}},"ReceivableCloseParams":{"type":"object","properties":{"reason":{"type":"string","description":"Why the balance is not coming.","nullable":true}}},"RefundCreateParams":{"type":"object","properties":{"payment_id":{"type":"string"},"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$"},"refund_reason_id":{"type":"string","description":"Defaults to the store's first refund reason."}},"required":["payment_id","amount"]},"ReportingQueryParams":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"string"},"description":"Registered metric names, from the reporting schema endpoint."},"dimensions":{"type":"array","items":{},"description":"Up to 2 dimensions to break the metrics down by. Each is a dimension name, or `{ name, grain, include_empty }`: `grain` (`hour`, `day`, `week`, `month`) buckets a time dimension, and `include_empty` lists members with no matching rows where the schema entry supports it."},"filters":{"type":"array","items":{"type":"object","properties":{"dimension":{"type":"string"},"op":{"type":"string","enum":["eq","in"]},"value":{"description":"One value for `eq`, a list for `in`."}},"required":["dimension","op","value"]},"description":"Narrows the rows by dimension value."},"metric_filters":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string"},"op":{"type":"string","enum":["eq","gt","gte","lt","lte"]},"value":{"type":"number"}},"required":["metric","op","value"]},"description":"Filters on an aggregate, such as `units_sold = 0`. Narrows the rows only; the totals stay the period's real figure. The metric must also appear in `metrics`, and cannot be a derived one."},"time_range":{"type":"object","properties":{"preset":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"description":"A named preset (`last_month`, `week_to_date`, any `last_<n>_<days|weeks|months>`), or ISO 8601 dates or times in `since` and `until` (a bare date covers the store's whole day). Defaults to the last 30 days, in the store's time zone."},"compare":{"type":"string","enum":["previous_period","previous_year"]},"sort":{"type":"string","description":"A metric name; prefix it with `-` to sort descending."},"limit":{"type":"integer","description":"At most 1000."},"currency":{"type":"string"}},"required":["metrics"]},"ReturnCancelParams":{"type":"object","properties":{"reason":{"type":"string","description":"A note on why the return was canceled."}}},"ReturnCreateParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"fulfillment_item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["fulfillment_item_id","quantity"]},"description":"Fulfilled units coming back, and how many of each."},"stock_location_id":{"type":"string","description":"Where the goods come back to. Defaults to the location that shipped them."},"reason_id":{"type":"string","description":"One of the store's return reasons."},"memo":{"type":"string"}},"required":["items"]},"ReturnReceiveParams":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"return_line_item_id":{"type":"string"},"quantity":{"type":"integer"},"resellable":{"type":"boolean","description":"Goods that cannot be resold are received but never restocked. Defaults to true."}},"required":["return_line_item_id","quantity"]},"description":"What actually arrived. Omit to receive everything as requested and resellable; send rows for a partial or damaged receipt."}}},"ReturnRefundParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Defaults to the value of what was actually received."},"refund_method":{"type":"string","enum":["original_payment","store_credit"],"description":"`store_credit` issues credit immediately; `original_payment` (the default) refunds through the gateway that took the money."}}},"ReturnUpdateParams":{"type":"object","properties":{"stock_location_id":{"type":"string","description":"Where the goods come back to. Defaults to the location that shipped them."},"reason_id":{"type":"string","description":"One of the store's return reasons."},"memo":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"RoleCreateParams":{"type":"object","properties":{"name":{"type":"string","description":"Unique role name, the machine identifier shown capitalized in the dashboard."},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"},"description":"Permission keys (`read_orders`, `write_products`, ...) from the permissions endpoint. You can only grant keys you hold yourself."}},"required":["name"]},"RoleUpdateParams":{"type":"object","properties":{"name":{"type":"string","description":"Unique role name, the machine identifier shown capitalized in the dashboard."},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"},"description":"Permission keys (`read_orders`, `write_products`, ...) from the permissions endpoint. You can only grant keys you hold yourself."}}},"SavedReportCreateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"query":{"type":"object","additionalProperties":true,"description":"A reporting query, validated against the reporting registry on save."}},"required":["name","query"]},"SavedReportUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"query":{"type":"object","additionalProperties":true,"description":"A reporting query, validated against the reporting registry on save."}}},"SellerAddressParams":{"type":"object","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"},"zipcode":{"type":"string"},"phone":{"type":"string"},"country_code":{"type":"string"},"state_code":{"type":"string"},"state_name":{"type":"string"},"label":{"type":"string"}}},"SellerApproveParams":{"type":"object","properties":{"override_requirements":{"type":"boolean","description":"Admits a seller whose onboarding checklist is unfinished: the operator's deliberate exception, which the `seller.approved` event records along with what was outstanding."}}},"SellerCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"slug":{"type":"string","description":"URL-safe slug, derived from the name when omitted."},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"about":{"type":"string","description":"Sanitized HTML: the seller's public description.","nullable":true},"logo_signed_id":{"type":"string","description":"A `signed_id` from the files upload endpoint to set the image, `null` to remove it, or omit the key to leave it untouched. The same applies to `square_logo_signed_id` and `cover_photo_signed_id`.","nullable":true},"square_logo_signed_id":{"type":"string","nullable":true},"cover_photo_signed_id":{"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","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"holiday_mode_until":{"type":"string","format":"date-time","description":"Set while the seller is away: the catalog stays but stops selling.","nullable":true},"legal_name":{"type":"string","nullable":true},"registration_number":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true},"billing_address":{"allOf":[{"$ref":"#/components/schemas/SellerAddressParams"}],"description":"The seller's own billing 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."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}},"required":["name"]},"SellerInviteParams":{"type":"object","properties":{"email":{"type":"string"},"role_id":{"type":"string","description":"A role this seller owns; defaults to the seller's own admin role.","nullable":true}},"required":["email"]},"SellerPayoutCompleteParams":{"type":"object","properties":{"reference":{"type":"string","description":"The provider's own id for the settlement, when one made it."}}},"SellerRejectParams":{"type":"object","properties":{"reason":{"type":"string"}}},"SellerReopenOnboardingParams":{"type":"object","properties":{"note":{"type":"string","description":"What the seller has to fix."}}},"SellerRequirementCreateParams":{"type":"object","properties":{"type":{"type":"string","description":"The kind, from the seller requirement types endpoint."},"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."},"position":{"type":"integer","description":"Place in the checklist."},"active":{"type":"boolean"},"required":{"type":"boolean","description":"Whether this blocks approval. Off means recommended."},"preferences":{"type":"object","additionalProperties":true,"description":"Configuration for this kind, per its type's `schema`."},"metadata":{"type":"object","additionalProperties":true},"custom_field_definition_ids":{"type":"array","items":{"type":"string"},"description":"Custom field definitions this requirement asks the seller to fill in (`required_custom_fields` kind)."}},"required":["type"]},"SellerRequirementReviewParams":{"type":"object","properties":{"review_note":{"type":"string","description":"Kept with the decision. On a rejection it is the reason sent back to the seller."}}},"SellerRequirementUpdateParams":{"type":"object","properties":{"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."},"position":{"type":"integer","description":"Place in the checklist."},"active":{"type":"boolean"},"required":{"type":"boolean","description":"Whether this blocks approval. Off means recommended."},"preferences":{"type":"object","additionalProperties":true,"description":"Configuration for this kind, per its type's `schema`."},"metadata":{"type":"object","additionalProperties":true},"custom_field_definition_ids":{"type":"array","items":{"type":"string"},"description":"Custom field definitions this requirement asks the seller to fill in (`required_custom_fields` kind)."}}},"SellerRequirementWaiveParams":{"type":"object","properties":{"requirement_id":{"type":"string","description":"The requirement the seller is excused from."},"review_note":{"type":"string","description":"Why the seller is excused. Kept with the decision."}},"required":["requirement_id"]},"SellerSuspendParams":{"type":"object","properties":{"reason":{"type":"string"}}},"SellerUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"slug":{"type":"string","description":"URL-safe slug, derived from the name when omitted."},"contact_email":{"type":"string","nullable":true},"billing_email":{"type":"string","nullable":true},"about":{"type":"string","description":"Sanitized HTML: the seller's public description.","nullable":true},"logo_signed_id":{"type":"string","description":"A `signed_id` from the files upload endpoint to set the image, `null` to remove it, or omit the key to leave it untouched. The same applies to `square_logo_signed_id` and `cover_photo_signed_id`.","nullable":true},"square_logo_signed_id":{"type":"string","nullable":true},"cover_photo_signed_id":{"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","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"holiday_mode_until":{"type":"string","format":"date-time","description":"Set while the seller is away: the catalog stays but stops selling.","nullable":true},"legal_name":{"type":"string","nullable":true},"registration_number":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true},"billing_address":{"allOf":[{"$ref":"#/components/schemas/SellerAddressParams"}],"description":"The seller's own billing 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."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueParams"},"description":"Custom field values, each validated against its definition."}}},"SetupParams":{"type":"object","properties":{"setup_token":{"type":"string","description":"The 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. It 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."},"sample_data":{"type":"boolean","description":"Load the demo catalog, customers and orders in the background once the admin account exists. The load takes minutes, so the response does not wait for it."}},"required":["setup_token","email","password","country_code"]},"ShippingLabelCreateParams":{"type":"object","properties":{"file_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()`. Its presence records a label bought elsewhere instead of buying one; without it the body is ignored and the label is bought through the carrier."},"tracking_number":{"type":"string","description":"The number printed on an uploaded label. Required with `file_signed_id`."},"carrier":{"type":"string","description":"Free text; a forwarder's name is as valid as a carrier slug. Detected from the number when omitted."},"service":{"type":"string","description":"Carrier service the label was bought at."},"cost":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"What the merchant paid the carrier. Accounting data only; it never touches the order's shipping charge."},"currency":{"type":"string","description":"Currency of the cost."},"file_format":{"type":"string","enum":["pdf","png","zpl"],"description":"Taken from the file when omitted."},"tracking_url":{"type":"string","description":"Tracking page for the consignment the label mints."}}},"StockLevelBulkUpsertParams":{"type":"object","properties":{"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevelBulkUpsertRowParams"},"description":"Send an empty list to change nothing."}},"required":["stock_levels"]},"StockLevelBulkUpsertRowParams":{"type":"object","properties":{"variant_id":{"type":"string"},"stock_location_id":{"type":"string"},"count_on_hand":{"type":"integer","description":"The absolute level the external system reports.","nullable":true},"adjustment":{"type":"integer","description":"A relative change, for feeds that report movements rather than levels. Each row needs `count_on_hand` or `adjustment`.","nullable":true},"backorderable":{"type":"boolean","nullable":true}},"required":["variant_id","stock_location_id"]},"StockLevelParams":{"type":"object","properties":{"id":{"type":"string"},"stock_location_id":{"type":"string","description":"The location holding the stock (`sloc_...`)."},"count_on_hand":{"type":"integer","description":"Units physically at the location, not units available to sell: stock promised to placed orders counts until it ships. Sent as the count the shelf should end at; the API records the difference as an adjustment in the stock history."},"backorderable":{"type":"boolean","description":"Whether this location sells the variant beyond what it holds."}},"required":["stock_location_id","count_on_hand"]},"StockLevelUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"count_on_hand":{"type":"integer","description":"The count the shelf should end at: a whole number of zero or more. The API records the difference as an `adjusted` movement, so the correction appears in the stock history."},"adjustment":{"type":"integer","description":"A signed change to the shelf instead of a target count, applied to the count the API holds at that moment and recorded the same way. Cannot be sent together with `count_on_hand`."},"backorderable":{"type":"boolean","description":"Whether this location sells the variant beyond what it holds."},"reason":{"type":"string","description":"Labels the correction in the stock history. Defaults to \"Manual adjustment\"."},"metadata":{"type":"object","additionalProperties":true}}},"StockLocationCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"admin_name":{"type":"string","description":"Internal name shown only in the admin.","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","description":"Categorizes the location. Built-in values: `warehouse`, `store`, `fulfillment_center`; extensions may add their own."},"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","description":"ISO-3166 alpha-2 country code.","nullable":true},"state_code":{"type":"string","description":"State or province abbreviation, resolved against the selected country's states.","nullable":true},"state_name":{"type":"string","description":"Free-text state for countries that don't have a states list.","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"`local` collects only items at this location; `any` lets items transfer in from other locations (ship-to-store)."},"pickup_ready_in_minutes":{"type":"integer","nullable":true},"returns_enabled":{"type":"boolean","description":"Whether customers may send returns to this location."},"pickup_instructions":{"type":"string","nullable":true}},"required":["name"]},"StockLocationUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"name":{"type":"string"},"admin_name":{"type":"string","description":"Internal name shown only in the admin.","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","description":"Categorizes the location. Built-in values: `warehouse`, `store`, `fulfillment_center`; extensions may add their own."},"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","description":"ISO-3166 alpha-2 country code.","nullable":true},"state_code":{"type":"string","description":"State or province abbreviation, resolved against the selected country's states.","nullable":true},"state_name":{"type":"string","description":"Free-text state for countries that don't have a states list.","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"`local` collects only items at this location; `any` lets items transfer in from other locations (ship-to-store)."},"pickup_ready_in_minutes":{"type":"integer","nullable":true},"returns_enabled":{"type":"boolean","description":"Whether customers may send returns to this location."},"pickup_instructions":{"type":"string","nullable":true}}},"StockReceiptCreateParams":{"type":"object","properties":{"reference":{"type":"string","description":"The supplier's delivery note, or the carrier's reference.","nullable":true},"received_at":{"type":"string","format":"date-time","description":"When the goods were counted in. Defaults to now.","nullable":true},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockReceiptItemParams"},"description":"Omit to book in everything still outstanding, intact. Naming lines, even none, records exactly what the dock counted: `quantity_accepted` reaches the shelf; `quantity_rejected` is refused, recorded with a `rejection_reason` and never stocked."}}},"StockReceiptItemParams":{"type":"object","properties":{"id":{"type":"string","description":"The purchase order or transfer line."},"quantity_accepted":{"type":"integer"},"quantity_rejected":{"type":"integer"},"rejection_reason":{"type":"string","enum":["damaged","wrong_item","expired","other"],"nullable":true},"notes":{"type":"string","nullable":true}},"required":["id"]},"StockTransferCancelParams":{"type":"object","properties":{"on_in_transit":{"type":"string","enum":["restock","write_off"],"description":"Required once the units have left the source: either they come back (`restock`) or they are written off as lost (`write_off`)."},"reason":{"type":"string","description":"Recorded against the written-off lines.","nullable":true}}},"StockTransferCreateParams":{"type":"object","properties":{"source_location_id":{"type":"string"},"destination_location_id":{"type":"string"},"reference":{"type":"string","description":"The merchant's own label for the trip. `null` clears it.","nullable":true},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItemParams"},"description":"A draft may open empty and gain lines as the merchant packs. Sending the list replaces whatever the draft currently holds."}},"required":["source_location_id","destination_location_id"]},"StockTransferItemParams":{"type":"object","properties":{"variant_id":{"type":"string"},"quantity_shipped":{"type":"integer"}},"required":["variant_id","quantity_shipped"]},"StockTransferMarkInTransitParams":{"type":"object","properties":{"force":{"type":"boolean","description":"Ship even if it drives the source below zero."}}},"StockTransferUpdateParams":{"type":"object","properties":{"source_location_id":{"type":"string"},"destination_location_id":{"type":"string"},"reference":{"type":"string","description":"The merchant's own label for the trip. `null` clears it.","nullable":true},"notes":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockTransferItemParams"},"description":"A draft may open empty and gain lines as the merchant packs. Sending the list replaces whatever the draft currently holds."},"metadata":{"type":"object","additionalProperties":true,"nullable":true}}},"StoreCreditApplyParams":{"type":"object","properties":{"amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Defaults to the customer's available store credit, up to the order total."}}},"StoreUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"admin_locale":{"type":"string"},"timezone":{"type":"string"},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"unit_system":{"type":"string","enum":["metric","imperial"]},"storefront_access":{"type":"string","enum":["public","prices_hidden","login_required"],"description":"The store-wide default for what anonymous visitors can see. Channels fall back to it when they don't set their own."},"storefront_url":{"type":"string","description":"The storefront's public URL, the base for links in customer emails. Saving it also completes the storefront setup task.","nullable":true},"guest_checkout":{"type":"boolean","description":"The store-wide default for guest checkout. Channels fall back to it."},"always_include_confirm_step":{"type":"boolean","description":"Always show a confirmation step in checkout, even when no payment method requires one."},"company_field_enabled":{"type":"boolean","description":"Shows a company field on address forms."},"address_requires_company":{"type":"boolean","description":"Makes a company name mandatory on addresses."},"address_requires_phone":{"type":"boolean","description":"Makes a phone number mandatory on customer addresses."},"capture_method":{"type":"string","enum":["checkout","on_dispatch","manual"],"description":"The store-wide default for when a customer is charged rather than only authorized. A payment method's own setting wins when set."},"preferred_auto_capture":{"type":"boolean","description":"Deprecated: use `capture_method`. Removed in 6.1."},"preferred_auto_capture_on_dispatch":{"type":"boolean","description":"Deprecated: use `capture_method`. Removed in 6.1."},"track_inventory_levels":{"type":"boolean","description":"Counts on-hand quantities. Off means everything is treated as always available."},"stock_reservations_enabled":{"type":"boolean","description":"Holds stock for shoppers while they check out, so the same item can't be sold twice."},"low_stock_threshold":{"type":"integer","description":"On-hand units at or below which a tracked variant counts as low stock on the home screen; 0 turns the warning off."},"tax_using_ship_address":{"type":"boolean","description":"Calculates tax from the shipping address. When false, tax is calculated from the billing address."},"track_price_history":{"type":"boolean","description":"Records price changes for the EU Omnibus lowest-price-in-30-days display."},"show_products_without_price":{"type":"boolean","description":"Whether products with no price in the shopper's currency still appear in listings."},"disable_sku_validation":{"type":"boolean","description":"Lets more than one variant share the same SKU."},"order_routing_strategy":{"type":"string","description":"The store-wide order routing strategy shorthand. Channels fall back to it."},"pricing_provider":{"type":"string","description":"Where prices come from: a registered provider key, or `internal`."},"inventory_provider":{"type":"string","description":"Where stock levels come from: a registered provider key, or `internal`."},"pricing_provider_failure_policy":{"type":"string","enum":["fallback","strict"],"description":"`strict` refuses to price when the provider cannot answer; `fallback` uses the catalog."},"inventory_provider_failure_policy":{"type":"string","enum":["fallback","strict"],"description":"`fallback` sells on the local stock snapshot when the provider cannot answer; `strict` refuses."},"payout_provider":{"type":"string","description":"Blank means the built-in provider: the marketplace settles by hand."},"default_payouts_schedule_interval":{"type":"string","enum":["daily","weekly","biweekly","monthly","manual"]},"default_minimum_payout_amount":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"In the store's currency."},"auto_approve_sellers":{"type":"boolean","description":"Admits a seller as soon as they finish onboarding, with no operator review."},"auto_approve_seller_products":{"type":"boolean","description":"Puts a seller product on sale the moment it is submitted, with no review."},"send_seller_transactional_emails":{"type":"boolean","description":"When false, transactional seller emails (approval, payouts and so on) are not sent."},"default_commission_tax_rate":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"Tax charged on commission as a fraction (`\"0.23\"` is 23%), when neither the commission rate nor the tax provider names one."},"document_number_format":{"type":"string","description":"How document numbers are produced: `sequential` or `random`. Applies to every numbered document."},"order_number_prefix":{"type":"string","description":"Leads every order number. Uppercase letters, digits, dashes and # only."},"order_number_suffix":{"type":"string","description":"Ends every order number. Uppercase letters, digits, dashes and # only."},"order_number_sequence_start":{"type":"integer","description":"The first sequential order number. Only applies before the store's first order."},"limit_digital_download_count":{"type":"boolean","description":"Whether a digital download link stops working after a number of clicks."},"digital_asset_authorized_clicks":{"type":"integer","description":"How many clicks a download link allows, unless the file sets its own."},"limit_digital_download_days":{"type":"boolean","description":"Whether a digital download link expires after a number of days."},"digital_asset_authorized_days":{"type":"integer","description":"How many days a download link stays valid, unless the file sets its own."},"mail_from_address":{"type":"string","description":"Sender address of every transactional email."},"customer_support_email":{"type":"string","description":"Customer-facing reply-to address shown in the storefront and email footers.","nullable":true},"new_order_notifications_email":{"type":"string","description":"Recipient of \"new order placed\" staff notifications.","nullable":true},"send_consumer_transactional_emails":{"type":"boolean","description":"When false, transactional customer emails (order confirmation and so on) are not sent."},"email_accent_color":{"type":"string","description":"Customer email buttons and links, as `#RRGGBB`. Blank keeps the outlined buttons emails ship with.","nullable":true},"email_background_color":{"type":"string","description":"Customer email page background, as `#RRGGBB`.","nullable":true},"email_card_color":{"type":"string","description":"Customer email card behind the content, as `#RRGGBB`.","nullable":true},"email_text_color":{"type":"string","description":"Customer email body text, as `#RRGGBB`.","nullable":true},"email_heading_color":{"type":"string","description":"Customer email headings and emphasized text, as `#RRGGBB`.","nullable":true},"email_font":{"type":"string","description":"Customer email font: `inter`, `system`, `helvetica`, `georgia`, `roboto`, `lato` or `merriweather`.","nullable":true},"logo_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the store logo, or null to remove it.","nullable":true},"mailer_logo_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` for the logo in transactional emails, or null to remove it.","nullable":true}}},"SupplierCreateParams":{"type":"object","properties":{"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true,"nullable":true}},"required":["name"]},"SupplierUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"contact_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"state_code":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":true,"nullable":true}}},"TaxCategoryCreateParams":{"type":"object","properties":{"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"}},"required":["name"]},"TaxCategoryUpdateParams":{"type":"object","properties":{"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"}}},"TaxExemptionCertificateParams":{"type":"object","properties":{"certificate_number":{"type":"string","description":"Required when creating."},"reason_code":{"type":"string","description":"Becomes the tax provider's entity use code. Required when creating."},"issuing_authority":{"type":"string","nullable":true},"issued_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"country_code":{"type":"string","description":"Where the certificate holds. Omit both for one valid everywhere.","nullable":true},"state_code":{"type":"string","description":"Where the certificate holds. Omit both for one valid everywhere.","nullable":true},"document_signed_id":{"type":"string","description":"A `signed_id` from `files.upload()` with `visibility: 'private'`."},"metadata":{"type":"object","additionalProperties":true}}},"TaxIdentifierParams":{"type":"object","properties":{"kind":{"type":"string","description":"The registration the number belongs to, such as `eu_vat` or `gb_vat`. Any kind is accepted; one with a registered validator is checked by it. Built-in: `eu_vat`. Extensions may register more. Required when creating."},"value":{"type":"string","description":"Required when creating."}}},"TaxRateParams":{"type":"object","properties":{"name":{"type":"string","description":"Customer-facing rate name."},"rate":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"The rate as a fraction. Send this or `rate_percent`."},"rate_percent":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","description":"The rate as a percentage."},"included_in_price":{"type":"boolean"},"show_rate_in_label":{"type":"boolean"},"tax_category_id":{"type":"string"},"country_code":{"type":"string","description":"ISO country code. A rate naming no country taxes everywhere.","nullable":true},"state_code":{"type":"string","description":"State abbreviation within that country.","nullable":true},"metadata":{"type":"object","additionalProperties":true}}},"TranslationBatchEntryParams":{"type":"object","properties":{"resource_type":{"type":"string","description":"Translatable resource type token, e.g. `option_type`."},"resource_id":{"type":"string"},"values":{"type":"object","additionalProperties":true,"description":"Translated fields keyed by locale code, then by field name."}},"required":["resource_type","resource_id","values"]},"TranslationBatchParams":{"type":"object","properties":{"translations":{"type":"array","items":{"$ref":"#/components/schemas/TranslationBatchEntryParams"},"description":"At least one entry. All entries are saved, or none are."}},"required":["translations"]},"VariantCreateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"sku":{"type":"string"},"barcode":{"type":"string"},"cost_price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"cost_currency":{"type":"string"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"hs_code":{"type":"string"},"country_of_origin":{"type":"string"},"customs_description":{"type":"string"},"minimum_order_quantity":{"type":"integer","nullable":true},"order_multiple":{"type":"integer","nullable":true},"purchase_unit":{"type":"string"},"units_per_carton":{"type":"integer","description":"How many units fill one carton.","nullable":true},"carton_package_type_id":{"type":"string","description":"The carton this variant is packed into: a package type of kind `carton`. Its dimensions are shared by every product packed the same way, so a corrected carton size fixes all of them at once.","nullable":true},"carton_weight":{"type":"number","description":"What one packed carton weighs, in the variant's weight unit.","nullable":true},"cartons_per_pallet":{"type":"integer","description":"How many cartons stack on one pallet.","nullable":true},"seller_id":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"track_inventory":{"type":"boolean"},"preorderable":{"type":"boolean","description":"Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap comes from `backorder_limit`, an incoming stock count, or backorder."},"preorder_ships_at":{"type":"string","format":"date-time","description":"The \"ships by\" date shown to customers while the variant is a pre-order. Once it passes, the variant is no longer a pre-order. Null clears it.","nullable":true},"backorder_limit":{"type":"integer","description":"Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is unlimited.","nullable":true},"tax_category_id":{"type":"string"},"position":{"type":"integer"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceParams"},"description":"Per-currency prices. Upserted by currency."},"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevelParams"},"description":"Stock per location. Upserted by location; omitted locations are removed."},"options":{"type":"array","items":{"$ref":"#/components/schemas/VariantOptionParams"},"description":"One pair per option type the variant takes part in (size, color). Option types and values are created when missing. On update, omit to leave the option values untouched."}},"required":["options"]},"VariantOptionParams":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"VariantUpdateParams":{"type":"object","properties":{"external_references":{"type":"object","additionalProperties":true,"description":"Identities the record has in external systems, keyed by system: the same `{ system: external_id }` map the Admin API renders, so what you read can be sent straight back. Systems you do not name keep the reference they have. A list of `{ system, external_id }` entries is accepted too."},"sku":{"type":"string"},"barcode":{"type":"string"},"cost_price":{"type":"string","format":"decimal","pattern":"^-?\\d+(\\.\\d+)?$","nullable":true},"cost_currency":{"type":"string"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"weight_unit":{"type":"string","enum":["g","kg","lb","oz"]},"dimensions_unit":{"type":"string","enum":["mm","cm","in","ft"]},"hs_code":{"type":"string"},"country_of_origin":{"type":"string"},"customs_description":{"type":"string"},"minimum_order_quantity":{"type":"integer","nullable":true},"order_multiple":{"type":"integer","nullable":true},"purchase_unit":{"type":"string"},"units_per_carton":{"type":"integer","description":"How many units fill one carton.","nullable":true},"carton_package_type_id":{"type":"string","description":"The carton this variant is packed into: a package type of kind `carton`. Its dimensions are shared by every product packed the same way, so a corrected carton size fixes all of them at once.","nullable":true},"carton_weight":{"type":"number","description":"What one packed carton weighs, in the variant's weight unit.","nullable":true},"cartons_per_pallet":{"type":"integer","description":"How many cartons stack on one pallet.","nullable":true},"seller_id":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"track_inventory":{"type":"boolean"},"preorderable":{"type":"boolean","description":"Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap comes from `backorder_limit`, an incoming stock count, or backorder."},"preorder_ships_at":{"type":"string","format":"date-time","description":"The \"ships by\" date shown to customers while the variant is a pre-order. Once it passes, the variant is no longer a pre-order. Null clears it.","nullable":true},"backorder_limit":{"type":"integer","description":"Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is unlimited.","nullable":true},"tax_category_id":{"type":"string"},"position":{"type":"integer"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceParams"},"description":"Per-currency prices. Upserted by currency."},"stock_levels":{"type":"array","items":{"$ref":"#/components/schemas/StockLevelParams"},"description":"Stock per location. Upserted by location; omitted locations are removed."},"options":{"type":"array","items":{"$ref":"#/components/schemas/VariantOptionParams"},"description":"One pair per option type the variant takes part in (size, color). Option types and values are created when missing. On update, omit to leave the option values untouched."}}},"WebhookEndpointCreateParams":{"type":"object","properties":{"name":{"type":"string","description":"A label shown in the dashboard list.","nullable":true},"url":{"type":"string","description":"HTTPS destination URL. It cannot resolve to a private IP address outside development."},"active":{"type":"boolean","description":"Defaults to true on create. Prefer the disable and enable endpoints to pause one."},"subscriptions":{"type":"array","items":{"type":"string"},"description":"Event names this endpoint receives. An empty list or `[\"*\"]` subscribes to every event; otherwise list exact names (`order.completed`) or patterns (`order.*`)."}},"required":["url"]},"WebhookEndpointDisableParams":{"type":"object","properties":{"reason":{"type":"string","description":"Shown next to the disabled indicator. Defaults to \"Manually disabled\"."}}},"WebhookEndpointUpdateParams":{"type":"object","properties":{"name":{"type":"string","description":"A label shown in the dashboard list.","nullable":true},"url":{"type":"string","description":"HTTPS destination URL. It cannot resolve to a private IP address outside development."},"active":{"type":"boolean","description":"Defaults to true on create. Prefer the disable and enable endpoints to pause one."},"subscriptions":{"type":"array","items":{"type":"string"},"description":"Event names this endpoint receives. An empty list or `[\"*\"]` subscribes to every event; otherwise list exact names (`order.completed`) or patterns (`order.*`)."}}}}}}\ No newline at end of filediff --git a/packages/dashboard/src/components/spree/bulk-price-editor/bulk-price-editor.tsx b/packages/dashboard/src/components/spree/bulk-price-editor/bulk-price-editor.tsxindex 1540f5f913..428471d623 100644--- a/packages/dashboard/src/components/spree/bulk-price-editor/bulk-price-editor.tsx+++ b/packages/dashboard/src/components/spree/bulk-price-editor/bulk-price-editor.tsx@@ -1,4 +1,4 @@-import type { PriceBulkUpsertRow } from '@spree/admin-sdk'+import type { PriceBulkUpsertRowParams } from '@spree/admin-sdk'import {adminClient,currencyParts,@@ -624,9 +624,9 @@ export function BulkPriceEditor({// — that's what the server upserts on. `id` is not used by the bulk// endpoint; we already have the lookup columns on screen so there's// no point making the server backfill them.- const payload: PriceBulkUpsertRow[] = savedKeys.flatMap((priceId) => {+ const payload: PriceBulkUpsertRowParams[] = savedKeys.flatMap((priceId) => {const edit = edits.get(priceId) as CellEdit- const row: PriceBulkUpsertRow = {+ const row: PriceBulkUpsertRowParams = {variant_id: edit.variantId,currency,...(priceListId ? { price_list_id: priceListId } : {}),diff --git a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsxindex 5b24bc8b51..e48ce510d3 100644--- a/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx+++ b/packages/dashboard/src/components/spree/orders/order-adjustments-cards.tsx@@ -2,6 +2,7 @@ import {compareMoney,type Discount,type Fee,+ type FeeCreateParams,isDecimalString,isZeroMoney,type Order,@@ -573,12 +574,10 @@ function AddFeeDialog({const { t } = useTranslation()const orderId = order.idconst [target, setTarget] = useState('order')- const [kind, setKind] = useState<string>('surcharge')+ const [kind, setKind] = useState<(typeof FEE_KINDS)[number]>('surcharge')- const mutation = useOrderAdjustmentLinesMutation(- orderId,- (params: { label: string; amount: string; kind?: string; line_item_id?: string }) =>- adminClient.orders.fees.create(orderId, params),+ const mutation = useOrderAdjustmentLinesMutation(orderId, (params: FeeCreateParams) =>+ adminClient.orders.fees.create(orderId, params),)const targetOptions = [@@ -648,7 +647,7 @@ function AddFeeDialog({<Selectitems={kindOptions}value={kind}- onValueChange={(v) => setKind(v as string)}+ onValueChange={(v) => setKind(v as (typeof FEE_KINDS)[number])}><SelectTrigger><SelectValue />diff --git a/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx b/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsxindex 47f709fd9b..59bf07089c 100644--- a/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx+++ b/packages/dashboard/src/components/spree/promotion-editors/promotion-form.tsx@@ -3,9 +3,9 @@ import type {Customer,Promotion,PromotionAction,- PromotionActionDraft,+ PromotionActionDraftParams,PromotionRule,- PromotionRuleDraft,+ PromotionRuleDraftParams,ResourceTypeDefinition,} from '@spree/admin-sdk'import { Can, PageHeader, PreferencesForm, StoreDatePicker } from '@spree/dashboard-core'@@ -126,8 +126,8 @@ export interface PromotionFormPayload {expires_at: string | nullusage_limit: number | nullmatch_policy: MatchPolicy- rules: PromotionRuleDraft[]- actions: PromotionActionDraft[]+ rules: PromotionRuleDraftParams[]+ actions: PromotionActionDraftParams[]/** Only sent in create mode — server rejects these on update. */kind?: PromotionKindcode?: string | nulldiff --git a/packages/dashboard/src/components/spree/promotion-editors/types.ts b/packages/dashboard/src/components/spree/promotion-editors/types.tsindex 98c5b88aa5..37b847e69e 100644--- a/packages/dashboard/src/components/spree/promotion-editors/types.ts+++ b/packages/dashboard/src/components/spree/promotion-editors/types.ts@@ -10,23 +10,23 @@ import type {Product,PromotionAction,PromotionActionCalculatorParams,- PromotionActionDraft,+ PromotionActionDraftParams,PromotionActionLineItemParams,PromotionRule,- PromotionRuleDraft,+ PromotionRuleDraftParams,} from '@spree/admin-sdk'import { defaultPreferences } from '@spree/dashboard-core'/*** Form-state row for a promotion rule: the payload fields the SDK ships on- * save (extends `PromotionRuleDraft`) plus display-only embeds. The rule's+ * save (extends `PromotionRuleDraftParams`) plus display-only embeds. The rule's* name and preference schema are resolved from `type` at render time, so no* copy is stored here.** Drafts seeded from existing rules carry the server's `id`; drafts* created via the picker have no id until the parent form saves.*/-export interface PromotionRuleFormDraft extends PromotionRuleDraft {+export interface PromotionRuleFormDraft extends PromotionRuleDraftParams {/** Client-side row id, used for React keys when the row has no server id yet. */_localId: string/**@@ -47,7 +47,7 @@ export interface PromotionRuleFormDraft extends PromotionRuleDraft {}/** Mirrors `PromotionRuleFormDraft` for actions. */-export interface PromotionActionFormDraft extends Omit<PromotionActionDraft, 'calculator'> {+export interface PromotionActionFormDraft extends Omit<PromotionActionDraftParams, 'calculator'> {_localId: string/*** Form-only calculator shape — extends the API's `{ type, preferences }`@@ -205,7 +205,7 @@ function calculatorFromAction(}/** Strips display-only fields before sending to the API. */-export function ruleDraftToPayload(draft: PromotionRuleFormDraft): PromotionRuleDraft {+export function ruleDraftToPayload(draft: PromotionRuleFormDraft): PromotionRuleDraftParams {const {_localId: _,products: __,@@ -221,7 +221,7 @@ export function ruleDraftToPayload(draft: PromotionRuleFormDraft): PromotionRulereturn rest}-export function actionDraftToPayload(draft: PromotionActionFormDraft): PromotionActionDraft {+export function actionDraftToPayload(draft: PromotionActionFormDraft): PromotionActionDraftParams {const { _localId: _, calculator, ...rest } = draftreturn {...rest,diff --git a/packages/dashboard/src/hooks/use-prices.ts b/packages/dashboard/src/hooks/use-prices.tsindex a0f00e9d75..029955186c 100644--- a/packages/dashboard/src/hooks/use-prices.ts+++ b/packages/dashboard/src/hooks/use-prices.ts@@ -1,4 +1,4 @@-import type { PriceBulkUpsertRow } from '@spree/admin-sdk'+import type { PriceBulkUpsertParams } from '@spree/admin-sdk'import { adminClient, useResourceMutation } from '@spree/dashboard-core'/**@@ -22,7 +22,7 @@ import { adminClient, useResourceMutation } from '@spree/dashboard-core'* reset the page's form under a merchant's unsaved edits.*/export function useBulkUpsertPrices(priceListId?: string | null) {- return useResourceMutation<{ price_count: number }, Error, { prices: PriceBulkUpsertRow[] }>({+ return useResourceMutation<{ price_count: number }, Error, PriceBulkUpsertParams>({mutationFn: (params) => adminClient.prices.bulkUpsert(params),invalidate: [['prices'],diff --git a/packages/dashboard/src/schemas/channel.ts b/packages/dashboard/src/schemas/channel.tsindex cf73f4caa3..ef2330726d 100644--- a/packages/dashboard/src/schemas/channel.ts+++ b/packages/dashboard/src/schemas/channel.ts@@ -28,7 +28,7 @@ export const channelFormSchema = z.object({active: z.boolean(),default: z.boolean(),order_routing_strategy: z.string(),- storefront_access: z.string(),+ storefront_access: z.enum(STOREFRONT_ACCESS_VALUES),guest_checkout: z.string(),// Empty means shoppers outside any assigned catalog see every product// published on the channel.diff --git a/packages/dashboard/src/schemas/collection.ts b/packages/dashboard/src/schemas/collection.tsindex cca9ecb91c..2f869b3795 100644--- a/packages/dashboard/src/schemas/collection.ts+++ b/packages/dashboard/src/schemas/collection.ts@@ -1,4 +1,4 @@-import type { Collection, CollectionRuleParam, CollectionSortOrder } from '@spree/admin-sdk'+import type { Collection, CollectionRuleParams, CollectionSortOrder } from '@spree/admin-sdk'import { customFieldFormSchema, signedIdParam } from '@spree/dashboard-core'import { requiredMessage } from '@spree/dashboard-ui'import { z } from 'zod/v4'@@ -189,7 +189,7 @@ export function collectionToParams(values: CollectionFormValues) {// so omitted rules are deleted. Only send it for automatic collections —// a manual one has no rules to express, and sending [] would wipe the rules// of a collection the merchant just toggled off (they come back on re-enable).- ...(values.automatic ? { rules: values.rules as CollectionRuleParam[] } : {}),+ ...(values.automatic ? { rules: values.rules as CollectionRuleParams[] } : {}),...(values.custom_fields && values.custom_fields.length > 0? { custom_fields: values.custom_fields }: {}),diff --git a/packages/dashboard/src/schemas/store.ts b/packages/dashboard/src/schemas/store.tsindex d739c7d543..f568f5a943 100644--- a/packages/dashboard/src/schemas/store.ts+++ b/packages/dashboard/src/schemas/store.ts@@ -5,7 +5,8 @@ import { z } from 'zod/v4'// `admin.store.weight_units.*`. Consumers translate at render time.export type UnitSystem = 'metric' | 'imperial'export const UNIT_SYSTEMS: readonly UnitSystem[] = ['metric', 'imperial']-export const WEIGHT_UNITS: Record<UnitSystem, readonly string[]> = {+export type WeightUnit = 'kg' | 'g' | 'lb' | 'oz'+export const WEIGHT_UNITS: Record<UnitSystem, readonly WeightUnit[]> = {metric: ['kg', 'g'],imperial: ['lb', 'oz'],}diff --git a/packages/sdk-core/scripts/generate-params.ts b/packages/sdk-core/scripts/generate-params.tsnew file mode 100644index 0000000000..adeb2f2f34--- /dev/null+++ b/packages/sdk-core/scripts/generate-params.ts@@ -0,0 +1,24 @@+import * as fs from 'node:fs'+import * as path from 'node:path'+import { parse } from 'yaml'+import { type ParamsSpec, renderParamsTypes } from '../src/params-types'++// Runs from the SDK package being generated (its `generate:params` script),+// reading that SDK's API reference and writing its request body types, one+// file per type, into src/types/params/:+//+// tsx ../sdk-core/scripts/generate-params.ts admin++const api = process.argv[2]+if (!api) throw new Error('Usage: generate-params.ts <store|admin|seller>')++const specPath = path.resolve(process.cwd(), `../../docs/api-reference/${api}.yaml`)+const outputDir = path.resolve(process.cwd(), 'src/types/params')+const spec = parse(fs.readFileSync(specPath, 'utf8')) as ParamsSpec+const files = renderParamsTypes(spec)++// Rewritten from scratch, so a type whose endpoint went away goes with it.+fs.rmSync(outputDir, { recursive: true, force: true })+fs.mkdirSync(outputDir, { recursive: true })+for (const [name, source] of files) fs.writeFileSync(path.join(outputDir, name), source)+console.log(`Wrote ${files.size - 1} request types to ${path.relative(process.cwd(), outputDir)}/`)diff --git a/packages/sdk-core/src/params-types.ts b/packages/sdk-core/src/params-types.tsnew file mode 100644index 0000000000..f38860a360--- /dev/null+++ b/packages/sdk-core/src/params-types.ts@@ -0,0 +1,149 @@+// Renders the request body types each SDK publishes, generated from the+// request schemas in its API reference (`pnpm generate:params`). Those schemas+// come from the controllers' `request_params` declarations, the same ones the+// API permits from, so the types say exactly what an endpoint accepts.++const HEADER =+ '// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.\n'++export interface ParamsSchema {+ type?: string+ format?: string+ enum?: string[]+ nullable?: boolean+ description?: string+ properties?: Record<string, ParamsSchema>+ required?: string[]+ additionalProperties?: boolean | ParamsSchema+ items?: ParamsSchema+ allOf?: ParamsSchema[]+ $ref?: string+}++export interface ParamsSpec {+ components?: { schemas?: Record<string, ParamsSchema> }+}++const isRequestSchema = (name: string) => name.endsWith('Params')++function refName(ref: string): string {+ const name = ref.replace('#/components/schemas/', '')+ if (!isRequestSchema(name)) {+ throw new Error(`A request schema references ${name}, which is not a request schema`)+ }+ return name+}++function quoteKey(key: string): string {+ return /^[A-Za-z_$][\w$]*$/.test(key) ? key : literal(key)+}++const LINE_WIDTH = 100++function wrap(text: string, width: number): string[] {+ const lines: string[] = []+ for (const paragraph of text.trim().split('\n')) {+ let line = ''+ // A `code span` is one word, so a line never breaks inside it.+ for (const word of paragraph.match(/(?:`[^`]*`|[^\s`])+/g) ?? []) {+ if (line && line.length + word.length + 1 > width) {+ lines.push(line)+ line = word+ } else {+ line = line ? `${line} ${word}` : word+ }+ }+ lines.push(line)+ }+ return lines+}++function docComment(description: string | undefined, indent: string): string[] {+ if (!description) return []+ const text = description.replaceAll('*/', '*\\/')+ if (indent.length + text.length + 7 <= LINE_WIDTH && !text.includes('\n')) {+ return [`${indent}/** ${text} */`]+ }+ return [+ `${indent}/**`,+ ...wrap(text, LINE_WIDTH - indent.length - 3).map(+ (line) => `${indent} *${line ? ` ${line}` : ''}`,+ ),+ `${indent} */`,+ ]+}++const literal = (value: string) => `'${value.replaceAll('\\', '\\\\').replaceAll("'", "\\'")}'`++function valueType(schema: ParamsSchema, indent: string): string {+ let type: string+ if (schema.$ref) {+ type = refName(schema.$ref)+ } else if (schema.allOf) {+ type = schema.allOf.map((part) => valueType(part, indent)).join(' & ')+ } else if (schema.enum) {+ type = schema.enum.map(literal).join(' | ')+ } else if (schema.type === 'array') {+ const item = valueType(schema.items ?? {}, indent)+ type = /[|& ]/.test(item) && !item.startsWith('{') ? `Array<${item}>` : `${item}[]`+ } else if (schema.type === 'object') {+ type = schema.properties ? objectType(schema, indent) : 'Record<string, unknown>'+ } else if (schema.type === 'string' || schema.type === 'boolean') {+ type = schema.type+ } else if (schema.type === 'integer' || schema.type === 'number') {+ type = 'number'+ } else {+ type = 'unknown'+ }+ return schema.nullable && type !== 'unknown' ? `${type} | null` : type+}++function objectType(schema: ParamsSchema, indent: string): string {+ const inner = `${indent} `+ const required = new Set(schema.required ?? [])+ const lines = ['{']+ for (const [key, property] of Object.entries(schema.properties ?? {})) {+ lines.push(...docComment(property.description, inner))+ lines.push(+ `${inner}${quoteKey(key)}${required.has(key) ? '' : '?'}: ${valueType(property, inner)}`,+ )+ }+ lines.push(`${indent}}`)+ return lines.join('\n')+}++function references(schema: ParamsSchema, found = new Set<string>()): Set<string> {+ if (schema.$ref) found.add(refName(schema.$ref))+ for (const part of schema.allOf ?? []) references(part, found)+ for (const property of Object.values(schema.properties ?? {})) references(property, found)+ if (schema.items) references(schema.items, found)+ return found+}++/**+ * One file per request type, plus an `index.ts` re-exporting them all, the+ * same layout Typelizer writes the response types in.+ *+ * @param spec - an API reference, parsed+ * @returns file name → TypeScript source+ */+export function renderParamsTypes(spec: ParamsSpec): Map<string, string> {+ const schemas = spec.components?.schemas ?? {}+ const names = Object.keys(schemas).filter(isRequestSchema).sort()+ const files = new Map<string, string>()++ for (const name of names) {+ const schema = schemas[name]+ const out = [HEADER]+ const imports = [...references(schema)].filter((reference) => reference !== name).sort()+ for (const reference of imports) out.push(`import type { ${reference} } from './${reference}'`)+ if (imports.length) out.push('')+ out.push(...docComment(schema.description, ''))+ out.push(`export type ${name} = ${objectType(schema, '')}`)+ files.set(`${name}.ts`, `${out.join('\n')}\n`)+ }++ const index = [HEADER, ...names.map((name) => `export type { ${name} } from './${name}'`)]+ files.set('index.ts', `${index.join('\n')}\n`)+ return files+}diff --git a/packages/sdk/biome.json b/packages/sdk/biome.jsonindex d08b859b96..261acc456e 100644--- a/packages/sdk/biome.json+++ b/packages/sdk/biome.json@@ -8,6 +8,7 @@"tests/**","!src/types/generated","!src/types/filters.generated.ts",+ "!src/types/params","!src/zod/generated","!src/webhooks/generated"]diff --git a/packages/sdk/package.json b/packages/sdk/package.jsonindex fcbda49614..2a3cfb4260 100644--- a/packages/sdk/package.json+++ b/packages/sdk/package.json@@ -56,6 +56,7 @@"scripts": {"generate:zod": "tsx ../sdk-core/scripts/generate-zod.ts","generate:filters": "tsx ../sdk-core/scripts/generate-filters.ts store",+ "generate:params": "tsx ../sdk-core/scripts/generate-params.ts store","build": "tsup","dev": "tsup --watch","console": "tsx console.ts",diff --git a/packages/sdk/src/store-client.ts b/packages/sdk/src/store-client.tsindex c6eb3f47bc..494db3639e 100644--- a/packages/sdk/src/store-client.ts+++ b/packages/sdk/src/store-client.ts@@ -1,5 +1,4 @@import type {- AddressParams,ListParams,ListResponse,PaginatedResponse,@@ -8,8 +7,11 @@ import type {} from '@spree/sdk-core'import { getParams, transformListParams } from '@spree/sdk-core'import type {+ AcceptCompanyInvitationParams,+ AddCompanyMemberParams,AddLineItemParams,Address,+ AddressParams,AuthTokens,Cart,Category,@@ -30,9 +32,14 @@ import type {CompletePaymentSetupSessionParams,Country,CreateCartParams,+ CreateClaimParams,+ CreateNewsletterSubscriberParams,CreatePaymentParams,CreatePaymentSessionParams,CreatePaymentSetupSessionParams,+ CreateReturnParams,+ CreateWishlistItemParams,+ CreateWishlistParams,CreditCard,Currency,Customer,@@ -43,6 +50,7 @@ import type {GiftCard,Locale,LoginCredentials,+ LogoutParams,Market,NewsletterSubscriber,Order,@@ -56,7 +64,9 @@ import type {ProductFiltersParams,ProductFiltersResponse,ProductListParams,+ RefreshTokenParams,RegisterParams,+ RequestNewsletterUnsubscribeParams,RequestPasswordResetParams,ResetPasswordParams,Return,@@ -66,8 +76,14 @@ import type {StockLocation,StoreCredit,UpdateCartParams,+ UpdateCompanyParams,+ UpdateCustomerParams,+ UpdateFulfillmentParams,UpdateLineItemParams,UpdatePaymentSessionParams,+ UpdateWishlistItemParams,+ UpdateWishlistParams,+ VerifyNewsletterSubscriberParams,Wishlist,WishlistItem,} from './types'@@ -124,13 +140,13 @@ export class StoreClient {* Returns new access JWT + rotated refresh token.* No Authorization header needed — uses refresh_token in body.*/- refresh: (params: { refresh_token: string }, options?: RequestOptions): Promise<AuthTokens> =>+ refresh: (params: RefreshTokenParams, options?: RequestOptions): Promise<AuthTokens> =>this.request<AuthTokens>('POST', '/auth/refresh', { ...options, body: params }),/*** Logout — revokes the refresh token.*/- logout: (params: { refresh_token: string }, options?: RequestOptions): Promise<void> =>+ logout: (params: LogoutParams, options?: RequestOptions): Promise<void> =>this.request<void>('POST', '/auth/logout', { ...options, body: params }),}@@ -644,7 +660,7 @@ export class StoreClient {update: (cartId: string,fulfillmentId: string,- params: { selected_delivery_rate_id: string },+ params: UpdateFulfillmentParams,options?: RequestOptions,): Promise<Cart> =>this.request<Cart>('PATCH', `/carts/${cartId}/fulfillments/${fulfillmentId}`, {@@ -812,11 +828,7 @@ export class StoreClient {*/create: (orderId: string,- params: {- items: Array<{ fulfillment_item_id: string; quantity: number }>- reason_id?: string- memo?: string- },+ params: CreateReturnParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('POST', `/orders/${orderId}/returns`, {@@ -868,11 +880,7 @@ export class StoreClient {*/create: (orderId: string,- params: {- items: Array<{ line_item_id: string; quantity: number; description?: string }>- reason_id?: string- memo?: string- },+ params: CreateClaimParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('POST', `/orders/${orderId}/claims`, {@@ -907,7 +915,7 @@ export class StoreClient {* store's allowed origins.*/create: (- params: { email: string; redirect_url?: string },+ params: CreateNewsletterSubscriberParams,options?: RequestOptions,): Promise<NewsletterSubscriber> =>this.request<NewsletterSubscriber>('POST', '/newsletter_subscribers', {@@ -918,7 +926,10 @@ export class StoreClient {/*** Confirm a pending subscription using the token from the confirmation email.*/- verify: (params: { token: string }, options?: RequestOptions): Promise<NewsletterSubscriber> =>+ verify: (+ params: VerifyNewsletterSubscriberParams,+ options?: RequestOptions,+ ): Promise<NewsletterSubscriber> =>this.request<NewsletterSubscriber>('POST', '/newsletter_subscribers/verify', {...options,body: params,@@ -932,7 +943,7 @@ export class StoreClient {* payload when it's not in the store's allowed origins.*/requestUnsubscribe: (- params: { email: string; redirect_url?: string },+ params: RequestNewsletterUnsubscribeParams,options?: RequestOptions,): Promise<void> =>this.request<void>('POST', '/newsletter_subscribers/request_unsubscribe', {@@ -963,22 +974,7 @@ export class StoreClient {/*** Update current customer profile*/- update: (- params: {- first_name?: string- last_name?: string- email?: string- password?: string- password_confirmation?: string- /** Required when changing email or password */- current_password?: string- accepts_email_marketing?: boolean- phone?: string- /** Arbitrary key-value metadata (stored, not returned in responses) */- metadata?: Record<string, unknown>- },- options?: RequestOptions,- ): Promise<Customer> =>+ update: (params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer> =>this.request<Customer>('PATCH', '/customers/me', {...options,body: params,@@ -1018,11 +1014,7 @@ export class StoreClient {/*** Update an address*/- update: (- id: string,- params: Partial<AddressParams>,- options?: RequestOptions,- ): Promise<Address> =>+ update: (id: string, params: AddressParams, options?: RequestOptions): Promise<Address> =>this.request<Address>('PATCH', `/customers/me/addresses/${id}`, {...options,body: params,@@ -1264,7 +1256,7 @@ export class StoreClient {get: (id: string, options?: RequestOptions): Promise<Company> =>this.request<Company>('GET', `/companies/${id}`, options),- update: (id: string, params: { name?: string }, options?: RequestOptions): Promise<Company> =>+ update: (id: string, params: UpdateCompanyParams, options?: RequestOptions): Promise<Company> =>this.request<Company>('PATCH', `/companies/${id}`, { ...options, body: params }),addresses: {@@ -1291,7 +1283,7 @@ export class StoreClient {update: (companyId: string,id: string,- params: Partial<CompanyAddressParams>,+ params: CompanyAddressParams,options?: RequestOptions,): Promise<Address> =>this.request<Address>('PATCH', `/companies/${companyId}/addresses/${id}`, {@@ -1325,7 +1317,7 @@ export class StoreClient {*/create: (companyId: string,- params: { customer_email: string },+ params: AddCompanyMemberParams,options?: RequestOptions,): Promise<CompanyInvitation> =>this.request<CompanyInvitation>('POST', `/companies/${companyId}/members`, {@@ -1392,13 +1384,7 @@ export class StoreClient {*/accept: (token: string,- params?: {- first_name?: string- last_name?: string- phone?: string- password?: string- password_confirmation?: string- },+ params?: AcceptCompanyInvitationParams,options?: RequestOptions,): Promise<CompanyMembership> =>this.request<CompanyMembership>('POST', `/company_invitations/${token}/accept`, {@@ -1444,10 +1430,7 @@ export class StoreClient {/*** Create a wishlist*/- create: (- params: { name: string; is_private?: boolean; is_default?: boolean },- options?: RequestOptions,- ): Promise<Wishlist> =>+ create: (params: CreateWishlistParams, options?: RequestOptions): Promise<Wishlist> =>this.request<Wishlist>('POST', '/wishlists', {...options,body: params,@@ -1458,7 +1441,7 @@ export class StoreClient {*/update: (id: string,- params: { name?: string; is_private?: boolean; is_default?: boolean },+ params: UpdateWishlistParams,options?: RequestOptions,): Promise<Wishlist> =>this.request<Wishlist>('PATCH', `/wishlists/${id}`, {@@ -1481,7 +1464,7 @@ export class StoreClient {*/create: (wishlistId: string,- params: { variant_id: string; quantity?: number },+ params: CreateWishlistItemParams,options?: RequestOptions,): Promise<WishlistItem> =>this.request<WishlistItem>('POST', `/wishlists/${wishlistId}/items`, {@@ -1495,7 +1478,7 @@ export class StoreClient {update: (wishlistId: string,itemId: string,- params: { quantity: number },+ params: UpdateWishlistItemParams,options?: RequestOptions,): Promise<WishlistItem> =>this.request<WishlistItem>('PATCH', `/wishlists/${wishlistId}/items/${itemId}`, {diff --git a/packages/sdk/src/types/generated/Media.ts b/packages/sdk/src/types/generated/Media.tsindex 27675d3a08..d36bb37b73 100644--- a/packages/sdk/src/types/generated/Media.ts+++ b/packages/sdk/src/types/generated/Media.ts@@ -1,4 +1,4 @@-// Typelizer digest 8eddf0139517425a23c6b3a88c01b963+// Typelizer digest 9315ed2484375d252fa5b21b94435c4a//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -9,9 +9,9 @@ interface Media {position: number;alt: string | null;media_type: 'image' | 'video' | 'external_video';+ external_video_url: string | null;focal_point_x: number | null;focal_point_y: number | null;- external_video_url: string | null;video_provider: string | null;video_embed_url: string | null;video_url: string | null;diff --git a/packages/sdk/src/types/index.ts b/packages/sdk/src/types/index.tsindex 139a94d60f..2b01914a32 100644--- a/packages/sdk/src/types/index.ts+++ b/packages/sdk/src/types/index.ts@@ -1,4 +1,4 @@-import type { AddressParams, ListParams } from '@spree/sdk-core'+import type { ListParams } from '@spree/sdk-core'import type {CategoryFilters,CategorySort,@@ -10,9 +10,9 @@ import type {ProductSort,} from './filters.generated'import type { Cart as CartType } from './generated'+import type { LineItemInputParams } from './params'export * from './filters.generated'-// Re-export all generated types (unprefixed: Product, Order, etc.)export type {Address,@@ -71,6 +71,7 @@ export type {Wishlist,WishlistItem,} from './generated'+export type * from './params'// Checkout requirement — a single unsatisfied checkout prerequisiteexport interface CheckoutRequirement {@@ -87,7 +88,6 @@ export type CartWarning = CartType['warnings'][number]// Hand-written domain typesexport type {- AddressParams,ErrorResponse,ListParams,ListResponse,@@ -110,28 +110,6 @@ export interface AuthTokens {export type { EmailPasswordLogin, LoginCredentials, ProviderLogin } from '@spree/sdk-core'-export interface RequestPasswordResetParams {- email: string- redirect_url?: string-}--export interface ResetPasswordParams {- password: string- password_confirmation: string-}--export interface RegisterParams {- email: string- password: string- password_confirmation: string- first_name?: string- last_name?: string- phone?: string- accepts_email_marketing?: boolean- /** Arbitrary key-value metadata (stored, not returned in responses) */- metadata?: Record<string, unknown>-}-export type ProductListParams = ListParams<ProductFilters, ProductSort>export type CategoryListParams = ListParams<CategoryFilters, CategorySort>@@ -141,107 +119,13 @@ export type CollectionListParams = ListParams<CollectionFilters, CollectionSort>export type OrderListParams = ListParams<OrderFilters, OrderSort>// Line item input for bulk cart/order operations-export interface LineItemInput {- /** Prefixed variant ID (e.g., "variant_k5nR8xLq") */- variant_id: string- /** Quantity to set (defaults to 1 if omitted) */- quantity?: number- /** Arbitrary key-value metadata (merged with existing on upsert) */- metadata?: Record<string, unknown>-}+/** @deprecated Renamed to `LineItemInputParams`. */+export type LineItemInput = LineItemInputParams// Cart operations-export interface CreateCartParams {- /** Arbitrary key-value metadata (stored, not returned in responses) */- metadata?: Record<string, unknown>- /** Items to add to the cart on creation */- items?: LineItemInput[]-}--export interface AddLineItemParams {- variant_id: string- quantity: number- /** Arbitrary key-value metadata (stored, not returned in responses) */- metadata?: Record<string, unknown>-}--export interface UpdateLineItemParams {- quantity?: number- /** Arbitrary key-value metadata (merged with existing) */- metadata?: Record<string, unknown>-}--export interface UpdateCartParams {- email?: string- currency?: string- locale?: string- customer_note?: string- /** Arbitrary key-value metadata (merged with existing) */- metadata?: Record<string, unknown>- /** Existing address ID to use as billing address */- billing_address_id?: string- /** Existing address ID to use as shipping address */- shipping_address_id?: string- /** New billing address */- billing_address?: AddressParams- /** New shipping address */- shipping_address?: AddressParams- /** When true, copies shipping address to billing address */- use_shipping?: boolean- /** Items to upsert (sets quantity for existing, creates new) */- items?: LineItemInput[]- /**- * The company node this purchase is for. The buyer must have standing over- * it — a membership on that node or one of its ancestors. Null clears it,- * and with it the company's catalog, pricing and tax anchoring.- */- company_id?: string | null- /**- * The buyer's own purchase-order reference. Their accounting reconciles the- * order, the invoice and the payment against it. Blank clears it.- */- po_number?: string | null- /**- * The `signed_id` of the buyer's purchase order, from- * `POST /store/carts/:id/po_document`. Blank detaches the document.- */- po_document_signed_id?: string | null-}-// Payments-export interface CreatePaymentParams {- payment_method_id: string- amount?: string- metadata?: Record<string, unknown>-}-// Payment Sessions-export interface CreatePaymentSessionParams {- payment_method_id: string- amount?: string- external_data?: Record<string, unknown>-}--export interface UpdatePaymentSessionParams {- amount?: string- external_data?: Record<string, unknown>-}--export interface CompletePaymentSessionParams {- session_result?: string- external_data?: Record<string, unknown>-}-// Payment Setup Sessions-export interface CreatePaymentSetupSessionParams {- payment_method_id: string- external_data?: Record<string, unknown>-}--export interface CompletePaymentSetupSessionParams {- external_data?: Record<string, unknown>-}-// Product Filters typesexport interface FilterOption {id: string@@ -310,17 +194,6 @@ export interface ProductFiltersParams {q?: Record<string, unknown>}-/**- * An address book entry for a company node: address fields, plus the two- * things only a book entry has — what it is filed under, and which defaults- * it holds for its node.- */-export type CompanyAddressParams = AddressParams & {- label?: string- default_billing?: boolean- default_shipping?: boolean-}-// The building blocks of the generated filter types, for a declaration file// that extends them (see `spree filters types`).export type {diff --git a/packages/sdk/src/types/params/AcceptCompanyInvitationParams.ts b/packages/sdk/src/types/params/AcceptCompanyInvitationParams.tsnew file mode 100644index 0000000000..5cbbe60269--- /dev/null+++ b/packages/sdk/src/types/params/AcceptCompanyInvitationParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AcceptCompanyInvitationParams = {+ first_name?: string+ last_name?: string+ phone?: string+ password?: string+ password_confirmation?: string+}diff --git a/packages/sdk/src/types/params/AddCompanyMemberParams.ts b/packages/sdk/src/types/params/AddCompanyMemberParams.tsnew file mode 100644index 0000000000..ab20b2bd36--- /dev/null+++ b/packages/sdk/src/types/params/AddCompanyMemberParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AddCompanyMemberParams = {+ customer_email: string+}diff --git a/packages/sdk/src/types/params/AddLineItemParams.ts b/packages/sdk/src/types/params/AddLineItemParams.tsnew file mode 100644index 0000000000..aa2208e4a6--- /dev/null+++ b/packages/sdk/src/types/params/AddLineItemParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AddLineItemParams = {+ variant_id: string+ /** Defaults to 1. */+ quantity?: number+ /** Write-only key-value metadata. */+ metadata?: Record<string, unknown>+ /** Values for line item attributes an extension adds. */+ options?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/AddressParams.ts b/packages/sdk/src/types/params/AddressParams.tsnew file mode 100644index 0000000000..230e0fc679--- /dev/null+++ b/packages/sdk/src/types/params/AddressParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ phone?: string+ /** ISO 3166-1 alpha-2 country code, such as `US` or `DE`. */+ country_code?: string+ /** ISO 3166-2 subdivision code without the country prefix, such as `CA` or `NY`. */+ state_code?: string+ /** The state name, for countries without predefined states. */+ state_name?: string+ /** Deprecated: use `country_code`. Accepted until 6.1. */+ country_iso?: string+ /** Deprecated: use `state_code`. Accepted until 6.1. */+ state_abbr?: string+ /** Makes this the default billing address. */+ is_default_billing?: boolean+ /** Makes this the default shipping address. */+ is_default_shipping?: boolean+}diff --git a/packages/sdk/src/types/params/ApplyDiscountCodeParams.ts b/packages/sdk/src/types/params/ApplyDiscountCodeParams.tsnew file mode 100644index 0000000000..2d5d3d5a35--- /dev/null+++ b/packages/sdk/src/types/params/ApplyDiscountCodeParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ApplyDiscountCodeParams = {+ /** The promotion code to apply. */+ code: string+}diff --git a/packages/sdk/src/types/params/ApplyGiftCardParams.ts b/packages/sdk/src/types/params/ApplyGiftCardParams.tsnew file mode 100644index 0000000000..3a469226c2--- /dev/null+++ b/packages/sdk/src/types/params/ApplyGiftCardParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ApplyGiftCardParams = {+ /** The gift card code to apply. */+ code: string+}diff --git a/packages/sdk/src/types/params/ApplyStoreCreditParams.ts b/packages/sdk/src/types/params/ApplyStoreCreditParams.tsnew file mode 100644index 0000000000..201bd8a601--- /dev/null+++ b/packages/sdk/src/types/params/ApplyStoreCreditParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ApplyStoreCreditParams = {+ /** Defaults to as much as the cart can use. */+ amount?: string+}diff --git a/packages/sdk/src/types/params/CartAddressParams.ts b/packages/sdk/src/types/params/CartAddressParams.tsnew file mode 100644index 0000000000..c477ba4d5e--- /dev/null+++ b/packages/sdk/src/types/params/CartAddressParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CartAddressParams = {+ /** An existing address of the customer to use. The other fields are then ignored. */+ id?: string+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ phone?: string+ /** ISO 3166-1 alpha-2 country code, such as `US` or `DE`. */+ country_code?: string+ /** ISO 3166-2 subdivision code without the country prefix, such as `CA` or `NY`. */+ state_code?: string+ /** The state name, for countries without predefined states. */+ state_name?: string+ /** Deprecated: use `country_code`. Accepted until 6.1. */+ country_iso?: string+ /** Deprecated: use `state_code`. Accepted until 6.1. */+ state_abbr?: string+ /**+ * Relaxes validation (name, phone, postal code, street), for express checkouts that share a+ * partial address.+ */+ quick_checkout?: boolean+}diff --git a/packages/sdk/src/types/params/CompanyAddressParams.ts b/packages/sdk/src/types/params/CompanyAddressParams.tsnew file mode 100644index 0000000000..8f3025d7a2--- /dev/null+++ b/packages/sdk/src/types/params/CompanyAddressParams.ts@@ -0,0 +1,29 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompanyAddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ state_name?: string+ label?: string+ /** ISO 3166-1 alpha-2 code, such as `US`. */+ country_code?: string+ /** The state or province abbreviation, such as `NY`. */+ state_code?: string+ /**+ * True makes this the node's default billing address, false gives that up, and leaving it out+ * changes nothing.+ */+ default_billing?: boolean+ /**+ * True makes this the node's default shipping address, false gives that up, and leaving it out+ * changes nothing.+ */+ default_shipping?: boolean+}diff --git a/packages/sdk/src/types/params/CompletePaymentSessionParams.ts b/packages/sdk/src/types/params/CompletePaymentSessionParams.tsnew file mode 100644index 0000000000..3b2ce9f16b--- /dev/null+++ b/packages/sdk/src/types/params/CompletePaymentSessionParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompletePaymentSessionParams = {+ /** Provider-specific session result token. */+ session_result?: string+ /** Provider-specific completion data. */+ external_data?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/CompletePaymentSetupSessionParams.ts b/packages/sdk/src/types/params/CompletePaymentSetupSessionParams.tsnew file mode 100644index 0000000000..1644691b45--- /dev/null+++ b/packages/sdk/src/types/params/CompletePaymentSetupSessionParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CompletePaymentSetupSessionParams = {+ /** Provider-specific completion data. */+ external_data?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/CreateCartParams.ts b/packages/sdk/src/types/params/CreateCartParams.tsnew file mode 100644index 0000000000..3a4d194111--- /dev/null+++ b/packages/sdk/src/types/params/CreateCartParams.ts@@ -0,0 +1,43 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CartAddressParams } from './CartAddressParams'+import type { LineItemInputParams } from './LineItemInputParams'++export type CreateCartParams = {+ email?: string+ customer_note?: string+ market_id?: string+ currency?: string+ locale?: string+ /** An existing address to ship to. */+ shipping_address_id?: string+ /** An existing address to bill. */+ billing_address_id?: string+ preferred_stock_location_id?: string+ /**+ * The company node this purchase is for. The buyer must have standing over it: a membership on+ * that node or one of its ancestors. Null clears it, and with it the company's catalog, pricing+ * and tax anchoring.+ */+ company_id?: string | null+ /**+ * The buyer's own purchase-order reference. Their accounting reconciles the order, the invoice+ * and the payment against it. Blank clears it.+ */+ po_number?: string | null+ /**+ * The `signed_id` of the buyer's purchase order, from `POST /store/carts/:id/po_document`. Blank+ * detaches the document.+ */+ po_document_signed_id?: string | null+ /** When true, copies the shipping address to the billing address. */+ use_shipping?: boolean+ /** A new shipping address. */+ shipping_address?: CartAddressParams+ /** A new billing address. */+ billing_address?: CartAddressParams+ /** Write-only key-value metadata, merged with what the cart has. */+ metadata?: Record<string, unknown>+ /** Items to upsert: sets the quantity of a variant already in the cart, adds the others. */+ items?: LineItemInputParams[]+}diff --git a/packages/sdk/src/types/params/CreateClaimParams.ts b/packages/sdk/src/types/params/CreateClaimParams.tsnew file mode 100644index 0000000000..6c6e5cc29f--- /dev/null+++ b/packages/sdk/src/types/params/CreateClaimParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateClaimParams = {+ items: {+ line_item_id: string+ quantity: number+ /** What is wrong with the item. */+ description?: string+ }[]+ /** One of the store's claim reasons. */+ reason_id?: string+ memo?: string+}diff --git a/packages/sdk/src/types/params/CreateDataRequestParams.ts b/packages/sdk/src/types/params/CreateDataRequestParams.tsnew file mode 100644index 0000000000..67f63bd8b2--- /dev/null+++ b/packages/sdk/src/types/params/CreateDataRequestParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateDataRequestParams = {+ /** Defaults to `access`. */+ kind?: 'access' | 'erasure'+ /** Required for `erasure`. */+ current_password?: string+}diff --git a/packages/sdk/src/types/params/CreateNewsletterSubscriberParams.ts b/packages/sdk/src/types/params/CreateNewsletterSubscriberParams.tsnew file mode 100644index 0000000000..2239fc7639--- /dev/null+++ b/packages/sdk/src/types/params/CreateNewsletterSubscriberParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateNewsletterSubscriberParams = {+ email: string+ /**+ * The storefront URL the verification token is appended to. Left out of the webhook payload+ * unless it matches one of the store's allowed origins.+ */+ redirect_url?: string+}diff --git a/packages/sdk/src/types/params/CreatePaymentParams.ts b/packages/sdk/src/types/params/CreatePaymentParams.tsnew file mode 100644index 0000000000..162f03c253--- /dev/null+++ b/packages/sdk/src/types/params/CreatePaymentParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreatePaymentParams = {+ /** A payment method that needs no payment session. */+ payment_method_id: string+ /** Defaults to the order total minus store credits. */+ amount?: string+ /** Key-value metadata to attach to the payment. */+ metadata?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/CreatePaymentSessionParams.ts b/packages/sdk/src/types/params/CreatePaymentSessionParams.tsnew file mode 100644index 0000000000..75e5f500ae--- /dev/null+++ b/packages/sdk/src/types/params/CreatePaymentSessionParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreatePaymentSessionParams = {+ payment_method_id: string+ /** Defaults to the order total minus store credits. */+ amount?: string+ /** Provider-specific data passed to the gateway. */+ external_data?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/CreatePaymentSetupSessionParams.ts b/packages/sdk/src/types/params/CreatePaymentSetupSessionParams.tsnew file mode 100644index 0000000000..8b87509470--- /dev/null+++ b/packages/sdk/src/types/params/CreatePaymentSetupSessionParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreatePaymentSetupSessionParams = {+ payment_method_id: string+ /** Provider-specific data passed to the gateway. */+ external_data?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/CreatePoDocumentParams.ts b/packages/sdk/src/types/params/CreatePoDocumentParams.tsnew file mode 100644index 0000000000..1c110926a1--- /dev/null+++ b/packages/sdk/src/types/params/CreatePoDocumentParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreatePoDocumentParams = {+ filename: string+ content_type: string+ byte_size: number+ /** Base64-encoded MD5 digest of the file; the storage service checks the bytes against it. */+ checksum: string+}diff --git a/packages/sdk/src/types/params/CreateReturnParams.ts b/packages/sdk/src/types/params/CreateReturnParams.tsnew file mode 100644index 0000000000..a5637bea76--- /dev/null+++ b/packages/sdk/src/types/params/CreateReturnParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateReturnParams = {+ items: {+ /** The shipped unit coming back. */+ fulfillment_item_id: string+ quantity: number+ }[]+ /** One of the store's return reasons. */+ reason_id?: string+ memo?: string+}diff --git a/packages/sdk/src/types/params/CreateWishlistItemParams.ts b/packages/sdk/src/types/params/CreateWishlistItemParams.tsnew file mode 100644index 0000000000..f9c7c3c17a--- /dev/null+++ b/packages/sdk/src/types/params/CreateWishlistItemParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateWishlistItemParams = {+ variant_id: string+ quantity?: number+}diff --git a/packages/sdk/src/types/params/CreateWishlistParams.ts b/packages/sdk/src/types/params/CreateWishlistParams.tsnew file mode 100644index 0000000000..a37d17ad1e--- /dev/null+++ b/packages/sdk/src/types/params/CreateWishlistParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CreateWishlistParams = {+ name: string+ is_private?: boolean+ is_default?: boolean+}diff --git a/packages/sdk/src/types/params/LineItemInputParams.ts b/packages/sdk/src/types/params/LineItemInputParams.tsnew file mode 100644index 0000000000..d9439822b1--- /dev/null+++ b/packages/sdk/src/types/params/LineItemInputParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type LineItemInputParams = {+ variant_id: string+ /** Defaults to 1. */+ quantity?: number+ /** Key-value metadata, merged with what the line item has. */+ metadata?: Record<string, unknown>+ options?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/LogoutParams.ts b/packages/sdk/src/types/params/LogoutParams.tsnew file mode 100644index 0000000000..29ba6bd58c--- /dev/null+++ b/packages/sdk/src/types/params/LogoutParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type LogoutParams = {+ /** The refresh token to revoke. */+ refresh_token?: string+}diff --git a/packages/sdk/src/types/params/RefreshTokenParams.ts b/packages/sdk/src/types/params/RefreshTokenParams.tsnew file mode 100644index 0000000000..fbf763f61d--- /dev/null+++ b/packages/sdk/src/types/params/RefreshTokenParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RefreshTokenParams = {+ /** The refresh token from the login response. */+ refresh_token: string+}diff --git a/packages/sdk/src/types/params/RegisterParams.ts b/packages/sdk/src/types/params/RegisterParams.tsnew file mode 100644index 0000000000..12a0d18ac3--- /dev/null+++ b/packages/sdk/src/types/params/RegisterParams.ts@@ -0,0 +1,17 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RegisterParams = {+ email: string+ password: string+ password_confirmation?: string+ first_name?: string+ last_name?: string+ phone?: string+ accepts_email_marketing?: boolean+ /** Write-only key-value metadata. */+ metadata?: Record<string, unknown>+ /**+ * Whether the customer ticked the storefront's terms of service box. Recorded as their consent.+ */+ terms_of_service?: boolean+}diff --git a/packages/sdk/src/types/params/RequestNewsletterUnsubscribeParams.ts b/packages/sdk/src/types/params/RequestNewsletterUnsubscribeParams.tsnew file mode 100644index 0000000000..601763212c--- /dev/null+++ b/packages/sdk/src/types/params/RequestNewsletterUnsubscribeParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RequestNewsletterUnsubscribeParams = {+ email?: string+ /**+ * The storefront URL the unsubscribe token is appended to in the email. Left out of the event+ * payload unless it matches one of the store's allowed origins.+ */+ redirect_url?: string+}diff --git a/packages/sdk/src/types/params/RequestPasswordResetParams.ts b/packages/sdk/src/types/params/RequestPasswordResetParams.tsnew file mode 100644index 0000000000..f610ea030d--- /dev/null+++ b/packages/sdk/src/types/params/RequestPasswordResetParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RequestPasswordResetParams = {+ /** The email of the account to reset. */+ email: string+ /**+ * Where the reset link sends the customer. Ignored unless it matches one of the store's allowed+ * origins.+ */+ redirect_url?: string+}diff --git a/packages/sdk/src/types/params/ResetPasswordParams.ts b/packages/sdk/src/types/params/ResetPasswordParams.tsnew file mode 100644index 0000000000..610d149131--- /dev/null+++ b/packages/sdk/src/types/params/ResetPasswordParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ResetPasswordParams = {+ password: string+ password_confirmation: string+}diff --git a/packages/sdk/src/types/params/TaxIdentifierParams.ts b/packages/sdk/src/types/params/TaxIdentifierParams.tsnew file mode 100644index 0000000000..a7b769d0f6--- /dev/null+++ b/packages/sdk/src/types/params/TaxIdentifierParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TaxIdentifierParams = {+ /**+ * The registration the number belongs to, such as `eu_vat` or `gb_vat`. Any kind is accepted; one+ * with a registered validator is checked by it. Built-in: `eu_vat`. Extensions may register more.+ */+ kind: string+ value: string+}diff --git a/packages/sdk/src/types/params/UpdateCartParams.ts b/packages/sdk/src/types/params/UpdateCartParams.tsnew file mode 100644index 0000000000..7973f43f0b--- /dev/null+++ b/packages/sdk/src/types/params/UpdateCartParams.ts@@ -0,0 +1,43 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CartAddressParams } from './CartAddressParams'+import type { LineItemInputParams } from './LineItemInputParams'++export type UpdateCartParams = {+ email?: string+ customer_note?: string+ market_id?: string+ currency?: string+ locale?: string+ /** An existing address to ship to. */+ shipping_address_id?: string+ /** An existing address to bill. */+ billing_address_id?: string+ preferred_stock_location_id?: string+ /**+ * The company node this purchase is for. The buyer must have standing over it: a membership on+ * that node or one of its ancestors. Null clears it, and with it the company's catalog, pricing+ * and tax anchoring.+ */+ company_id?: string | null+ /**+ * The buyer's own purchase-order reference. Their accounting reconciles the order, the invoice+ * and the payment against it. Blank clears it.+ */+ po_number?: string | null+ /**+ * The `signed_id` of the buyer's purchase order, from `POST /store/carts/:id/po_document`. Blank+ * detaches the document.+ */+ po_document_signed_id?: string | null+ /** When true, copies the shipping address to the billing address. */+ use_shipping?: boolean+ /** A new shipping address. */+ shipping_address?: CartAddressParams+ /** A new billing address. */+ billing_address?: CartAddressParams+ /** Write-only key-value metadata, merged with what the cart has. */+ metadata?: Record<string, unknown>+ /** Items to upsert: sets the quantity of a variant already in the cart, adds the others. */+ items?: LineItemInputParams[]+}diff --git a/packages/sdk/src/types/params/UpdateCompanyParams.ts b/packages/sdk/src/types/params/UpdateCompanyParams.tsnew file mode 100644index 0000000000..fe7ef00e8d--- /dev/null+++ b/packages/sdk/src/types/params/UpdateCompanyParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateCompanyParams = {+ name?: string+}diff --git a/packages/sdk/src/types/params/UpdateCustomerParams.ts b/packages/sdk/src/types/params/UpdateCustomerParams.tsnew file mode 100644index 0000000000..fd09ab4f09--- /dev/null+++ b/packages/sdk/src/types/params/UpdateCustomerParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateCustomerParams = {+ email?: string+ password?: string+ password_confirmation?: string+ /** Required when changing the email or the password. */+ current_password?: string+ first_name?: string+ last_name?: string+ phone?: string+ accepts_email_marketing?: boolean+ /** Write-only key-value metadata. */+ metadata?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/UpdateFulfillmentParams.ts b/packages/sdk/src/types/params/UpdateFulfillmentParams.tsnew file mode 100644index 0000000000..666abba543--- /dev/null+++ b/packages/sdk/src/types/params/UpdateFulfillmentParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateFulfillmentParams = {+ /** The delivery rate to select. */+ selected_delivery_rate_id?: string+ /** For a pickup point delivery method: the provider's id of the point to collect from. */+ pickup_point_external_id?: string+}diff --git a/packages/sdk/src/types/params/UpdateLineItemParams.ts b/packages/sdk/src/types/params/UpdateLineItemParams.tsnew file mode 100644index 0000000000..328cde5a03--- /dev/null+++ b/packages/sdk/src/types/params/UpdateLineItemParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateLineItemParams = {+ /** At least 1. Remove an item with DELETE. */+ quantity?: number+ /** Write-only key-value metadata, merged with what the line item has. */+ metadata?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/UpdatePaymentSessionParams.ts b/packages/sdk/src/types/params/UpdatePaymentSessionParams.tsnew file mode 100644index 0000000000..e2306cab8f--- /dev/null+++ b/packages/sdk/src/types/params/UpdatePaymentSessionParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdatePaymentSessionParams = {+ amount?: string+ /** Provider-specific data to update. */+ external_data?: Record<string, unknown>+}diff --git a/packages/sdk/src/types/params/UpdateWishlistItemParams.ts b/packages/sdk/src/types/params/UpdateWishlistItemParams.tsnew file mode 100644index 0000000000..691cfabd6b--- /dev/null+++ b/packages/sdk/src/types/params/UpdateWishlistItemParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateWishlistItemParams = {+ /** Moves the item to another variant. */+ variant_id?: string+ quantity?: number+}diff --git a/packages/sdk/src/types/params/UpdateWishlistParams.ts b/packages/sdk/src/types/params/UpdateWishlistParams.tsnew file mode 100644index 0000000000..8c787cb506--- /dev/null+++ b/packages/sdk/src/types/params/UpdateWishlistParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type UpdateWishlistParams = {+ name?: string+ is_private?: boolean+ is_default?: boolean+}diff --git a/packages/sdk/src/types/params/VerifyNewsletterSubscriberParams.ts b/packages/sdk/src/types/params/VerifyNewsletterSubscriberParams.tsnew file mode 100644index 0000000000..f137b4ba10--- /dev/null+++ b/packages/sdk/src/types/params/VerifyNewsletterSubscriberParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type VerifyNewsletterSubscriberParams = {+ /** The verification token from the confirmation email. */+ token: string+}diff --git a/packages/sdk/src/types/params/index.ts b/packages/sdk/src/types/params/index.tsnew file mode 100644index 0000000000..91519beb6e--- /dev/null+++ b/packages/sdk/src/types/params/index.ts@@ -0,0 +1,41 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type { AcceptCompanyInvitationParams } from './AcceptCompanyInvitationParams'+export type { AddCompanyMemberParams } from './AddCompanyMemberParams'+export type { AddLineItemParams } from './AddLineItemParams'+export type { AddressParams } from './AddressParams'+export type { ApplyDiscountCodeParams } from './ApplyDiscountCodeParams'+export type { ApplyGiftCardParams } from './ApplyGiftCardParams'+export type { ApplyStoreCreditParams } from './ApplyStoreCreditParams'+export type { CartAddressParams } from './CartAddressParams'+export type { CompanyAddressParams } from './CompanyAddressParams'+export type { CompletePaymentSessionParams } from './CompletePaymentSessionParams'+export type { CompletePaymentSetupSessionParams } from './CompletePaymentSetupSessionParams'+export type { CreateCartParams } from './CreateCartParams'+export type { CreateClaimParams } from './CreateClaimParams'+export type { CreateDataRequestParams } from './CreateDataRequestParams'+export type { CreateNewsletterSubscriberParams } from './CreateNewsletterSubscriberParams'+export type { CreatePaymentParams } from './CreatePaymentParams'+export type { CreatePaymentSessionParams } from './CreatePaymentSessionParams'+export type { CreatePaymentSetupSessionParams } from './CreatePaymentSetupSessionParams'+export type { CreatePoDocumentParams } from './CreatePoDocumentParams'+export type { CreateReturnParams } from './CreateReturnParams'+export type { CreateWishlistItemParams } from './CreateWishlistItemParams'+export type { CreateWishlistParams } from './CreateWishlistParams'+export type { LineItemInputParams } from './LineItemInputParams'+export type { LogoutParams } from './LogoutParams'+export type { RefreshTokenParams } from './RefreshTokenParams'+export type { RegisterParams } from './RegisterParams'+export type { RequestNewsletterUnsubscribeParams } from './RequestNewsletterUnsubscribeParams'+export type { RequestPasswordResetParams } from './RequestPasswordResetParams'+export type { ResetPasswordParams } from './ResetPasswordParams'+export type { TaxIdentifierParams } from './TaxIdentifierParams'+export type { UpdateCartParams } from './UpdateCartParams'+export type { UpdateCompanyParams } from './UpdateCompanyParams'+export type { UpdateCustomerParams } from './UpdateCustomerParams'+export type { UpdateFulfillmentParams } from './UpdateFulfillmentParams'+export type { UpdateLineItemParams } from './UpdateLineItemParams'+export type { UpdatePaymentSessionParams } from './UpdatePaymentSessionParams'+export type { UpdateWishlistItemParams } from './UpdateWishlistItemParams'+export type { UpdateWishlistParams } from './UpdateWishlistParams'+export type { VerifyNewsletterSubscriberParams } from './VerifyNewsletterSubscriberParams'diff --git a/packages/sdk/src/zod/generated/Media.ts b/packages/sdk/src/zod/generated/Media.tsindex e84487846e..b922a882ac 100644--- a/packages/sdk/src/zod/generated/Media.ts+++ b/packages/sdk/src/zod/generated/Media.ts@@ -8,9 +8,9 @@ export const MediaSchema = z.object({position: z.number(),alt: z.string().nullable(),media_type: z.string(),+ external_video_url: z.string().nullable(),focal_point_x: z.number().nullable(),focal_point_y: z.number().nullable(),- external_video_url: z.string().nullable(),video_provider: z.string().nullable(),video_embed_url: z.string().nullable(),video_url: z.string().nullable(),diff --git a/packages/seller-sdk/biome.json b/packages/seller-sdk/biome.jsonindex 7a23b634ca..731e25ac67 100644--- a/packages/seller-sdk/biome.json+++ b/packages/seller-sdk/biome.json@@ -8,6 +8,7 @@"tests/**","!src/types/generated","!src/types/filters.generated.ts",+ "!src/types/params","!src/zod/generated"]}diff --git a/packages/seller-sdk/package.json b/packages/seller-sdk/package.jsonindex b0de1fd073..3bde068263 100644--- a/packages/seller-sdk/package.json+++ b/packages/seller-sdk/package.json@@ -46,6 +46,7 @@"scripts": {"generate:zod": "tsx ../sdk-core/scripts/generate-zod.ts","generate:filters": "tsx ../sdk-core/scripts/generate-filters.ts seller",+ "generate:params": "tsx ../sdk-core/scripts/generate-params.ts seller","build": "tsup","dev": "tsup --watch","typecheck": "tsc --noEmit",diff --git a/packages/seller-sdk/src/seller-client.ts b/packages/seller-sdk/src/seller-client.tsindex a3a17536e1..1fec071b82 100644--- a/packages/seller-sdk/src/seller-client.ts+++ b/packages/seller-sdk/src/seller-client.ts@@ -1,5 +1,4 @@import type {- FileUploadCreateParams,ListParams,PaginatedResponse,PreferenceSchema,@@ -69,6 +68,53 @@ import type {StockLocationFilters,StockLocationSort,} from './types/filters.generated'+import type {+ AccountUpdateParams,+ ClaimCancelParams,+ ClaimCreateParams,+ ClaimDenyParams,+ ClaimResolveParams,+ DeliveryCreateParams,+ DeliveryMethodParams,+ DeliveryUpdateParams,+ ExchangeCancelParams,+ ExchangeCreateParams,+ ExchangeFulfillParams,+ ExchangeReceiveParams,+ FileUploadCreateParams,+ FulfillmentFulfillParams,+ FulfillmentSplitParams,+ FulfillmentUpdateParams,+ ImportCompleteMappingParams,+ ImportCreateParams,+ InvitationAcceptParams,+ LoginParams,+ OnboardingPayoutAccountParams,+ OrderAddressCorrectionParams,+ OrderCancelParams,+ OrderNotesParams,+ PackageTypeParams,+ PasswordResetCreateParams,+ PasswordResetUpdateParams,+ PolicyCreateParams,+ PolicyUpdateParams,+ ProductBulkStatusParams,+ ProductBulkSubmitParams,+ ProductParams,+ ProfileUpdateParams,+ RequirementSubmissionParams,+ ReturnCancelParams,+ ReturnCreateParams,+ ReturnReceiveParams,+ ReturnRefundParams,+ SellerExportCreateParams,+ SellerTaxIdentifierParams,+ ShippingLabelCreateParams,+ StockLocationParams,+ TeamMemberCreateParams,+} from './types/params'++export type * from './types/params'/*** Resource methods for the Spree Seller API — the marketplace seller panel.@@ -85,10 +131,7 @@ export class SellerClient {* Signs a seller in. Fails for a store staff member who runs no seller —* authenticating is not enough, since staff share the same user class.*/- login: (- params: { email: string; password: string },- options?: RequestOptions,- ): Promise<AuthTokens> =>+ login: (params: LoginParams, options?: RequestOptions): Promise<AuthTokens> =>this.request<AuthTokens>('POST', '/auth/login', { ...options, body: params }),/** Exchanges the refresh cookie for a fresh access token. */@@ -125,12 +168,7 @@ export class SellerClient {acceptInvitation: (invitationId: string,token: string,- params: {- password?: string- password_confirmation?: string- first_name?: string- last_name?: string- },+ params: InvitationAcceptParams,options?: RequestOptions,): Promise<AuthTokens> =>this.request<AuthTokens>('POST', `/auth/invitations/${invitationId}/accept`, {@@ -147,7 +185,7 @@ export class SellerClient {* origin the server resolves for itself.*/requestPasswordReset: (- params: { email: string; redirect_url?: string },+ params: PasswordResetCreateParams,options?: RequestOptions,): Promise<void> =>this.request<void>('POST', '/auth/password_resets', { ...options, body: params }),@@ -160,7 +198,7 @@ export class SellerClient {*/resetPassword: (token: string,- params: { password: string; password_confirmation: string },+ params: PasswordResetUpdateParams,options?: RequestOptions,): Promise<AuthTokens> =>this.request<AuthTokens>('PATCH', `/auth/password_resets/${encodeURIComponent(token)}`, {@@ -257,7 +295,7 @@ export class SellerClient {* Invites a colleague. They join when they accept; the seller's own* lifecycle is untouched, since hiring is not a transition.*/- invite: (params: { email: string }, options?: RequestOptions): Promise<unknown> =>+ invite: (params: TeamMemberCreateParams, options?: RequestOptions): Promise<unknown> =>this.request<unknown>('POST', '/team', { ...options, body: params }),/** Revokes a member's access. The last remaining member cannot be removed. */@@ -303,7 +341,7 @@ export class SellerClient {* paying by hand collects those details itself.*/payoutAccount: (- data: { refresh_url: string; return_url: string },+ data: OnboardingPayoutAccountParams,options?: RequestOptions,): Promise<PayoutAccountLink> =>this.request<PayoutAccountLink>('POST', '/onboarding/payout_account', {@@ -416,7 +454,10 @@ export class SellerClient {* `skipped_count` — present only when something was skipped — is what was* already on sale, already in review, or archived.*/- bulkSubmit: (params: { ids: string[] }, options?: RequestOptions): Promise<BulkProductResult> =>+ bulkSubmit: (+ params: ProductBulkSubmitParams,+ options?: RequestOptions,+ ): Promise<BulkProductResult> =>this.request('POST', '/products/bulk_submit', { ...options, body: params }),/**@@ -426,7 +467,7 @@ export class SellerClient {* marketplace approves it, one at a time.*/bulkStatusUpdate: (- params: { ids: string[]; status: 'draft' | 'archived' },+ params: ProductBulkStatusParams,options?: RequestOptions,): Promise<BulkProductResult> =>this.request('POST', '/products/bulk_status_update', { ...options, body: params }),@@ -480,16 +521,7 @@ export class SellerClient {* `refund_amount`: withdrawing from the whole order returns what that* order was paid, and a partial figure is a return.*/- cancel: (- id: string,- params?: {- cancel_reason_id?: string- cancel_note?: string- refund_payments?: boolean- notify_customer?: boolean- },- options?: RequestOptions,- ): Promise<Order> =>+ cancel: (id: string, params?: OrderCancelParams, options?: RequestOptions): Promise<Order> =>this.request<Order>('PATCH', `/orders/${id}/cancel`, { ...options, body: params }),/**@@ -500,10 +532,7 @@ export class SellerClient {*/address: (id: string,- params: {- shipping_address?: OrderAddressParams- billing_address?: OrderAddressParams- },+ params: OrderAddressCorrectionParams,options?: RequestOptions,): Promise<Order> =>this.request<Order>('PATCH', `/orders/${id}/address`, { ...options, body: params }),@@ -526,7 +555,7 @@ export class SellerClient {*/update: (orderId: string,- params: { customer_note?: string; internal_note?: string },+ params: OrderNotesParams,options?: RequestOptions,): Promise<Order> =>this.request<Order>('PATCH', `/orders/${orderId}/notes`, { ...options, body: params }),@@ -547,12 +576,7 @@ export class SellerClient {fulfill: (orderId: string,id: string,- params?: {- tracking?: string- tracking_carrier?: string- notify_customer?: boolean- items?: Array<{ item_id: string; quantity: number }>- },+ params?: FulfillmentFulfillParams,options?: RequestOptions,): Promise<Fulfillment> =>this.request<Fulfillment>('PATCH', `/orders/${orderId}/fulfillments/${id}/fulfill`, {@@ -567,14 +591,7 @@ export class SellerClient {update: (orderId: string,id: string,- params: {- tracking?: string- tracking_carrier?: string- /** One of this seller's own shelves; the rates requote from there. */- stock_location_id?: string- /** One of the rates quoted for this parcel from its current origin. */- selected_delivery_rate_id?: string- },+ params: FulfillmentUpdateParams,options?: RequestOptions,): Promise<Fulfillment> =>this.request<Fulfillment>('PATCH', `/orders/${orderId}/fulfillments/${id}`, {@@ -594,7 +611,7 @@ export class SellerClient {split: (orderId: string,id: string,- params: { variant_id: string; quantity: number; stock_location_id?: string },+ params: FulfillmentSplitParams,options?: RequestOptions,): Promise<{ data: Fulfillment[] }> =>this.request<{ data: Fulfillment[] }>(@@ -634,12 +651,7 @@ export class SellerClient {create: (orderId: string,fulfillmentId: string,- params: {- tracking_number: string- carrier?: string- service?: string- tracking_url?: string- },+ params: DeliveryCreateParams,options?: RequestOptions,): Promise<Delivery> =>this.request<Delivery>(@@ -652,12 +664,7 @@ export class SellerClient {orderId: string,fulfillmentId: string,id: string,- params: {- tracking_number?: string- carrier?: string- service?: string- tracking_url?: string- },+ params: DeliveryUpdateParams,options?: RequestOptions,): Promise<Delivery> =>this.request<Delivery>(@@ -714,16 +721,7 @@ export class SellerClient {create: (orderId: string,fulfillmentId: string,- params: {- file_signed_id: string- tracking_number: string- carrier?: string- service?: string- cost?: string | number- currency?: string- file_format?: string- tracking_url?: string- },+ params: ShippingLabelCreateParams,options?: RequestOptions,): Promise<ShippingLabel> =>this.request<ShippingLabel>(@@ -767,12 +765,7 @@ export class SellerClient {create: (orderId: string,- params: {- items: Array<{ fulfillment_item_id: string; quantity: number }>- memo?: string- reason_id?: string- stock_location_id?: string- },+ params: ReturnCreateParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('POST', `/orders/${orderId}/returns`, { ...options, body: params }),@@ -784,9 +777,7 @@ export class SellerClient {receive: (orderId: string,id: string,- params?: {- items?: Array<{ return_line_item_id: string; quantity: number; resellable?: boolean }>- },+ params?: ReturnReceiveParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('PATCH', `/orders/${orderId}/returns/${id}/receive`, {@@ -798,7 +789,7 @@ export class SellerClient {refund: (orderId: string,id: string,- params?: { amount?: string; refund_method?: 'original_payment' | 'store_credit' },+ params?: ReturnRefundParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('PATCH', `/orders/${orderId}/returns/${id}/refund`, {@@ -809,7 +800,7 @@ export class SellerClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ReturnCancelParams,options?: RequestOptions,): Promise<Return> =>this.request<Return>('PATCH', `/orders/${orderId}/returns/${id}/cancel`, {@@ -842,12 +833,7 @@ export class SellerClient {create: (orderId: string,- params: {- items: Array<{ fulfillment_item_id: string; new_variant_id: string; quantity: number }>- memo?: string- reason_id?: string- stock_location_id?: string- },+ params: ExchangeCreateParams,options?: RequestOptions,): Promise<Exchange> =>this.request<Exchange>('POST', `/orders/${orderId}/exchanges`, {@@ -861,9 +847,7 @@ export class SellerClient {receive: (orderId: string,id: string,- params?: {- items?: Array<{ exchange_line_item_id: string; quantity: number; resellable?: boolean }>- },+ params?: ExchangeReceiveParams,options?: RequestOptions,): Promise<Exchange> =>this.request<Exchange>('PATCH', `/orders/${orderId}/exchanges/${id}/receive`, {@@ -875,7 +859,7 @@ export class SellerClient {fulfill: (orderId: string,id: string,- params?: { refund_method?: 'original_payment' | 'store_credit' },+ params?: ExchangeFulfillParams,options?: RequestOptions,): Promise<Exchange> =>this.request<Exchange>('PATCH', `/orders/${orderId}/exchanges/${id}/fulfill`, {@@ -886,7 +870,7 @@ export class SellerClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ExchangeCancelParams,options?: RequestOptions,): Promise<Exchange> =>this.request<Exchange>('PATCH', `/orders/${orderId}/exchanges/${id}/cancel`, {@@ -916,18 +900,7 @@ export class SellerClient {create: (orderId: string,- params: {- items: Array<{- line_item_id: string- quantity: number- description?: string- send_replacement?: boolean- replacement_variant_id?: string- refund_amount?: string- }>- memo?: string- reason_id?: string- },+ params: ClaimCreateParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('POST', `/orders/${orderId}/claims`, { ...options, body: params }),@@ -939,12 +912,7 @@ export class SellerClient {resolve: (orderId: string,id: string,- params: {- resolution: 'refund' | 'replacement' | 'refund_and_replacement'- refund_method?: 'original_payment' | 'store_credit'- amount?: string- replacement_line_item_ids?: string[]- },+ params: ClaimResolveParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('PATCH', `/orders/${orderId}/claims/${id}/resolve`, {@@ -955,7 +923,7 @@ export class SellerClient {deny: (orderId: string,id: string,- params?: { reason?: string },+ params?: ClaimDenyParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('PATCH', `/orders/${orderId}/claims/${id}/deny`, {@@ -966,7 +934,7 @@ export class SellerClient {cancel: (orderId: string,id: string,- params?: { reason?: string },+ params?: ClaimCancelParams,options?: RequestOptions,): Promise<Claim> =>this.request<Claim>('PATCH', `/orders/${orderId}/claims/${id}/cancel`, {@@ -1395,26 +1363,6 @@ export class SellerClient {}}-/**- * What a seller may write when publishing a policy. `name` is required — it is- * how the marketplace's onboarding check finds the document.- *- * `body` takes HTML and is sanitized server-side; `body_html` is the- * read-only rendering of what was stored.- */-export interface PolicyCreateParams {- name: string- slug?: string- body?: string | null-}--/** What a seller may change on a policy they already published. */-export interface PolicyUpdateParams {- name?: string- slug?: string- body?: string | null-}-/*** API shorthand for an import type, not the Ruby class name.*@@ -1424,23 +1372,6 @@ export interface PolicyUpdateParams {*/export type SellerImportType = 'products'-export interface ImportCreateParams {- type: SellerImportType- /**- * The `signed_id` of the uploaded CSV, from `files.upload()` with- * `visibility: 'private'`.- */- attachment_signed_id: string- /** CSV column separator. Defaults to a comma on the server. */- delimiter?: ',' | ';' | '|' | '\t'- /**- * Absolute URL of the panel's imports view; the import-done email links back- * to it with `?import=<id>` appended. Honored only when it matches one of- * the store's configured allowed origins.- */- results_url?: string-}-export interface ImportMappingParam {/** Canonical schema field name (see `Import.schema_fields[].name`). */schema_field: string@@ -1448,48 +1379,7 @@ export interface ImportMappingParam {file_column: string | null}-export interface ImportCompleteMappingParams {- /** Column assignments to apply before processing starts. */- mappings?: ImportMappingParam[]-}-/** What a seller may write on one of their stock locations. */-/**- * One condition on a delivery method as it is written.- *- * Omitting `id` marks a rule as new; dropping one from the array deletes it.- * `type` is a wire shorthand from `deliveryMethods.ruleTypes()` — a kind this- * branch does not offer is a 404, never a silent drop.- */-export interface DeliveryMethodRuleParams {- id?: string- type: string- active?: boolean- preferences?: Record<string, unknown>-}--export interface DeliveryMethodParams {- name?: string- admin_name?: string | null- code?: string | null- /** One of the marketplace's delivery profiles. */- delivery_profile_id?: string- /** Narrows where the method ships; null serves everywhere the profile reaches. */- delivery_zone_id?: string | null- storefront_visible?: boolean- tracking_url?: string | null- estimated_transit_business_days_min?: number | null- estimated_transit_business_days_max?: number | null- /**- * How the method prices a shipment: the calculator's `type` (see- * `deliveryMethods.calculators()`) and its preferences, which must match the- * `schema` that list carries.- */- calculator?: { type?: string; preferences?: Record<string, unknown> }- /** Replaces the whole set; an empty array clears every condition. */- rules?: DeliveryMethodRuleParams[]-}-export interface DeliveryZoneListParams extends ListParams {/** Only zones under this delivery profile. */delivery_profile_id?: string@@ -1513,41 +1403,6 @@ export interface DeliveryMethodRuleType {schema: PreferenceSchema}-/**- * Measurements a seller records for their own packaging. `default` marks the- * box their parcels are quoted with — one per seller, so it never displaces- * the marketplace's.- */-export interface PackageTypeParams {- name?: string- kind?: string- length?: string | number | null- width?: string | number | null- height?: string | number | null- dimensions_unit?: string | null- weight?: string | number | null- max_weight?: string | number | null- weight_unit?: string | null- default?: boolean- metadata?: Record<string, unknown>-}--export interface StockLocationParams {- name?: string- company?: string | null- address1?: string | null- address2?: string | null- city?: string | null- zipcode?: string | null- country_code?: string | null- state_code?: string | null- state_name?: string | null- phone?: string | null- active?: boolean- default?: boolean- kind?: string-}-/*** The datasets a seller may export.*@@ -1557,36 +1412,6 @@ export interface StockLocationParams {*/export type SellerExportType = 'orders' | 'products'-export interface SellerExportCreateParams {- type: SellerExportType- /**- * Ransack query hash, the same predicate shape the list endpoints take- * (`{ number_cont: 'R12' }`). Ignored when `record_selection` is `'all'`.- */- search_params?: Record<string, unknown>- /**- * `'filtered'` (default) keeps `search_params`; `'all'` clears them on the- * server and exports everything this seller owns.- */- record_selection?: 'filtered' | 'all'- /**- * Absolute URL of the panel view to send the seller back to; the- * export-done email uses it as the download button's target. Honored only- * when it matches one of the store's allowed origins.- *- * Passed by the panel rather than derived server-side, because only the- * panel knows where it is mounted — a seller panel is served from a path- * under the store as often as from a host of its own.- */- results_url?: string-}--/** What a seller sends when recording a registration. */-export interface SellerTaxIdentifierParams {- kind: string- value: string-}-/** A country as the address form needs it. */export interface SellerCountry {iso: string@@ -1616,14 +1441,6 @@ export interface OnboardingResponse {requirements: RequirementStatus[]}-/** What a seller says about one requirement. */-export interface RequirementSubmissionParams {- note?: string- reference?: string- /** A `signed_id` from `files.upload()`, for kinds that ask for a document. */- file_signed_id?: string-}-/** The fields a seller may set on their own product. *//*** What a bulk product action did. `skipped_count` is present only when the@@ -1635,91 +1452,6 @@ export interface BulkProductResult {skipped_count?: number}-export interface ProductParams {- name?: string- description?: string- slug?: string- meta_title?: string- meta_description?: string- meta_keywords?: string- metadata?: Record<string, unknown>- /**- * The marketplace's type this product is listed against, from- * `productTypes.list()`. `null` detaches it. Saving with a type seeds its- * option types onto the product.- */- product_type_id?: string | null- /**- * Which of the marketplace's delivery profiles the product ships under,- * from `deliveryProfiles.list()`. A new product sent without one lands on- * the profile marked `default`.- */- delivery_profile_id?: string- /**- * The gallery, as a whole. A file absent from the list is removed, so send- * every image the product should end up with. `signed_id` attaches a fresh- * upload; `id` patches one already there.- */- media?: Array<{- id?: string- signed_id?: string- alt?: string | null- position?: number- media_type?: string- external_video_url?: string | null- focal_point_x?: number | null- focal_point_y?: number | null- variant_ids?: string[]- }>- /**- * The variants, as a whole — one absent from the list is removed. Tax- * category and delivery profile are deliberately absent: they are- * marketplace configuration and the API ignores them here.- */- variants?: Array<{- id?: string- sku?: string- barcode?: string | null- cost_price?: string | number | null- cost_currency?: string | null- weight?: string | number | null- height?: string | number | null- width?: string | number | null- depth?: string | number | null- weight_unit?: string | null- dimensions_unit?: string | null- hs_code?: string | null- country_of_origin?: string | null- customs_description?: string | null- track_inventory?: boolean- preorderable?: boolean- preorder_ships_at?: string | null- backorder_limit?: number | null- position?: number- options?: Array<{ name: string; value: string }>- prices?: Array<{- amount: string | number- compare_at_amount?: string | number- currency?: string- }>- stock_levels?: Array<{- id?: string- stock_location_id?: string- count_on_hand?: number- backorderable?: boolean- }>- }>- /**- * Omit `currency` and the price is recorded in the store's, which is the- * only place that knows it. A seller has no currency of their own to read.- */- prices?: Array<{- amount: string | number- compare_at_amount?: string | number- currency?: string- }>-}-/** What `/seller/me` answers. *//*** One CanCanCan rule, in the shape the panels' `<Can>` reads. Identical to@@ -1769,86 +1501,3 @@ export interface MeResource {*/update(params: AccountUpdateParams, options?: RequestOptions): Promise<MeResponse>}--/** What a seller may change on their own account. */-export interface AccountUpdateParams {- first_name?: string- last_name?: string- /** The panel's UI language, as a bundle code the panel ships (e.g. `de`). */- selected_locale?: string- /**- * A `signed_id` from `files.upload()` to set the photo, or `null` to remove- * it. Omit to leave the current one alone.- */- avatar_signed_id?: string | null-}--/** The fields a seller may change on their own record. */-export interface ProfileUpdateParams {- name?: string- contact_email?: string | null- billing_email?: string | null- /** Sanitized HTML — the seller's public description. */- about?: string | null- /** `signed_id`s from `files.upload()`; `null` removes the image. */- logo_signed_id?: string | null- square_logo_signed_id?: string | null- cover_photo_signed_id?: string | null- /** The business a commission invoice is made out to. */- legal_name?: string | null- registration_number?: string | null- /**- * The seller's tax registration. One per kind — re-sending a kind corrects- * the number, and an empty value removes it. A changed number drops its- * validation verdict, since that answer was about the old one.- */- billing_address?: SellerAddressParams- /**- * Answers to the custom fields this marketplace's onboarding asks for.- * Narrowed server-side to those definitions — a field nothing asked for is- * ignored rather than written.- */- custom_fields?: Array<{ custom_field_definition_id: string; value: unknown }>- /**- * Accepts the marketplace's terms, stamping the moment. One-way: the stamp- * records that it happened, so sending `false` does not unmake it.- */- accept_terms?: boolean-}--/**- * A correction to one of an order's addresses. Every field is optional: send- * the lines that change and the rest of the address is carried over.- */-export interface OrderAddressParams {- first_name?: string- last_name?: string- company?: string- address1?: string- address2?: string- city?: string- postal_code?: string- zipcode?: string- phone?: string- alternative_phone?: string- country_code?: string- state_code?: string- state_name?: string- label?: string-}--export interface SellerAddressParams {- first_name?: string- last_name?: string- company?: string- address1?: string- address2?: string- city?: string- postal_code?: string- zipcode?: string- phone?: string- country_code?: string- state_code?: string- state_name?: string- label?: string-}diff --git a/packages/seller-sdk/src/types/generated/Media.ts b/packages/seller-sdk/src/types/generated/Media.tsindex e2408a9049..c9c2ca65df 100644--- a/packages/seller-sdk/src/types/generated/Media.ts+++ b/packages/seller-sdk/src/types/generated/Media.ts@@ -1,4 +1,4 @@-// Typelizer digest 8124246af0f3c6728923b925e3b6034b+// Typelizer digest becc137165a218235666651f0c1c3e57//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -9,9 +9,9 @@ type Media = {position: number;alt: string | null;media_type: 'image' | 'video' | 'external_video';+ external_video_url: string | null;focal_point_x: number | null;focal_point_y: number | null;- external_video_url: string | null;video_provider: string | null;video_embed_url: string | null;video_url: string | null;diff --git a/packages/seller-sdk/src/types/params/AccountUpdateParams.ts b/packages/seller-sdk/src/types/params/AccountUpdateParams.tsnew file mode 100644index 0000000000..4ff0662ecb--- /dev/null+++ b/packages/seller-sdk/src/types/params/AccountUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type AccountUpdateParams = {+ first_name?: string+ last_name?: string+ /** The panel's display language, as a code the panel ships. */+ selected_locale?: string+ /**+ * A `signed_id` from `POST /files` to set the photo, or `null` to remove it. Omit to leave the+ * current one alone.+ */+ avatar_signed_id?: string | null+}diff --git a/packages/seller-sdk/src/types/params/ClaimCancelParams.ts b/packages/seller-sdk/src/types/params/ClaimCancelParams.tsnew file mode 100644index 0000000000..abf118988b--- /dev/null+++ b/packages/seller-sdk/src/types/params/ClaimCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimCancelParams = {+ /** A note on why the claim was canceled. */+ reason?: string+}diff --git a/packages/seller-sdk/src/types/params/ClaimCreateParams.ts b/packages/seller-sdk/src/types/params/ClaimCreateParams.tsnew file mode 100644index 0000000000..7b9fb46403--- /dev/null+++ b/packages/seller-sdk/src/types/params/ClaimCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimCreateParams = {+ items: {+ line_item_id: string+ quantity: number+ description?: string | null+ send_replacement?: boolean+ /** One of this seller's own variants. */+ replacement_variant_id?: string | null+ refund_amount?: string | null+ }[]+ reason_id?: string | null+ memo?: string | null+}diff --git a/packages/seller-sdk/src/types/params/ClaimDenyParams.ts b/packages/seller-sdk/src/types/params/ClaimDenyParams.tsnew file mode 100644index 0000000000..45cb4e1e8f--- /dev/null+++ b/packages/seller-sdk/src/types/params/ClaimDenyParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimDenyParams = {+ /** Recorded on the claim for the customer. */+ reason?: string+}diff --git a/packages/seller-sdk/src/types/params/ClaimResolveParams.ts b/packages/seller-sdk/src/types/params/ClaimResolveParams.tsnew file mode 100644index 0000000000..bbcc0bf5ba--- /dev/null+++ b/packages/seller-sdk/src/types/params/ClaimResolveParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ClaimResolveParams = {+ resolution: 'refund' | 'replacement' | 'refund_and_replacement'+ /** Defaults to `store_credit`. */+ refund_method?: 'original_payment' | 'store_credit'+ amount?: string | null+ /** Which claimed lines to replace. Omit to keep the lines the claim was opened with. */+ replacement_line_item_ids?: string[]+}diff --git a/packages/seller-sdk/src/types/params/CustomFieldValueParams.ts b/packages/seller-sdk/src/types/params/CustomFieldValueParams.tsnew file mode 100644index 0000000000..47417a8abc--- /dev/null+++ b/packages/seller-sdk/src/types/params/CustomFieldValueParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type CustomFieldValueParams = {+ id?: string+ custom_field_definition_id?: string+ /** A scalar for text, number and boolean fields; a list or a hash for JSON fields. */+ value?: unknown+}diff --git a/packages/seller-sdk/src/types/params/DeliveryCreateParams.ts b/packages/seller-sdk/src/types/params/DeliveryCreateParams.tsnew file mode 100644index 0000000000..057a9e0b0f--- /dev/null+++ b/packages/seller-sdk/src/types/params/DeliveryCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryCreateParams = {+ /**+ * A carrier tracking number, a freight PRO or container number, or a full tracking link. A+ * corrected number resets the carrier status to `pending`.+ */+ tracking_number: string+ /** Free text; detected from the number's format when omitted. */+ carrier?: string+ service?: string+ tracking_url?: string+}diff --git a/packages/seller-sdk/src/types/params/DeliveryMethodParams.ts b/packages/seller-sdk/src/types/params/DeliveryMethodParams.tsnew file mode 100644index 0000000000..070f0aff05--- /dev/null+++ b/packages/seller-sdk/src/types/params/DeliveryMethodParams.ts@@ -0,0 +1,30 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { DeliveryMethodRuleParams } from './DeliveryMethodRuleParams'++export type DeliveryMethodParams = {+ name?: string+ admin_name?: string | null+ code?: string | null+ /** One of the marketplace's delivery profiles. */+ delivery_profile_id?: string+ /** Narrows where the method ships; null serves everywhere the profile reaches. */+ delivery_zone_id?: string | null+ storefront_visible?: boolean+ tracking_url?: string | null+ estimated_transit_business_days_min?: number | null+ estimated_transit_business_days_max?: number | null+ /**+ * How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per+ * that type's `schema`.+ */+ calculator?: {+ type?: string+ preferences?: Record<string, unknown>+ }+ /**+ * Replaces the whole set: a rule dropped here is deleted, so re-send surviving rules with their+ * `id`. An empty list clears every condition.+ */+ rules?: DeliveryMethodRuleParams[]+}diff --git a/packages/seller-sdk/src/types/params/DeliveryMethodRuleParams.ts b/packages/seller-sdk/src/types/params/DeliveryMethodRuleParams.tsnew file mode 100644index 0000000000..ae8b687b51--- /dev/null+++ b/packages/seller-sdk/src/types/params/DeliveryMethodRuleParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryMethodRuleParams = {+ id?: string+ /** A type from `/delivery_methods/rule_types`. */+ type: string+ active?: boolean+ preferences?: Record<string, unknown>+}diff --git a/packages/seller-sdk/src/types/params/DeliveryUpdateParams.ts b/packages/seller-sdk/src/types/params/DeliveryUpdateParams.tsnew file mode 100644index 0000000000..fd7c1ab316--- /dev/null+++ b/packages/seller-sdk/src/types/params/DeliveryUpdateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type DeliveryUpdateParams = {+ /**+ * A carrier tracking number, a freight PRO or container number, or a full tracking link. A+ * corrected number resets the carrier status to `pending`.+ */+ tracking_number?: string+ /** Free text; detected from the number's format when omitted. */+ carrier?: string+ service?: string+ tracking_url?: string+}diff --git a/packages/seller-sdk/src/types/params/ExchangeCancelParams.ts b/packages/seller-sdk/src/types/params/ExchangeCancelParams.tsnew file mode 100644index 0000000000..29ed0e3de7--- /dev/null+++ b/packages/seller-sdk/src/types/params/ExchangeCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeCancelParams = {+ /** A note on why the exchange was canceled. */+ reason?: string+}diff --git a/packages/seller-sdk/src/types/params/ExchangeCreateParams.ts b/packages/seller-sdk/src/types/params/ExchangeCreateParams.tsnew file mode 100644index 0000000000..c4807067ef--- /dev/null+++ b/packages/seller-sdk/src/types/params/ExchangeCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeCreateParams = {+ items: {+ fulfillment_item_id: string+ /** One of this seller's own variants. */+ new_variant_id: string+ quantity: number+ }[]+ reason_id?: string | null+ /** One of this seller's own stock locations, where the goods are restocked. */+ stock_location_id?: string | null+ memo?: string | null+}diff --git a/packages/seller-sdk/src/types/params/ExchangeFulfillParams.ts b/packages/seller-sdk/src/types/params/ExchangeFulfillParams.tsnew file mode 100644index 0000000000..d3117d6532--- /dev/null+++ b/packages/seller-sdk/src/types/params/ExchangeFulfillParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeFulfillParams = {+ /** Defaults to `store_credit`. */+ refund_method?: 'original_payment' | 'store_credit'+}diff --git a/packages/seller-sdk/src/types/params/ExchangeReceiveParams.ts b/packages/seller-sdk/src/types/params/ExchangeReceiveParams.tsnew file mode 100644index 0000000000..055ff8708f--- /dev/null+++ b/packages/seller-sdk/src/types/params/ExchangeReceiveParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ExchangeReceiveParams = {+ /** What actually arrived. Omit to receive everything as requested and resellable. */+ items?: {+ exchange_line_item_id: string+ quantity: number+ /** Goods that cannot be resold are received but never restocked. Defaults to true. */+ resellable?: boolean+ }[]+}diff --git a/packages/seller-sdk/src/types/params/FileUploadCreateParams.ts b/packages/seller-sdk/src/types/params/FileUploadCreateParams.tsnew file mode 100644index 0000000000..62658215ef--- /dev/null+++ b/packages/seller-sdk/src/types/params/FileUploadCreateParams.ts@@ -0,0 +1,13 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FileUploadCreateParams = {+ filename: string+ content_type: string+ byte_size?: number+ /** Base64-encoded MD5 digest of the file; the storage service checks the bytes against it. */+ checksum?: string+ /** `public` (the default) for web images, videos and CSV, `private` for any type. */+ visibility?: 'public' | 'private'+ /** The bytes, for a multipart upload. */+ file?: string+}diff --git a/packages/seller-sdk/src/types/params/FulfillmentFulfillParams.ts b/packages/seller-sdk/src/types/params/FulfillmentFulfillParams.tsnew file mode 100644index 0000000000..aeb73bc242--- /dev/null+++ b/packages/seller-sdk/src/types/params/FulfillmentFulfillParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentFulfillParams = {+ /** Carrier tracking number. */+ tracking?: string+ /** Carrier name. */+ tracking_carrier?: string+ /** Send the dispatch email (default true). */+ notify_customer?: boolean+ /** Ship only these lines; the rest split onto a new fulfillment. */+ items?: {+ /** Prefixed line item ID. */+ item_id: string+ quantity: number+ }[]+}diff --git a/packages/seller-sdk/src/types/params/FulfillmentSplitParams.ts b/packages/seller-sdk/src/types/params/FulfillmentSplitParams.tsnew file mode 100644index 0000000000..258742899f--- /dev/null+++ b/packages/seller-sdk/src/types/params/FulfillmentSplitParams.ts@@ -0,0 +1,9 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentSplitParams = {+ /** The variant being moved out. */+ variant_id: string+ quantity: number+ /** One of this seller's own stock locations. Defaults to the source fulfillment's location. */+ stock_location_id?: string+}diff --git a/packages/seller-sdk/src/types/params/FulfillmentUpdateParams.ts b/packages/seller-sdk/src/types/params/FulfillmentUpdateParams.tsnew file mode 100644index 0000000000..6d8ce83522--- /dev/null+++ b/packages/seller-sdk/src/types/params/FulfillmentUpdateParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type FulfillmentUpdateParams = {+ tracking?: string | null+ tracking_carrier?: string | null+ /** One of this seller's own stock locations; the rates requote from there. */+ stock_location_id?: string+ /** One of the rates quoted for this parcel from its current origin. */+ selected_delivery_rate_id?: string+}diff --git a/packages/seller-sdk/src/types/params/ImportCompleteMappingParams.ts b/packages/seller-sdk/src/types/params/ImportCompleteMappingParams.tsnew file mode 100644index 0000000000..22c4ede797--- /dev/null+++ b/packages/seller-sdk/src/types/params/ImportCompleteMappingParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ImportCompleteMappingParams = {+ /** Column assignments to apply before processing starts. */+ mappings?: {+ /** Canonical schema field name. */+ schema_field: string+ /** CSV header to read the field from; `null` unmaps the field. */+ file_column: string | null+ }[]+}diff --git a/packages/seller-sdk/src/types/params/ImportCreateParams.ts b/packages/seller-sdk/src/types/params/ImportCreateParams.tsnew file mode 100644index 0000000000..9af8802697--- /dev/null+++ b/packages/seller-sdk/src/types/params/ImportCreateParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ImportCreateParams = {+ type: 'products'+ /** The `signed_id` of the uploaded CSV, from `POST /files` with `visibility: 'private'`. */+ attachment_signed_id: string+ /** CSV column separator. Defaults to a comma. */+ delimiter?: string+ /**+ * Absolute URL of the panel's imports view; the import-done email links back to it. Honored only+ * when it matches one of the store's allowed origins.+ */+ results_url?: string+}diff --git a/packages/seller-sdk/src/types/params/InvitationAcceptParams.ts b/packages/seller-sdk/src/types/params/InvitationAcceptParams.tsnew file mode 100644index 0000000000..973c397dc8--- /dev/null+++ b/packages/seller-sdk/src/types/params/InvitationAcceptParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type InvitationAcceptParams = {+ /** Sets the password of a new account, or confirms the password of an existing one. */+ password?: string+ password_confirmation?: string+ /** Used only when the invitation creates a new account. */+ first_name?: string+ /** Used only when the invitation creates a new account. */+ last_name?: string+}diff --git a/packages/seller-sdk/src/types/params/LoginParams.ts b/packages/seller-sdk/src/types/params/LoginParams.tsnew file mode 100644index 0000000000..2ff07444cb--- /dev/null+++ b/packages/seller-sdk/src/types/params/LoginParams.ts@@ -0,0 +1,8 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type LoginParams = {+ /** The authentication method. Defaults to `email`. */+ provider?: 'email'+ email: string+ password: string+}diff --git a/packages/seller-sdk/src/types/params/OnboardingPayoutAccountParams.ts b/packages/seller-sdk/src/types/params/OnboardingPayoutAccountParams.tsnew file mode 100644index 0000000000..8cf8c0db5a--- /dev/null+++ b/packages/seller-sdk/src/types/params/OnboardingPayoutAccountParams.ts@@ -0,0 +1,14 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OnboardingPayoutAccountParams = {+ /**+ * Where the provider sends the seller back. Must be on the seller panel's origin; any other+ * address is replaced with the panel's.+ */+ refresh_url: string+ /**+ * Where the provider sends the seller back. Must be on the seller panel's origin; any other+ * address is replaced with the panel's.+ */+ return_url: string+}diff --git a/packages/seller-sdk/src/types/params/OrderAddressCorrectionParams.ts b/packages/seller-sdk/src/types/params/OrderAddressCorrectionParams.tsnew file mode 100644index 0000000000..eb3810759a--- /dev/null+++ b/packages/seller-sdk/src/types/params/OrderAddressCorrectionParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { OrderAddressParams } from './OrderAddressParams'++export type OrderAddressCorrectionParams = {+ /** Only the lines that change; the rest of the address is carried over. */+ shipping_address?: OrderAddressParams+ /** Only the lines that change; the rest of the address is carried over. */+ billing_address?: OrderAddressParams+}diff --git a/packages/seller-sdk/src/types/params/OrderAddressParams.ts b/packages/seller-sdk/src/types/params/OrderAddressParams.tsnew file mode 100644index 0000000000..6fd79d7016--- /dev/null+++ b/packages/seller-sdk/src/types/params/OrderAddressParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderAddressParams = {+ first_name?: string+ last_name?: string+ address1?: string+ city?: string+ postal_code?: string+ zipcode?: string+ company?: string | null+ address2?: string | null+ phone?: string | null+ alternative_phone?: string | null+ state_code?: string | null+ state_name?: string | null+ label?: string | null+ country_code?: string+}diff --git a/packages/seller-sdk/src/types/params/OrderCancelParams.ts b/packages/seller-sdk/src/types/params/OrderCancelParams.tsnew file mode 100644index 0000000000..e4df1d28dc--- /dev/null+++ b/packages/seller-sdk/src/types/params/OrderCancelParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderCancelParams = {+ /** A reason from the order cancellation reasons endpoint. */+ cancel_reason_id?: string | null+ /** Free text beside the reason. */+ cancel_note?: string | null+ /** Hand back what the buyer paid for this order's goods. */+ refund_payments?: boolean+ /** Email the customer about the cancellation. */+ notify_customer?: boolean+}diff --git a/packages/seller-sdk/src/types/params/OrderNotesParams.ts b/packages/seller-sdk/src/types/params/OrderNotesParams.tsnew file mode 100644index 0000000000..d057aef89f--- /dev/null+++ b/packages/seller-sdk/src/types/params/OrderNotesParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type OrderNotesParams = {+ /** What the buyer asked for. */+ customer_note?: string | null+ /**+ * The seller's own working note, as HTML. Sanitized on save; `internal_note_html` reads it back.+ */+ internal_note?: string | null+}diff --git a/packages/seller-sdk/src/types/params/PackageTypeParams.ts b/packages/seller-sdk/src/types/params/PackageTypeParams.tsnew file mode 100644index 0000000000..7e37f5035d--- /dev/null+++ b/packages/seller-sdk/src/types/params/PackageTypeParams.ts@@ -0,0 +1,20 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PackageTypeParams = {+ name?: string+ kind?: 'box' | 'envelope' | 'carton' | 'pallet' | 'container'+ length?: number | null+ width?: number | null+ height?: number | null+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft' | null+ /** The empty package's own weight, added to every quote. */+ weight?: number | null+ max_weight?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz' | null+ /**+ * Makes this the box this seller's parcels are quoted with. One default per seller, so it never+ * displaces the marketplace's.+ */+ default?: boolean+ metadata?: Record<string, unknown> | null+}diff --git a/packages/seller-sdk/src/types/params/PasswordResetCreateParams.ts b/packages/seller-sdk/src/types/params/PasswordResetCreateParams.tsnew file mode 100644index 0000000000..e5076e01ca--- /dev/null+++ b/packages/seller-sdk/src/types/params/PasswordResetCreateParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PasswordResetCreateParams = {+ email: string+ /** Must match an allowed origin of the store; ignored otherwise. */+ redirect_url?: string+}diff --git a/packages/seller-sdk/src/types/params/PasswordResetUpdateParams.ts b/packages/seller-sdk/src/types/params/PasswordResetUpdateParams.tsnew file mode 100644index 0000000000..5bdb4b2368--- /dev/null+++ b/packages/seller-sdk/src/types/params/PasswordResetUpdateParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PasswordResetUpdateParams = {+ password: string+ password_confirmation: string+}diff --git a/packages/seller-sdk/src/types/params/PolicyCreateParams.ts b/packages/seller-sdk/src/types/params/PolicyCreateParams.tsnew file mode 100644index 0000000000..d54cf7a6ac--- /dev/null+++ b/packages/seller-sdk/src/types/params/PolicyCreateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PolicyCreateParams = {+ /**+ * When the marketplace requires a named policy, use that exact name: the onboarding check matches+ * on it.+ */+ name: string+ slug?: string+ /**+ * HTML, sanitized before it is stored. `body_html` on the response is the rendering of what was+ * stored.+ */+ body?: string | null+}diff --git a/packages/seller-sdk/src/types/params/PolicyUpdateParams.ts b/packages/seller-sdk/src/types/params/PolicyUpdateParams.tsnew file mode 100644index 0000000000..775ce75a65--- /dev/null+++ b/packages/seller-sdk/src/types/params/PolicyUpdateParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type PolicyUpdateParams = {+ /**+ * When the marketplace requires a named policy, use that exact name: the onboarding check matches+ * on it.+ */+ name?: string+ slug?: string+ /**+ * HTML, sanitized before it is stored. `body_html` on the response is the rendering of what was+ * stored.+ */+ body?: string | null+}diff --git a/packages/seller-sdk/src/types/params/ProductBulkStatusParams.ts b/packages/seller-sdk/src/types/params/ProductBulkStatusParams.tsnew file mode 100644index 0000000000..bb41f3487e--- /dev/null+++ b/packages/seller-sdk/src/types/params/ProductBulkStatusParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkStatusParams = {+ ids: string[]+ /**+ * A listing goes on sale only when the marketplace approves it, so there is no bulk route onto+ * `active`.+ */+ status: 'draft' | 'archived'+}diff --git a/packages/seller-sdk/src/types/params/ProductBulkSubmitParams.ts b/packages/seller-sdk/src/types/params/ProductBulkSubmitParams.tsnew file mode 100644index 0000000000..8700bee52b--- /dev/null+++ b/packages/seller-sdk/src/types/params/ProductBulkSubmitParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ProductBulkSubmitParams = {+ /** Only drafts and rejected listings are submitted; the rest are counted in `skipped_count`. */+ ids: string[]+}diff --git a/packages/seller-sdk/src/types/params/ProductParams.ts b/packages/seller-sdk/src/types/params/ProductParams.tsnew file mode 100644index 0000000000..0653de123a--- /dev/null+++ b/packages/seller-sdk/src/types/params/ProductParams.ts@@ -0,0 +1,48 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { SellerProductMediaParams } from './SellerProductMediaParams'+import type { SellerProductVariantParams } from './SellerProductVariantParams'++export type ProductParams = {+ name?: string+ description?: string+ slug?: string+ meta_title?: string+ meta_description?: string+ meta_keywords?: string+ metadata?: Record<string, unknown>+ /**+ * The marketplace's product type this product is listed against, from the product types endpoint.+ * Null detaches it. Saving with a type seeds its option types onto the product.+ */+ product_type_id?: string | null+ /**+ * Which of the marketplace's delivery profiles the product ships under. A new product sent+ * without one lands on the profile marked default.+ */+ delivery_profile_id?: string+ /**+ * Shorthand for a simple (no-options) product: per-currency prices that forward to the product's+ * sole variant.+ */+ prices?: {+ /** Omit to price in the store's currency. A seller has no currency of their own. */+ currency?: string+ /**+ * A canonical decimal string (`"1234.56"`: period decimal, no grouping). The API does not parse+ * localized input.+ */+ amount: string+ compare_at_amount?: string | null+ }[]+ /**+ * The gallery, as a whole: a file absent from the list is removed. `signed_id` attaches a fresh+ * upload; `id` updates one already there.+ */+ media?: SellerProductMediaParams[]+ /**+ * The variants, as a whole: one absent from the list is removed. Pass `id` to update an existing+ * variant.+ */+ variants?: SellerProductVariantParams[]+}diff --git a/packages/seller-sdk/src/types/params/ProfileUpdateParams.ts b/packages/seller-sdk/src/types/params/ProfileUpdateParams.tsnew file mode 100644index 0000000000..00539092bb--- /dev/null+++ b/packages/seller-sdk/src/types/params/ProfileUpdateParams.ts@@ -0,0 +1,32 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { CustomFieldValueParams } from './CustomFieldValueParams'+import type { SellerAddressParams } from './SellerAddressParams'++export type ProfileUpdateParams = {+ name?: string+ contact_email?: string | null+ billing_email?: string | null+ /** Sanitized HTML: the seller's public description. */+ about?: string | null+ /** The business a commission invoice is made out to. */+ legal_name?: string | null+ registration_number?: string | null+ /** A `signed_id` from `POST /files`; `null` removes the image. */+ logo_signed_id?: string | null+ /** A `signed_id` from `POST /files`; `null` removes the image. */+ square_logo_signed_id?: string | null+ /** A `signed_id` from `POST /files`; `null` removes the image. */+ cover_photo_signed_id?: string | null+ billing_address?: SellerAddressParams+ /**+ * Answers to the custom fields this marketplace's onboarding asks for. A field nothing asked for+ * is ignored rather than written.+ */+ custom_fields?: CustomFieldValueParams[]+ /**+ * Stamps the moment the seller accepted the marketplace's terms. One-way: sending `false` does+ * not unmake the stamp.+ */+ accept_terms?: boolean+}diff --git a/packages/seller-sdk/src/types/params/RequirementSubmissionParams.ts b/packages/seller-sdk/src/types/params/RequirementSubmissionParams.tsnew file mode 100644index 0000000000..7a2927fca8--- /dev/null+++ b/packages/seller-sdk/src/types/params/RequirementSubmissionParams.ts@@ -0,0 +1,10 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type RequirementSubmissionParams = {+ /** Anything the seller wants to say alongside the submission. */+ note?: string+ /** A reference number or external identifier, for requirements that ask for one. */+ reference?: string+ /** A `signed_id` from `POST /files`, for requirements that ask for a document. */+ file_signed_id?: string+}diff --git a/packages/seller-sdk/src/types/params/ReturnCancelParams.ts b/packages/seller-sdk/src/types/params/ReturnCancelParams.tsnew file mode 100644index 0000000000..9ce90b1524--- /dev/null+++ b/packages/seller-sdk/src/types/params/ReturnCancelParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnCancelParams = {+ /** A note on why the return was canceled. */+ reason?: string+}diff --git a/packages/seller-sdk/src/types/params/ReturnCreateParams.ts b/packages/seller-sdk/src/types/params/ReturnCreateParams.tsnew file mode 100644index 0000000000..c632f18e47--- /dev/null+++ b/packages/seller-sdk/src/types/params/ReturnCreateParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnCreateParams = {+ items: {+ fulfillment_item_id: string+ quantity: number+ }[]+ reason_id?: string | null+ /** One of this seller's own stock locations, where the goods are restocked. */+ stock_location_id?: string | null+ memo?: string | null+}diff --git a/packages/seller-sdk/src/types/params/ReturnReceiveParams.ts b/packages/seller-sdk/src/types/params/ReturnReceiveParams.tsnew file mode 100644index 0000000000..e4d3e5ba71--- /dev/null+++ b/packages/seller-sdk/src/types/params/ReturnReceiveParams.ts@@ -0,0 +1,11 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnReceiveParams = {+ /** What actually arrived. Omit to receive everything as requested and resellable. */+ items?: {+ return_line_item_id: string+ quantity: number+ /** Defaults to true. */+ resellable?: boolean+ }[]+}diff --git a/packages/seller-sdk/src/types/params/ReturnRefundParams.ts b/packages/seller-sdk/src/types/params/ReturnRefundParams.tsnew file mode 100644index 0000000000..67e5cd8b28--- /dev/null+++ b/packages/seller-sdk/src/types/params/ReturnRefundParams.ts@@ -0,0 +1,7 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ReturnRefundParams = {+ amount?: string | null+ /** Defaults to `original_payment`. */+ refund_method?: 'original_payment' | 'store_credit'+}diff --git a/packages/seller-sdk/src/types/params/SellerAddressParams.ts b/packages/seller-sdk/src/types/params/SellerAddressParams.tsnew file mode 100644index 0000000000..e8e22266ad--- /dev/null+++ b/packages/seller-sdk/src/types/params/SellerAddressParams.ts@@ -0,0 +1,19 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerAddressParams = {+ first_name?: string+ last_name?: string+ company?: string+ address1?: string+ address2?: string+ city?: string+ postal_code?: string+ zipcode?: string+ phone?: string+ state_name?: string+ label?: string+ /** ISO 3166-1 alpha-2 code, such as `US`. */+ country_code?: string+ /** The state or province abbreviation, such as `NY`. */+ state_code?: string+}diff --git a/packages/seller-sdk/src/types/params/SellerExportCreateParams.ts b/packages/seller-sdk/src/types/params/SellerExportCreateParams.tsnew file mode 100644index 0000000000..598acee3bb--- /dev/null+++ b/packages/seller-sdk/src/types/params/SellerExportCreateParams.ts@@ -0,0 +1,18 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerExportCreateParams = {+ /** Which dataset to export. */+ type: 'orders' | 'products'+ /** `filtered` (default) keeps `search_params`; `all` exports everything this seller owns. */+ record_selection?: 'filtered' | 'all'+ /**+ * Ransack predicates, the same shape the list endpoints take. Ignored when `record_selection` is+ * `all`.+ */+ search_params?: Record<string, unknown>+ /**+ * Panel URL the export-done email links back to. Honored only when it matches one of the store's+ * allowed origins.+ */+ results_url?: string+}diff --git a/packages/seller-sdk/src/types/params/SellerProductMediaParams.ts b/packages/seller-sdk/src/types/params/SellerProductMediaParams.tsnew file mode 100644index 0000000000..127b1eec68--- /dev/null+++ b/packages/seller-sdk/src/types/params/SellerProductMediaParams.ts@@ -0,0 +1,16 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerProductMediaParams = {+ id?: string+ /** A `signed_id` from `POST /files`. */+ signed_id?: string+ alt?: string | null+ position?: number+ media_type?: 'image' | 'video' | 'external_video'+ external_video_url?: string | null+ poster_signed_id?: string+ focal_point_x?: number | null+ focal_point_y?: number | null+ /** Replaces the variants this media is linked to. An empty list clears them. */+ variant_ids?: string[]+}diff --git a/packages/seller-sdk/src/types/params/SellerProductVariantParams.ts b/packages/seller-sdk/src/types/params/SellerProductVariantParams.tsnew file mode 100644index 0000000000..7334ef2db0--- /dev/null+++ b/packages/seller-sdk/src/types/params/SellerProductVariantParams.ts@@ -0,0 +1,60 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++import type { StockLevelParams } from './StockLevelParams'+import type { VariantOptionParams } from './VariantOptionParams'++export type SellerProductVariantParams = {+ id?: string+ sku?: string+ barcode?: string+ cost_price?: string | null+ cost_currency?: string+ weight?: number | null+ height?: number | null+ width?: number | null+ depth?: number | null+ weight_unit?: 'g' | 'kg' | 'lb' | 'oz'+ dimensions_unit?: 'mm' | 'cm' | 'in' | 'ft'+ hs_code?: string+ country_of_origin?: string+ customs_description?: string+ minimum_order_quantity?: number | null+ order_multiple?: number | null+ purchase_unit?: string+ /** How many units fill one carton. */+ units_per_carton?: number | null+ /** The carton this variant is packed into: a package type of kind `carton`. */+ carton_package_type_id?: string | null+ /** What one packed carton weighs, in the variant's weight unit. */+ carton_weight?: number | null+ /** How many cartons stack on one pallet. */+ cartons_per_pallet?: number | null+ track_inventory?: boolean+ preorderable?: boolean+ /** The "ships by" date shown to customers while the variant is a pre-order. Null clears it. */+ preorder_ships_at?: string | null+ /**+ * Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is+ * unlimited.+ */+ backorder_limit?: number | null+ position?: number+ /** One pair per option type the variant takes part in (size, color). */+ options?: VariantOptionParams[]+ /** Per-currency prices. Upserted by currency. */+ prices?: {+ /** Omit to price in the store's currency. A seller has no currency of their own. */+ currency?: string+ /**+ * A canonical decimal string (`"1234.56"`: period decimal, no grouping). The API does not parse+ * localized input.+ */+ amount: string+ compare_at_amount?: string | null+ }[]+ /**+ * Stock per location, at this seller's own locations only: a location belonging to anyone else is+ * ignored.+ */+ stock_levels?: StockLevelParams[]+}diff --git a/packages/seller-sdk/src/types/params/SellerTaxIdentifierParams.ts b/packages/seller-sdk/src/types/params/SellerTaxIdentifierParams.tsnew file mode 100644index 0000000000..b6acb3d283--- /dev/null+++ b/packages/seller-sdk/src/types/params/SellerTaxIdentifierParams.ts@@ -0,0 +1,12 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type SellerTaxIdentifierParams = {+ /**+ * The registration the number belongs to, such as `eu_vat` or `gb_vat`. Any kind is accepted; one+ * with a registered validator is checked by it. Built-in: `eu_vat`. Extensions may register more.+ * One registration per kind.+ */+ kind?: string+ /** A number the validator for its kind refuses is rejected rather than stored. */+ value?: string+}diff --git a/packages/seller-sdk/src/types/params/ShippingLabelCreateParams.ts b/packages/seller-sdk/src/types/params/ShippingLabelCreateParams.tsnew file mode 100644index 0000000000..fe4202f915--- /dev/null+++ b/packages/seller-sdk/src/types/params/ShippingLabelCreateParams.ts@@ -0,0 +1,26 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type ShippingLabelCreateParams = {+ /** A `signed_id` from `files.upload()`. */+ file_signed_id: string+ /** The number printed on the label. */+ tracking_number: string+ /**+ * Free text; a forwarder's name is as valid as a carrier slug. Detected from the number when+ * omitted.+ */+ carrier?: string+ /** Carrier service the label was bought at. */+ service?: string+ /**+ * What the seller paid the carrier. Accounting data only; it never touches the order's shipping+ * charge.+ */+ cost?: string+ /** Currency of the cost. */+ currency?: string+ /** Taken from the file when omitted. */+ file_format?: 'pdf' | 'png' | 'zpl'+ /** Tracking page for the consignment the label mints. */+ tracking_url?: string+}diff --git a/packages/seller-sdk/src/types/params/StockLevelParams.ts b/packages/seller-sdk/src/types/params/StockLevelParams.tsnew file mode 100644index 0000000000..0f83b5e39c--- /dev/null+++ b/packages/seller-sdk/src/types/params/StockLevelParams.ts@@ -0,0 +1,15 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLevelParams = {+ id?: string+ /** The location holding the stock (`sloc_...`). */+ stock_location_id: string+ /**+ * Units physically at the location, not units available to sell: stock promised to placed orders+ * counts until it ships. Sent as the count the shelf should end at; the API records the+ * difference as an adjustment in the stock history.+ */+ count_on_hand: number+ /** Whether this location sells the variant beyond what it holds. */+ backorderable?: boolean+}diff --git a/packages/seller-sdk/src/types/params/StockLocationParams.ts b/packages/seller-sdk/src/types/params/StockLocationParams.tsnew file mode 100644index 0000000000..24d448792f--- /dev/null+++ b/packages/seller-sdk/src/types/params/StockLocationParams.ts@@ -0,0 +1,38 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type StockLocationParams = {+ name?: string+ admin_name?: string | null+ /** Set `false` to retire a location: there is no delete. */+ active?: boolean+ default?: boolean+ /**+ * Categorizes the location. Built-in values: `warehouse`, `store`, `fulfillment_center`;+ * extensions may add their own.+ */+ kind?: string+ propagate_all_variants?: boolean+ backorderable_default?: boolean+ address1?: string | null+ address2?: string | null+ city?: string | null+ zipcode?: string | null+ phone?: string | null+ company?: string | null+ /** ISO-3166 alpha-2 country code. */+ country_code?: string | null+ /** State or province abbreviation, resolved against the selected country's states. */+ state_code?: string | null+ /** Free-text state for countries that don't have a states list. */+ state_name?: string | null+ pickup_enabled?: boolean+ /**+ * `local` collects only items at this location; `any` lets items transfer in from other locations+ * (ship-to-store).+ */+ pickup_stock_policy?: 'local' | 'any'+ pickup_ready_in_minutes?: number | null+ /** Whether customers may send returns to this location. */+ returns_enabled?: boolean+ pickup_instructions?: string | null+}diff --git a/packages/seller-sdk/src/types/params/TeamMemberCreateParams.ts b/packages/seller-sdk/src/types/params/TeamMemberCreateParams.tsnew file mode 100644index 0000000000..cc3b20e771--- /dev/null+++ b/packages/seller-sdk/src/types/params/TeamMemberCreateParams.ts@@ -0,0 +1,5 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type TeamMemberCreateParams = {+ email: string+}diff --git a/packages/seller-sdk/src/types/params/VariantOptionParams.ts b/packages/seller-sdk/src/types/params/VariantOptionParams.tsnew file mode 100644index 0000000000..641969b6c1--- /dev/null+++ b/packages/seller-sdk/src/types/params/VariantOptionParams.ts@@ -0,0 +1,6 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type VariantOptionParams = {+ name: string+ value: string+}diff --git a/packages/seller-sdk/src/types/params/index.ts b/packages/seller-sdk/src/types/params/index.tsnew file mode 100644index 0000000000..c20e1ac9aa--- /dev/null+++ b/packages/seller-sdk/src/types/params/index.ts@@ -0,0 +1,53 @@+// This file is auto-generated from the request schemas in docs/api-reference by `pnpm generate:params`. Do not edit directly.++export type { AccountUpdateParams } from './AccountUpdateParams'+export type { ClaimCancelParams } from './ClaimCancelParams'+export type { ClaimCreateParams } from './ClaimCreateParams'+export type { ClaimDenyParams } from './ClaimDenyParams'+export type { ClaimResolveParams } from './ClaimResolveParams'+export type { CustomFieldValueParams } from './CustomFieldValueParams'+export type { DeliveryCreateParams } from './DeliveryCreateParams'+export type { DeliveryMethodParams } from './DeliveryMethodParams'+export type { DeliveryMethodRuleParams } from './DeliveryMethodRuleParams'+export type { DeliveryUpdateParams } from './DeliveryUpdateParams'+export type { ExchangeCancelParams } from './ExchangeCancelParams'+export type { ExchangeCreateParams } from './ExchangeCreateParams'+export type { ExchangeFulfillParams } from './ExchangeFulfillParams'+export type { ExchangeReceiveParams } from './ExchangeReceiveParams'+export type { FileUploadCreateParams } from './FileUploadCreateParams'+export type { FulfillmentFulfillParams } from './FulfillmentFulfillParams'+export type { FulfillmentSplitParams } from './FulfillmentSplitParams'+export type { FulfillmentUpdateParams } from './FulfillmentUpdateParams'+export type { ImportCompleteMappingParams } from './ImportCompleteMappingParams'+export type { ImportCreateParams } from './ImportCreateParams'+export type { InvitationAcceptParams } from './InvitationAcceptParams'+export type { LoginParams } from './LoginParams'+export type { OnboardingPayoutAccountParams } from './OnboardingPayoutAccountParams'+export type { OrderAddressCorrectionParams } from './OrderAddressCorrectionParams'+export type { OrderAddressParams } from './OrderAddressParams'+export type { OrderCancelParams } from './OrderCancelParams'+export type { OrderNotesParams } from './OrderNotesParams'+export type { PackageTypeParams } from './PackageTypeParams'+export type { PasswordResetCreateParams } from './PasswordResetCreateParams'+export type { PasswordResetUpdateParams } from './PasswordResetUpdateParams'+export type { PolicyCreateParams } from './PolicyCreateParams'+export type { PolicyUpdateParams } from './PolicyUpdateParams'+export type { ProductBulkStatusParams } from './ProductBulkStatusParams'+export type { ProductBulkSubmitParams } from './ProductBulkSubmitParams'+export type { ProductParams } from './ProductParams'+export type { ProfileUpdateParams } from './ProfileUpdateParams'+export type { RequirementSubmissionParams } from './RequirementSubmissionParams'+export type { ReturnCancelParams } from './ReturnCancelParams'+export type { ReturnCreateParams } from './ReturnCreateParams'+export type { ReturnReceiveParams } from './ReturnReceiveParams'+export type { ReturnRefundParams } from './ReturnRefundParams'+export type { SellerAddressParams } from './SellerAddressParams'+export type { SellerExportCreateParams } from './SellerExportCreateParams'+export type { SellerProductMediaParams } from './SellerProductMediaParams'+export type { SellerProductVariantParams } from './SellerProductVariantParams'+export type { SellerTaxIdentifierParams } from './SellerTaxIdentifierParams'+export type { ShippingLabelCreateParams } from './ShippingLabelCreateParams'+export type { StockLevelParams } from './StockLevelParams'+export type { StockLocationParams } from './StockLocationParams'+export type { TeamMemberCreateParams } from './TeamMemberCreateParams'+export type { VariantOptionParams } from './VariantOptionParams'diff --git a/packages/seller-sdk/src/zod/generated/Media.ts b/packages/seller-sdk/src/zod/generated/Media.tsindex 676812e1af..2d155418ba 100644--- a/packages/seller-sdk/src/zod/generated/Media.ts+++ b/packages/seller-sdk/src/zod/generated/Media.ts@@ -8,9 +8,9 @@ export const MediaSchema = z.object({position: z.number(),alt: z.string().nullable(),media_type: z.string(),+ external_video_url: z.string().nullable(),focal_point_x: z.number().nullable(),focal_point_y: z.number().nullable(),- external_video_url: z.string().nullable(),video_provider: z.string().nullable(),video_embed_url: z.string().nullable(),video_url: z.string().nullable(),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.rbindex b2ace2d0d3..1660f42572 100644--- 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.rb@@ -32,6 +32,14 @@ module Spree# Membership actions resolve products themselves; the base# single-resource load has nothing to look up.skip_before_action :set_resource++ # Adding (create) and removing (destroy) take the same body.+ [nil, :destroy].each do |action|+ request_params 'ProductMembershipParams', action: action do+ id :product_ids, array: true, required: true, example: %w[prod_abc123],+ description: 'Products from other stores, or ones the caller cannot see, are ignored.'+ end+ endend# POST /{parents}/:parent_id/productsdiff --git a/spree/api/app/controllers/concerns/spree/api/v3/admin/stock_receipt_actions.rb b/spree/api/app/controllers/concerns/spree/api/v3/admin/stock_receipt_actions.rbindex aee9324546..e3d042a80c 100644--- a/spree/api/app/controllers/concerns/spree/api/v3/admin/stock_receipt_actions.rb+++ b/spree/api/app/controllers/concerns/spree/api/v3/admin/stock_receipt_actions.rb@@ -15,6 +15,23 @@ module Spreeincluded dobefore_action :authorize_parent_access!++ # Read from the raw params by `create_workflow_arguments`, with+ # every line resolved through the document.+ request_params :stock_receipt do+ string :reference, nullable: true, example: 'DN-4471',+ description: "The supplier's delivery note, or the carrier's reference."+ datetime :received_at, nullable: true, description: 'When the goods were counted in. Defaults to now.'+ string :notes, nullable: true+ object :items, array: true, permit: false, as: 'StockReceiptItemParams',+ description: 'Omit to book in everything still outstanding, intact. Naming lines, even none, records exactly what the dock counted: `quantity_accepted` reaches the shelf; `quantity_rejected` is refused, recorded with a `rejection_reason` and never stocked.' do+ id :id, required: true, description: 'The purchase order or transfer line.'+ integer :quantity_accepted, example: 58+ integer :quantity_rejected, example: 2+ string :rejection_reason, nullable: true, enum: Spree::StockReceiptItem::REJECTION_REASONS, example: 'damaged'+ string :notes, nullable: true+ end+ endendprotected@@ -39,10 +56,6 @@ module Spree[items: :line]end- def resource_permitted_attributes- [:received_at, :reference, :notes]- end-def create_workflow_arguments{receivable_keyword => @parent,diff --git a/spree/api/app/controllers/concerns/spree/api/v3/request_params.rb b/spree/api/app/controllers/concerns/spree/api/v3/request_params.rbnew file mode 100644index 0000000000..418c336cf4--- /dev/null+++ b/spree/api/app/controllers/concerns/spree/api/v3/request_params.rb@@ -0,0 +1,63 @@+module Spree+ module Api+ module V3+ # Declares what a controller's write actions accept (see+ # Spree::Api::V3::RequestSchema). The resource controller permits from the+ # declaration, and the integration specs document it with+ # `request_body_for`, which is where the SDK request types come from.+ #+ # request_params :product do ... end # create and update+ # request_params 'ProductBulkStatusParams', action: :bulk_status_update do ... end+ module RequestParams+ extend ActiveSupport::Concern++ RESOURCE_ACTIONS = %w[create update].freeze++ included do+ class_attribute :request_params_schemas, instance_writer: false, default: {}+ end++ class_methods do+ # @param name [String, Symbol, nil] the resource the published types+ # are named after (defaults to the singular controller name), or a+ # name ending in `Params` for a single action's body+ # @param action [Symbol, nil] an action other than create and update+ def request_params(name = nil, action: nil, &block)+ if action && !name.to_s.end_with?('Params')+ raise ArgumentError, "name the body of #{action} with a name ending in Params"+ end++ schema = Spree::Api::V3::RequestSchema.new(name || controller_name.singularize, &block)+ self.request_params_schemas = request_params_schemas.merge((action || :resource).to_sym => schema)+ end++ # @param action [Symbol, String]+ # @return [Spree::Api::V3::RequestSchema, nil] what the action accepts+ def request_params_schema(action = :create)+ action = action.to_s+ request_params_schemas[action.to_sym] || (request_params_schemas[:resource] if RESOURCE_ACTIONS.include?(action))+ end+ end++ protected++ # The current action's declaration. An action without its own (a+ # custom one writing through +permitted_params+) accepts what create+ # and update do.+ #+ # @return [Spree::Api::V3::RequestSchema, nil]+ def request_params_schema+ self.class.request_params_schema(action_name) || request_params_schemas[:resource]+ end++ # The declared `params.permit` list for the current action.+ #+ # @return [Array<Symbol, Hash>]+ def declared_permitted_attributes+ action = action_name.to_s+ request_params_schema.permit_list(RESOURCE_ACTIONS.include?(action) ? action : nil)+ end+ end+ end+ end+enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/admin_users_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/admin_users_controller.rbindex 6d640dcabe..02ef63b782 100644--- a/spree/api/app/controllers/spree/api/v3/admin/admin_users_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/admin_users_controller.rb@@ -14,6 +14,13 @@ module Spree# grantable separately from store configuration (6.0-admin-rbac.md).scoped_resource :staff+ request_params :admin_user do+ string :first_name, :last_name+ # Applied through `apply_role_ids`, scoped to the current store.+ id :role_ids, array: true, permit: false,+ description: "Role IDs of the current store the user should hold. Replaces the user's roles on this store; an empty list removes them all."+ end+# DELETE /api/v3/admin/admin_users/:id# Removes role assignments for the current store rather than deleting# the account globally. The user keeps access to any other stores.@@ -79,7 +86,7 @@ module Spreeprivatedef identity_params- params.permit(:first_name, :last_name)+ params.permit(*declared_permitted_attributes)enddef role_ids_paramdiff --git a/spree/api/app/controllers/spree/api/v3/admin/allowed_origins_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/allowed_origins_controller.rbindex 9cf7b853d3..20acf6c31b 100644--- a/spree/api/app/controllers/spree/api/v3/admin/allowed_origins_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/allowed_origins_controller.rb@@ -5,6 +5,11 @@ module Spreeclass AllowedOriginsController < ResourceControllerscoped_resource :settings+ request_params :allowed_origin do+ string :origin, required: :create, example: 'https://admin.example.com',+ description: 'Origin to allow in admin CORS preflight checks: a bare `scheme://host[:port]` (no path, query or fragment) using `http` or `https`.'+ end+protecteddef model_class@@ -16,7 +21,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :origin)+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/api_keys_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/api_keys_controller.rbindex e6a51ad101..be982fd243 100644--- a/spree/api/app/controllers/spree/api/v3/admin/api_keys_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/api_keys_controller.rb@@ -14,6 +14,17 @@ module Spree# `read_api_keys` — any key can describe itself.skip_scope_check! only: :current+ # `key_type`, `scopes` and `channel_id` are create-only (immutability+ # lives on Spree::ApiKey), so a rename returns 200 rather than 422.+ request_params :api_key do+ string :name, required: true+ string :key_type, required: true, only: :create, enum: Spree::ApiKey::KEY_TYPES+ string :scopes, array: true, only: :create, example: %w[read_orders write_products],+ description: 'Required for secret keys. You can only grant scopes you hold yourself. Fixed once created: to change them, create a new key and revoke the old one.'+ id :channel_id, only: :create,+ description: 'Binds a publishable key to one channel of the store (`ch_...`), so it rejects requests for other channels. Fixed once created; omit it for a store-wide key.'+ end+# POST /api/v3/admin/api_keys# Prevents scope amplification for BOTH principals: a key minted via a# secret API key can only carry scopes that key already holds, and a@@ -94,16 +105,10 @@ module Spreeendend- # `key_type`, `scopes`, and `channel_id` are create-only (immutability- # lives on Spree::ApiKey); update is limited to the human-facing `name`.- # Stripping them here keeps them out of mass assignment so a rename- # returns 200 rather than 422.# No extension union: an API key's scopes and type are the authorization# surface itself, not extensible resource data.def permitted_params- return params.permit(:name) if action_name == 'update'-- params.permit(:name, :key_type, :channel_id, scopes: [])+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/catalogs/order_minimums_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/catalogs/order_minimums_controller.rbindex 13cc07b83a..415df4921a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/catalogs/order_minimums_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/catalogs/order_minimums_controller.rb@@ -9,6 +9,8 @@ module Spreeclass OrderMinimumsController < BaseControllerbefore_action :authorize_parent_access!+ request_params('CatalogOrderMinimumParams') { include_fields Spree::Api::V3::RequestShapes::CATALOG_ORDER_MINIMUM }+protecteddef model_class@@ -24,7 +26,7 @@ module Spreeenddef permitted_params- params.permit(:currency, :amount)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/catalogs/quantity_rules_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/catalogs/quantity_rules_controller.rbindex 79e9a91b4e..bcf5a01d23 100644--- a/spree/api/app/controllers/spree/api/v3/admin/catalogs/quantity_rules_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/catalogs/quantity_rules_controller.rb@@ -20,12 +20,12 @@ module Spreeclass QuantityRulesController < BaseControllerbefore_action :authorize_parent_access!+ request_params 'CatalogProductTermsParams', action: :upsert do+ object :terms, required: true, example: { 'prod_abc123' => { minimum_order_quantity: 48, order_multiple: 24 } },+ description: 'Quantity terms keyed by product: `{ minimum_order_quantity, order_multiple }`, each a whole number or null. A product whose pair is both null has its terms cleared; a product not yet in the assortment is added.'+ end+# PUT /api/v3/admin/catalogs/:catalog_id/quantity_rules- #- # { terms: { "prod_abc": { minimum_order_quantity: 48,- # order_multiple: 24 } } }- #- # A product whose pair is both null has its terms cleared.def upsertauthorize! :update, @catalogdiff --git a/spree/api/app/controllers/spree/api/v3/admin/catalogs_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/catalogs_controller.rbindex 8291f0c402..faabe9ba80 100644--- a/spree/api/app/controllers/spree/api/v3/admin/catalogs_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/catalogs_controller.rb@@ -6,12 +6,55 @@ module Spree# through assignments. Merchandising data, so it answers to the# products scopes.class CatalogsController < ResourceController+ ASSIGNMENT = Spree::Api::V3::RequestSchema.shape('CatalogAssignmentParams') do+ string :assignable_type, required: true, enum: %w[customer_group company], example: 'company',+ description: 'Buyer audiences only. A company assignment covers its subtree.'+ id :assignable_id, required: true, example: 'comp_86Rf07xd4z'+ end+scoped_resource :productsbefore_action :set_resource,only: [:show, :update, :destroy, :assign, :import_products,:activate, :deactivate]+ request_params 'CatalogParams' do+ string :name, example: 'VIP Assortment'+ string :description, nullable: true, description: 'Internal note on what the agreement is, never shown to shoppers.'+ boolean :active, example: true+ integer :position+ integer :minimum_order_quantity, :order_multiple, nullable: true,+ description: "The catalog-wide quantity terms, between a variant's own rule and a per-variant override. Null leaves the field to the variant's own rule."+ object :metadata+ # Small bounded sets, saved with the catalog so the whole+ # agreement lands in one transaction. Per-product terms stay their+ # own endpoint: an agreement may name thousands of them.+ object :assignments, array: true, shape: ASSIGNMENT,+ description: 'The whole audience. An entry left out is withdrawn; omitting the key leaves the audience alone.'+ object :order_minimums, array: true, shape: Spree::Api::V3::RequestShapes::CATALOG_ORDER_MINIMUM,+ description: 'The whole order-minimum set. A currency left out has its minimum lifted; omitting the key leaves them alone.'+ object :price_list, nullable: true, as: 'CatalogPriceListParams',+ description: 'The price list this catalog prices through, written inline: an object creates the owned list or updates it. Null deletes the list (a soft delete). Omit the key, or send `{}`, to leave the pricing alone. A catalog with an empty assortment prices without hiding anything; curate or import products to make it restrictive.' do+ string :name+ string :description, nullable: true+ string :status, :match_policy+ datetime :starts_at, :ends_at, nullable: true+ decimal :price_adjustment_percentage, nullable: true, example: '-15.0',+ description: 'Signed: negative discounts off base prices, positive marks up.'+ boolean :adjust_compare_at+ # Audience rules on an owned list are inert, since the catalog+ # assignment already decided the audience.+ object :rules, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_LIST_RULE,+ description: "Contextual rules, in practice a `volume_rule`. Audience rules are left as they are, and an empty list clears the contextual rules."+ object :prices, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_LIST_PRICE,+ description: 'Explicit per-variant amounts. An empty list clears them, which is what switching to a percentage sends.'+ object :price_adjustment_tiers, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_ADJUSTMENT_TIER,+ description: 'Quantity bands on the percentage. The payload is the whole ladder, so an empty list clears it.'+ end+ end++ request_params('CatalogAssignParams', action: :assign) { include_fields ASSIGNMENT }+# POST /api/v3/admin/catalogs/:id/import_products — copies the# attached price list's products into the assortment. Explicit by# design: an empty assortment is a pricing-only overlay, so making@@ -30,7 +73,7 @@ module Spreerender json: { added_count: @resource.import_products_from_price_list }end- # POST /api/v3/admin/catalogs/:id/assign — { assignable_type, assignable_id }+ # POST /api/v3/admin/catalogs/:id/assigndef assignauthorize! :update, @resource@@ -102,38 +145,7 @@ module Spree# as `null` detaches the list the catalog owns; omitting the key# leaves it alone.def permitted_params- permitted = params.permit(*model_additional_permitted_attributes,- :name, :description, :active, :position,- :minimum_order_quantity, :order_multiple,- metadata: {},- # Small bounded sets, saved with the- # catalog so the whole agreement lands- # in one transaction. Per-product terms- # stay their own endpoint — an- # agreement may name thousands of them.- assignments: [:assignable_type, :assignable_id],- order_minimums: [:currency, :amount],- price_list: [- :name, :description, :status, :match_policy,- :starts_at, :ends_at,- :price_adjustment_percentage, :adjust_compare_at,- # Contextual rules only in practice — a- # VolumeRule is what turns a percentage- # into automatic volume pricing. Audience- # rules on an owned list are inert, since- # the catalog assignment already decided- # the audience.- { rules: [:id, :type, { preferences: {} }] },- # An empty array clears the hand-entered- # amounts — what switching to a- # percentage sends.- { prices: [:id, :variant_id, :currency, :min_quantity,- :amount, :compare_at_amount] },- # Quantity bands on the percentage. The- # payload is the whole ladder, so an- # empty array clears it.- { price_adjustment_tiers: [:min_quantity, :percentage] }- ])+ permitted = params.permit(*permitted_attributes)# `permit` drops an explicit null, but detaching has to be# distinguishable from saying nothing.permitted[:price_list] = nil if params.key?(:price_list) && params[:price_list].nil?diff --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 bd5e0a5572..dc7af2d7d7 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@@ -15,8 +15,11 @@ module Spreebefore_action :set_product, only: [:reposition]+ request_params 'ProductMembershipRepositionParams', action: :reposition do+ integer :new_position, required: true, example: 0, description: "0-based index among the parent's products."+ end+# PATCH /api/v3/admin/categories/:category_id/products/:id/reposition- # Body: { new_position: 0 } — 0-based index among the category's products.# @product is already constrained to the category's scope, so a# classification always exists.def repositiondiff --git a/spree/api/app/controllers/spree/api/v3/admin/categories_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/categories_controller.rbindex d327a6b782..acaf3f5789 100644--- a/spree/api/app/controllers/spree/api/v3/admin/categories_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/categories_controller.rb@@ -11,8 +11,32 @@ module Spreeclass CategoriesController < ResourceControllerscoped_resource :categories+ # Category-half attributes only. The collection-bound fields+ # (automatic, sort_order, rules) belong to Spree::Collection, and+ # taxonomy_id is gone with Taxonomy.+ request_params :category do+ external_references+ string :name, required: :create, example: 'Shirts'+ # Resolved within scope by +permitted_params+, so a parent from+ # another store or an automatic taxon can't be targeted.+ id :parent_id, nullable: true, permit: false, example: 'ctg_abc123',+ description: 'The parent category. Omitted or null, a new category goes to the top level and an existing one keeps its parent: moving one to the top level is the reposition endpoint.'+ string :description, description: 'Rich text HTML. Reads come back as this (plain text) plus `description_html`.'+ string :permalink, :meta_title, :meta_description, :meta_keywords+ string :image_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the landscape image, or null to remove it.'+ string :square_image_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the square image, or null to remove it.'+ object :custom_fields, array: true, shape: Spree::Api::V3::RequestShapes::CUSTOM_FIELD_VALUE,+ description: 'Custom field values, each validated against its definition.'+ end++ request_params 'CategoryRepositionParams', action: :reposition do+ id :new_parent_id, nullable: true, description: 'The new parent. Omit or null to move the category to the top level.'+ integer :new_position, required: true, example: 0, description: "0-based index among the new parent's children."+ end+# PATCH /api/v3/admin/categories/:id/reposition- # Body: { new_parent_id: 'ctg_…' (omit for top level), new_position: 0 }# Moves the category to a new parent (or the top level) and/or index.def repositioncategory = find_resource@@ -59,26 +83,8 @@ module Spreesuper.manualend- # Category-half attributes only. Deliberately excludes the- # collection-bound fields (automatic, sort_order, rules_match_policy,- # taxon_rules) and taxonomy_id — those belong to Spree::Collection- # (6.0) and Taxonomy is being dropped. A prefixed parent_id resolves- # within scope (so a parent from another store or an automatic taxon- # can't be targeted).def permitted_params- permitted = params.permit(- *model_additional_permitted_attributes,- :name, :description, :permalink,- :meta_title, :meta_description, :meta_keywords,- :image_signed_id, :square_image_signed_id,- # Inline custom field values keyed by definition id. The model- # setter (Spree::HasCustomFields#custom_fields=) validates each entry- # against its definition. `value` is permitted as a scalar AND as- # `value: []` / `value: {}` so JSON custom_fields round-trip whether- # the parsed payload is an array or an object, while- # text/number/boolean ship scalars.- custom_fields: [:id, :custom_field_definition_id, :value, { value: [] }, { value: {} }]- )+ permitted = params.permit(*permitted_attributes)permitted[:parent] = scope.find_by_prefix_id!(params[:parent_id]) if params[:parent_id].present?permittedenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rbindex 619fb53236..6c745a5c73 100644--- a/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb@@ -9,8 +9,33 @@ module Spreescoped_resource :settings+ request_params :channel do+ string :name, required: :create, example: 'Point of Sale'+ string :code, example: 'pos', description: 'URL-safe slug, derived from `name` when blank (`Point of Sale` becomes `point-of-sale`).'+ boolean :active, :default+ string :order_routing_strategy, nullable: true,+ description: 'Order routing strategy shorthand (built-in: `rules`). Null inherits the store setting.'+ string :storefront_access, nullable: true, enum: Spree::Channel::Gating::STOREFRONT_ACCESS,+ description: 'What anonymous visitors can see. Null inherits the store setting.'+ boolean :guest_checkout, nullable: true,+ description: 'Whether guests can check out without an account. Null inherits the store setting.'+ id :default_catalog_id, nullable: true,+ description: 'Catalog (`cat_...`) shown to shoppers no company or customer group catalog covers. Null means every product published on the channel.'+ id :stock_location_ids, array: true,+ description: 'Stock locations (`sloc_...`) that fulfill this channel. Replaces the whole set; an empty list means every location of the store.'+ end++ request_params 'ChannelAddProductsParams', action: :add_products do+ id :product_ids, array: true, required: true+ datetime :published_at, nullable: true, description: 'When the publications go live. Null means immediately.'+ datetime :unpublished_at, nullable: true, description: 'When the publications come down. Null means never.'+ end++ request_params 'ChannelRemoveProductsParams', action: :remove_products do+ id :product_ids, array: true, required: true+ end+# POST /api/v3/admin/channels/:id/add_products- # Body: { product_ids: [...], published_at: nil, unpublished_at: nil }def add_productschannel = find_resourceauthorize! :update, channel@@ -24,7 +49,6 @@ module Spreeend# POST /api/v3/admin/channels/:id/remove_products- # Body: { product_ids: [...] }def remove_productschannel = find_resourceauthorize! :update, channel@@ -65,10 +89,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :code, :active, :default, :order_routing_strategy,- :storefront_access, :guest_checkout,- :default_catalog_id,- stock_location_ids: [])+ params.permit(*permitted_attributes)end# `stock_location_ids` replaces the channel's fulfillment-origindiff --git a/spree/api/app/controllers/spree/api/v3/admin/claim_reasons_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/claim_reasons_controller.rbindex a9f6cac7c1..77f627d542 100644--- a/spree/api/app/controllers/spree/api/v3/admin/claim_reasons_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/claim_reasons_controller.rb@@ -5,6 +5,11 @@ module Spreeclass ClaimReasonsController < ResourceControllerscoped_resource :settings+ request_params :reason do+ string :name, required: :create+ boolean :active, description: 'Whether the reason is offered on new records.'+ end+protecteddef model_class@@ -16,7 +21,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :active)+ params.permit(*permitted_attributes)endendenddiff --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 b875800c32..a43dd47001 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@@ -17,8 +17,11 @@ module Spreebefore_action :ensure_manual_collection, only: [:create, :destroy, :reposition]before_action :set_product, only: [:reposition]+ request_params 'ProductMembershipRepositionParams', action: :reposition do+ integer :new_position, required: true, example: 0, description: "0-based index among the parent's products."+ end+# PATCH /api/v3/admin/collections/:collection_id/products/:id/reposition- # Body: { new_position: 0 } — 0-based index among the collection's products.# @product is already constrained to the collection's scope, so a# ProductCollection always exists.def repositiondiff --git a/spree/api/app/controllers/spree/api/v3/admin/collections_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/collections_controller.rbindex 7bac8773a9..f0abc7cb9a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/collections_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/collections_controller.rb@@ -10,6 +10,34 @@ module Spreeclass CollectionsController < ResourceControllerscoped_resource :collections+ request_params :collection do+ string :name, required: :create, example: 'On Sale'+ string :description, description: 'Rich text HTML. Reads come back as this (plain text) plus `description_html`.'+ string :permalink+ integer :position,+ description: "1-based position among the store's collections; the server shifts its siblings. The nested products reposition endpoints, unlike this, take 0-based indexes."+ string :meta_title, :meta_description, :meta_keywords+ string :image_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the landscape image, or null to remove it.'+ string :square_image_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the square image, or null to remove it.'+ boolean :automatic, description: 'When true, membership is materialized from `rules` instead of curated by hand.'+ string :rules_match_policy, enum: Spree::Collection::RULES_MATCH_POLICIES,+ description: 'Whether a product must match all rules or any of them. Defaults to `all`.'+ string :sort_order, enum: Spree::Collection::SORT_ORDERS,+ description: "Default product sort for the storefront listing; a shopper's own sort wins. Defaults to `manual`."+ # Applied by the model's sync setter (Spree::Collection#rules=).+ object :rules, array: true, as: 'CollectionRuleParams',+ description: 'The complete desired rule set. Entries with an `id` update, entries without one are created, and existing rules left out are removed.' do+ id :id, example: 'crule_abc123', description: 'Omit to create a new rule.'+ string :type, example: 'tag', description: 'Wire shorthand for the rule kind, from the collection rule types endpoint.'+ string :value, example: 'summer'+ string :match_policy, enum: Spree::CollectionRule::MATCH_POLICIES, example: 'contains'+ end+ object :custom_fields, array: true, shape: Spree::Api::V3::RequestShapes::CUSTOM_FIELD_VALUE,+ description: 'Custom field values, each validated against its definition.'+ end+protecteddef model_class@@ -32,22 +60,10 @@ module Spreesuper.orderedend- # Flat params. +rules+ is applied by the model's sync setter- # (Spree::Collection#rules=): the full desired rule set, prefixed- # +crule_+ ids update, missing ids build, omitted rules are removed —- # so normalize_params is deliberately NOT called (that would rewrite- # +rules+ to +rules_attributes+ and route past the setter).+ # normalize_params is deliberately NOT called: it would rewrite+ # +rules+ to +rules_attributes+ and route past the sync setter.def permitted_params- params.permit(- :name, :description, :permalink, :position,- :meta_title, :meta_description, :meta_keywords,- :image_signed_id, :square_image_signed_id,- :automatic, :rules_match_policy, :sort_order,- rules: [:id, :type, :value, :match_policy],- # Inline custom field values keyed by definition id (see- # CategoriesController#permitted_params for the value shapes).- custom_fields: [:id, :custom_field_definition_id, :value, { value: [] }, { value: {} }]- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/commission_rates_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/commission_rates_controller.rbindex 7eec4488e7..7c9c00c7d6 100644--- a/spree/api/app/controllers/spree/api/v3/admin/commission_rates_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/commission_rates_controller.rb@@ -16,6 +16,42 @@ module Spreebefore_action -> { decimal_param(:value) }, only: %i[create update]scoped_resource :commissions+ request_params :commission_rate do+ string :name, required: :create, example: 'Audio sellers'+ string :code, nullable: true, example: 'audio',+ description: 'Your own identifier for this rate; unique per store.'+ boolean :enabled+ integer :position, example: 1,+ description: 'Place in the list. Rates resolve top-down and the first whose rules match wins, so 1 is tried first. New rates are created at the top; send this to move one. A rate with no rules matches every sale, so the marketplace default belongs at the bottom.'+ string :kind, required: :create, enum: Spree::CommissionRate::KINDS, example: 'percentage',+ description: '`percentage` charges a share of the sale; `fixed` charges a flat fee.'+ decimal :value, required: :create, example: '12.5',+ description: 'A percentage (10 = 10%) or a flat amount, per `kind`.'+ boolean :tax_inclusive,+ 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."+ boolean :include_shipping,+ description: "Also charge commission on the seller's delivery revenue. Percentage rates only."+ decimal :commission_tax_rate, nullable: true, example: '0.21',+ description: "VAT on the commission itself, as a fraction rather than a percentage. Null lets the store's tax engine answer for the seller's jurisdiction."+ object :metadata+ object :amounts, example: { USD: '2.50', EUR: '2.00' },+ description: 'What a flat fee charges, keyed by currency, as decimal strings. A sale in a currency with no amount falls to the next matching rate. Replaces the whole set.'+ object :bounds, example: { USD: { min_amount: '1.00', max_amount: '50.00' } },+ description: 'The floor and cap a percentage charges within, keyed by currency: `{ min_amount, max_amount }` decimal strings. A sale in a currency with no bounds is charged unbounded. Replaces the whole set.'+ # Permitted in `permitted_params`, with the keys each registered+ # rule kind adds.+ object :rules, array: true, permit: false, as: 'CommissionRuleDraftParams',+ description: 'The full targeting; what you send replaces what the rate holds.' do+ id :id, nullable: true, description: 'Present for an existing rule; omit to create one.'+ string :type, required: true, example: 'seller_rule',+ description: 'A kind from `GET /commission_rates/rule_types`.'+ object :preferences, example: { seller_ids: ['sel_a1b2c3'] },+ description: "Configuration for the kind, per its type's `schema`."+ id :product_ids, array: true,+ description: 'For kinds that name products, which are kept outside preferences.'+ end+ end+# GET /api/v3/admin/commission_rates/rule_types## Every registered rule kind with its configuration schema, so a@@ -83,17 +119,8 @@ module Spreedef permitted_paramsattributes = normalize_params(- params.permit(- :name, :code, :enabled, :position, :kind, :value,- :tax_inclusive, :include_shipping, :commission_tax_rate,- metadata: {},- amounts: {},- # Nested one level deeper than +amounts+ — currency => floor and- # cap — so the whole subtree is permitted rather than its keys,- # which are currency codes and not knowable here.- bounds: {},- rules: [:id, :type, { preferences: {} }, *rule_association_attributes]- )+ params.permit(*declared_permitted_attributes,+ rules: [:id, :type, { preferences: {} }, *rule_association_attributes]))attributes[:rules] = resolved_rule_rows(attributes[:rules]) if attributes.key?(:rules)diff --git a/spree/api/app/controllers/spree/api/v3/admin/companies/addresses_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/companies/addresses_controller.rbindex 5ecebabf03..48b76c4d62 100644--- a/spree/api/app/controllers/spree/api/v3/admin/companies/addresses_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/companies/addresses_controller.rb@@ -8,6 +8,12 @@ module Spreeclass AddressesController < BaseControllerinclude Spree::Api::V3::CompanyAddressWrites+ request_params 'CompanyAddressParams' do+ include_fields Spree::Api::V3::RequestShapes::ADDRESS_FIELDS+ boolean :default_billing, :default_shipping, permit: false,+ description: 'True makes this the default address of that kind, false gives the slot up, and leaving it out keeps the current default.'+ end+before_action :authorize_parent_access!# POST /api/v3/admin/companies/:company_id/addresses@@ -53,6 +59,10 @@ module Spreedef scope@parent.addressesend++ def permitted_params+ params.permit(*declared_permitted_attributes)+ endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/companies/memberships_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/companies/memberships_controller.rbindex 8dc8c9add5..381e9d8905 100644--- a/spree/api/app/controllers/spree/api/v3/admin/companies/memberships_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/companies/memberships_controller.rb@@ -13,6 +13,12 @@ module Spree# who buys for a node — and memberships carry customer emails.before_action :authorize_parent_access!+ request_params :company_membership do+ string :customer_email, required: :create, example: '[email protected]',+ description: 'An existing customer becomes a member immediately; an unknown email becomes an invitation, and the response is an invitation instead of a membership.'+ object :metadata+ end+# POST /api/v3/admin/companies/:company_id/membershipsdef createresult = Spree.company_add_member_service.call(@@ -52,7 +58,7 @@ module Spreeenddef permitted_params- params.permit(:customer_email, metadata: {})+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/companies/tax_exemption_certificates_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/companies/tax_exemption_certificates_controller.rbindex 4ce6b2fe47..ae531974e3 100644--- a/spree/api/app/controllers/spree/api/v3/admin/companies/tax_exemption_certificates_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/companies/tax_exemption_certificates_controller.rb@@ -9,6 +9,19 @@ module Spreeclass TaxExemptionCertificatesController < BaseControllerinclude ActiveStorage::SetCurrent+ request_params 'TaxExemptionCertificateParams' do+ string :certificate_number, example: 'DE-RESALE-7', description: 'Required when creating.'+ string :reason_code, example: 'resale',+ description: "Becomes the tax provider's entity use code. Required when creating."+ string :issuing_authority, nullable: true, example: 'Finanzamt Berlin'+ datetime :issued_at, :expires_at, nullable: true+ string :country_code, :state_code, nullable: true,+ description: 'Where the certificate holds. Omit both for one valid everywhere.'+ string :document_signed_id,+ description: "A `signed_id` from `files.upload()` with `visibility: 'private'`."+ object :metadata+ end+before_action :authorize_parent_access!# Re-declaring the filter replaces the inherited options, so the# standard actions have to be listed alongside the custom ones.@@ -85,11 +98,8 @@ module Spree[{ document_attachment: :blob }]end- # `document_signed_id` comes from POST /api/v3/admin/files.def permitted_params- params.permit(:certificate_number, :reason_code, :issuing_authority,- :issued_at, :expires_at, :country_code, :state_code, :document_signed_id,- metadata: {})+ params.permit(*declared_permitted_attributes)enddef build_resourcediff --git a/spree/api/app/controllers/spree/api/v3/admin/companies/tax_identifiers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/companies/tax_identifiers_controller.rbindex aed070a759..35a3b47e38 100644--- a/spree/api/app/controllers/spree/api/v3/admin/companies/tax_identifiers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/companies/tax_identifiers_controller.rb@@ -12,6 +12,12 @@ module Spreeclass TaxIdentifiersController < BaseControllerinclude Spree::Api::V3::TaxIdentifierValidation+ request_params 'TaxIdentifierParams' do+ string :kind, example: 'gb_vat',+ description: "#{Spree::Api::V3::RequestShapes::TAX_IDENTIFIER_KIND} Required when creating."+ string :value, example: 'GB123456789', description: 'Required when creating.'+ end+before_action :authorize_parent_access!# Re-declaring the filter replaces the inherited options, so the# standard actions have to be listed alongside the custom one.@@ -32,7 +38,7 @@ module Spreeenddef permitted_params- params.permit(:kind, :value)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/companies_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/companies_controller.rbindex f3f92b4d26..740fbc0b86 100644--- a/spree/api/app/controllers/spree/api/v3/admin/companies_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/companies_controller.rb@@ -12,6 +12,18 @@ module Spreeclass CompaniesController < ResourceControllerscoped_resource :customers+ request_params 'CompanyParams' do+ external_references+ string :name, example: 'Globex Corporation', description: 'Required when creating.'+ string :kind, enum: Spree::Company::KINDS, example: 'company',+ description: '`company` is a legal entity (may hold tax registrations), `division` an organizational unit. Roots must be `company`.'+ id :parent_id, nullable: true, example: 'comp_86Rf07xd4z',+ description: 'The parent node. Omit or null for a root.'+ boolean :po_number_required,+ description: "Whether this buyer's own procurement process demands a PO reference on every order: checkout asks for one and refuses to complete without it."+ object :metadata+ end+protecteddef model_class@@ -27,9 +39,7 @@ module Spreeenddef permitted_params- permitted = params.permit(*model_additional_permitted_attributes,- :name, :kind, :parent_id, :po_number_required, metadata: {})- resolve_parent_param(permitted)+ resolve_parent_param(params.permit(*permitted_attributes))endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/custom_field_definitions_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/custom_field_definitions_controller.rbindex 788d56f7c0..917ddb45d6 100644--- a/spree/api/app/controllers/spree/api/v3/admin/custom_field_definitions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/custom_field_definitions_controller.rb@@ -10,6 +10,21 @@ module Spreeclass CustomFieldDefinitionsController < ResourceControllerscoped_resource :settings+ request_params :custom_field_definition do+ string :namespace, description: 'Defaults to `custom`.'+ string :key, required: :create+ string :label, description: 'Human-readable name; defaults to the titleized `key`.'+ string :field_type, required: :create, example: 'short_text',+ description: 'Custom field type token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension type that has no token is named by its registered class instead.'+ string :resource_type, required: :create, example: 'product',+ description: 'Shorthand of the resource the field attaches to, from the resource types endpoint.'+ boolean :storefront_visible, description: 'When false, the definition is admin-only and never exposed in the Store API.'+ boolean :searchable,+ description: 'Include values in storefront product text search. Supported for `short_text`, `long_text` and `number` fields; other types are refused.'+ boolean :sortable,+ description: 'Allow storefront product listings to sort by this field (`sort=cf_{namespace}_{key}`). Supported for `short_text` and `number` fields; other types are refused.'+ end+# GET /api/v3/admin/custom_field_definitions/resource_types## What a definition can be attached to, from@@ -34,9 +49,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :namespace, :key, :label, :field_type,- :resource_type, :storefront_visible,- :searchable, :sortable)+ params.permit(*permitted_attributes)end# Pure registry discovery — maps to the read scope.diff --git a/spree/api/app/controllers/spree/api/v3/admin/custom_fields_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/custom_fields_controller.rbindex 8302d2df28..36aff9de45 100644--- a/spree/api/app/controllers/spree/api/v3/admin/custom_fields_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/custom_fields_controller.rb@@ -7,6 +7,15 @@ module Spree# class is inferred from whichever `<segment>_id` route param matches a# registered owner.class CustomFieldsController < ResourceController+ # Only `value` is mutable. Switching the linked definition is a+ # delete-and-create: the model rejects it (definition + resource+ # uniqueness) and the type wouldn't match.+ request_params :custom_field do+ id :custom_field_definition_id, required: true, only: :create, example: 'cfdef_abc123'+ any :value, required: true,+ description: "A value matching the definition's `field_type`: a scalar for text, number and boolean fields; a list or a hash for JSON fields."+ end+# POST /api/v3/admin/<parent>/<parent_id>/custom_fieldsdef create@resource = @parent.custom_fields.new(permitted_params)@@ -20,9 +29,6 @@ module Spreeend# PATCH /api/v3/admin/<parent>/<parent_id>/custom_fields/:id- # Only `value` is mutable. Switching the linked definition is a- # delete-and-create — the model rejects it (definition + resource- # uniqueness) and the type wouldn't match.def updateauthorize_resource!(@resource)@@ -82,11 +88,11 @@ module Spree# `custom_field_definition_id` is an alias_attribute on Spree::CustomField;# AR resolves the prefixed-ID and the alias to the canonical FK on assign.def permitted_params- params.permit(*model_additional_permitted_attributes, :custom_field_definition_id, :value)+ params.permit(*permitted_attributes)enddef update_permitted_params- params.permit(:value)+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/customer_groups_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/customer_groups_controller.rbindex 54d6ab6b62..9b0031ab21 100644--- a/spree/api/app/controllers/spree/api/v3/admin/customer_groups_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/customer_groups_controller.rb@@ -7,6 +7,12 @@ module Spreeclass CustomerGroupsController < ResourceControllerscoped_resource :customers+ request_params :customer_group do+ string :name, required: :create, example: 'Wholesale'+ string :description, nullable: true, example: 'B2B accounts'+ id :customer_ids, array: true, example: %w[cus_UkLWZg9DAJ], description: "Replaces the group's members."+ end+protecteddef model_class@@ -18,7 +24,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :description, customer_ids: [])+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/customers/addresses_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/customers/addresses_controller.rbindex 7dfafd3b8d..feb33658d4 100644--- a/spree/api/app/controllers/spree/api/v3/admin/customers/addresses_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/customers/addresses_controller.rb@@ -4,6 +4,14 @@ module Spreemodule Adminmodule Customersclass AddressesController < BaseController+ request_params 'CustomerAddressParams' do+ include_fields Spree::Api::V3::RequestShapes::ADDRESS_FIELDS+ string :firstname, :lastname, description: 'Older spellings of `first_name` and `last_name`.'+ string :alternative_phone+ boolean :quick_checkout+ boolean :is_default_billing, :is_default_shipping, permit: false,+ description: "Makes this the customer's default address of that kind."+ end# POST /api/v3/admin/customers/:customer_id/addressesdef create@@ -61,13 +69,7 @@ module Spreeprivatedef address_attrs- params.permit(- :firstname, :lastname, :first_name, :last_name,- :address1, :address2, :city,- :country_code, :state_code,- :zipcode, :postal_code, :phone, :alternative_phone,- :state_name, :company, :label, :quick_checkout- )+ params.permit(*declared_permitted_attributes)enddef default_billing_flagdiff --git a/spree/api/app/controllers/spree/api/v3/admin/customers/store_credits_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/customers/store_credits_controller.rbindex 9d604f741e..3b80a131eb 100644--- a/spree/api/app/controllers/spree/api/v3/admin/customers/store_credits_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/customers/store_credits_controller.rb@@ -9,9 +9,15 @@ module Spree# broad customer access.scoped_resource :store_credits+ request_params :customer_store_credit do+ decimal :amount, required: :create, example: '50.00'+ string :currency, required: :create, only: :create, example: 'USD'+ string :memo+ end+# POST /api/v3/admin/customers/:customer_id/store_creditsdef create- @resource = @parent.store_credits.new(create_attrs)+ @resource = @parent.store_credits.new(store_credit_attributes)@resource.created_by = try_spree_current_user@resource.store ||= current_storeauthorize_resource!(@resource, :create)@@ -27,7 +33,7 @@ module Spreedef updateauthorize_resource!(@resource)- if @resource.amount_used.positive? && update_attrs.key?(:amount)+ if @resource.amount_used.positive? && store_credit_attributes.key?(:amount)render_error(code: 'store_credit_in_use',message: 'Cannot change amount on a store credit that has already been used',@@ -36,7 +42,7 @@ module Spreereturnend- if @resource.update(update_attrs)+ if @resource.update(store_credit_attributes)render json: serialize_resource(@resource.reload)elserender_validation_error(@resource.errors)@@ -78,12 +84,8 @@ module Spreeprivate- def create_attrs- params.permit(:amount, :currency, :memo).to_h- end-- def update_attrs- params.permit(:memo, :amount).to_h+ def store_credit_attributes+ params.permit(*declared_permitted_attributes).to_hendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/customers/tax_identifiers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/customers/tax_identifiers_controller.rbindex aae4989254..2a80382641 100644--- a/spree/api/app/controllers/spree/api/v3/admin/customers/tax_identifiers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/customers/tax_identifiers_controller.rb@@ -8,6 +8,12 @@ module Spreeinclude Spree::Api::V3::TaxIdentifierValidation+ request_params 'TaxIdentifierParams' do+ string :kind, example: 'gb_vat',+ description: "#{Spree::Api::V3::RequestShapes::TAX_IDENTIFIER_KIND} Required when creating."+ string :value, example: 'GB123456789', description: 'Required when creating.'+ end+# Re-declaring the filter replaces the inherited options, so the# standard actions have to be listed alongside the custom one.before_action :set_resource, only: [:show, :update, :destroy, :validate]@@ -33,7 +39,7 @@ module Spreeenddef permitted_params- params.permit(:kind, :value)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/customers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/customers_controller.rbindex 50f0e2e718..dba5a23b31 100644--- a/spree/api/app/controllers/spree/api/v3/admin/customers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/customers_controller.rb@@ -7,6 +7,32 @@ module Spreescoped_resource :customers+ request_params :customer do+ string :email, required: :create, example: '[email protected]'+ string :first_name, :last_name, :phone+ string :password, :password_confirmation,+ description: 'Optional: a customer created without one claims the account through a password reset.'+ string :selected_locale+ string :avatar_signed_id, description: 'A `signed_id` from `files.upload()`.'+ boolean :accepts_email_marketing+ string :internal_note, description: 'Rich text HTML. Reads come back as this plus `internal_note_html`.'+ object :metadata+ string :tags, array: true+ id :customer_group_ids, array: true, description: "Replaces the customer's group membership."+ end++ %i[bulk_add_to_groups bulk_remove_from_groups].each do |action|+ request_params 'CustomerBulkGroupsParams', action: action do+ id :ids, array: true, required: true, example: %w[cus_UkLWZg9DAJ cus_QrLWXg9CAJ]+ id :customer_group_ids, array: true, required: true, example: %w[cg_UkLWZg9DAJ],+ description: 'Groups from other stores are ignored.'+ end+ end++ %i[bulk_add_tags bulk_remove_tags].each do |action|+ request_params('BulkTagsParams', action: action) { include_fields Spree::Api::V3::RequestShapes::BULK_TAGS }+ end+# Re-declaring a `before_action` for the same method REPLACES the# inherited registration rather than adding to it, so the inherited# actions have to be repeated here or show/update/destroy silently@@ -258,13 +284,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :email, :first_name, :last_name, :phone,- :password, :password_confirmation, :selected_locale,- :avatar_signed_id, :accepts_email_marketing, :internal_note,- metadata: {}, tags: [], customer_group_ids: []- )+ params.permit(*permitted_attributes)end# Authorises bulk group mutation, decodes prefixed IDs, then dispatchesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/data_requests_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/data_requests_controller.rbindex 7af2ac6397..970f475af9 100644--- a/spree/api/app/controllers/spree/api/v3/admin/data_requests_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/data_requests_controller.rb@@ -11,6 +11,12 @@ module Spreeclass DataRequestsController < ResourceControllerscoped_resource :customers+ request_params 'DataRequestCreateParams', action: :create do+ id :customer_id, required: true+ string :kind, required: true, enum: Spree::DataRequest::KINDS,+ description: "`access` asks for a copy of the customer's personal data; `erasure` asks for it to be erased."+ end+def createauthorize! :create, Spree::DataRequestdiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods/rules_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods/rules_controller.rbindex e934553d00..9e86cfeba9 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods/rules_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods/rules_controller.rb@@ -8,6 +8,15 @@ module Spreeclass RulesController < ResourceControllerscoped_resource :delivery_methods+ request_params :delivery_method_rule do+ string :type, required: true, only: :create, example: 'excluded_products_rule',+ description: 'A rule kind from the delivery method rule types endpoint.'+ boolean :active, description: 'Defaults to true on create.'+ object :preferences, description: "Values for the rule kind's preference schema."+ id :product_ids, array: true,+ description: 'Products an association-backed rule (`excluded_products_rule`) applies to. An empty list clears them.'+ end+def createrule_class = Spree.delivery_method_rules.detect do |klass|klass.api_type == params[:type].to_s@@ -62,7 +71,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, :active, preferences: {}, product_ids: [])+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rbindex 5276aa703f..e18d4996c8 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb@@ -9,6 +9,60 @@ module Spreescoped_resource :delivery_methods+ # A single POST/PATCH can ship eligibility rules and carrier service+ # rows alongside the basics; `DeliveryMethod#rules=` / `#services=`+ # reconcile to the desired set, so the dashboard saves the whole+ # sheet in one round-trip.+ request_params 'DeliveryMethodParams' do+ string :name, example: 'Express'+ string :admin_name, :code, nullable: true+ string :fulfillment_provider, example: 'manual',+ description: 'Fulfillment provider shorthand (see the fulfillment providers endpoint), e.g. `manual`.'+ string :pickup_point_provider, nullable: true+ string :rate_provider, nullable: true,+ description: 'Rate provider shorthand (see the rate providers endpoint), e.g. `easy_post`. Omit or send null for the built-in provider, which prices through the method\'s calculator.'+ boolean :storefront_visible+ boolean :available_to_sellers,+ description: "Marketplace only: whether a seller's packages may be quoted by this method. Off by default, and refused on a method that belongs to a seller."+ string :tracking_url, nullable: true+ integer :estimated_transit_business_days_min, :estimated_transit_business_days_max, nullable: true+ id :tax_category_id, nullable: true, description: 'Prefixed tax category ID (`taxcat_...`), or null to clear.'+ decimal :markup_flat, nullable: true, description: 'Method-level flat handling fee added on top of provider-quoted rates.'+ decimal :markup_percent, nullable: true,+ description: 'Method-level percentage handling fee added on top of provider-quoted rates. Ignored for calculator-priced methods.'+ id :delivery_profile_id, example: 'fp_86Rf07xd4z',+ description: 'Delivery profile this method belongs to (`fp_...`); defaults to the store default profile.'+ id :delivery_origin_group_id,+ description: "Origin group offering this method (`og_...`); defaults to the zone's group, else the profile's default group."+ id :delivery_zone_id, nullable: true,+ description: "Delivery zone narrowing destinations (`dz_...`), or null for no restriction. Must belong to the method's profile."+ id :stock_location_ids, array: true, description: 'Pickup locations (`sloc_...`); replaces the full set.'+ object :calculator, description: "How the method prices a shipment: a type from the calculators endpoint and its preferences, matching that type's `schema`." do+ string :type, example: 'flat_rate'+ object :preferences, example: { amount: '12.5' }+ end+ # Permitted by `rule_attributes`, which adds the association-backed+ # config each registered rule kind declares.+ object :rules, array: true, permit: false,+ description: 'Eligibility rules. Replaces the full set: omitted rules are removed.' do+ id :id+ string :type, description: 'A rule kind from the delivery method rule types endpoint.'+ boolean :active+ object :preferences+ id :product_ids, array: true, description: 'Products an association-backed rule (`excluded_products_rule`) applies to.'+ end+ object :services, array: true, as: 'DeliveryMethodServiceParams',+ description: 'Carrier service rows: which provider services this method offers. Replaces the full set: omitted rows are removed; no rows means every service the provider returns is offered.' do+ id :id, description: 'Prefixed row ID (`dms_...`) when updating an existing row.'+ string :carrier, required: true, example: 'UPS', description: "Carrier identifier as the provider's API knows it."+ string :service, required: true, example: 'Ground', description: "Service identifier as the provider's API knows it."+ string :label, nullable: true, description: 'Display label shown to customers instead of the carrier-derived name.'+ decimal :markup_flat, nullable: true, description: 'Overrides the method-level flat markup for this service.'+ decimal :markup_percent, nullable: true, description: 'Overrides the method-level percentage markup for this service.'+ integer :position+ end+ end+# GET /api/v3/admin/delivery_methods/calculators# Registered delivery calculator classes with their preference# schemas, so admin UIs can render configuration forms.@@ -124,23 +178,8 @@ module SpreeSpree.api.admin_delivery_method_serializerend- # A single POST/PATCH can ship eligibility rules and carrier service- # rows alongside the basics; `DeliveryMethod#rules=` / `#services=`- # reconcile to the desired set, so the dashboard saves the whole- # sheet in one round-trip.def permitted_params- params.permit(- *model_additional_permitted_attributes,- :name, :admin_name, :code, :fulfillment_provider,- :pickup_point_provider, :rate_provider, :storefront_visible, :tracking_url,- :available_to_sellers,- :estimated_transit_business_days_min, :estimated_transit_business_days_max,- :tax_category_id, :markup_flat, :markup_percent,- :delivery_profile_id, :delivery_origin_group_id, :delivery_zone_id,- stock_location_ids: [], calculator: [:type, { preferences: {} }],- rules: rule_attributes,- services: [:id, :carrier, :service, :label, :markup_flat, :markup_percent, :position]- )+ params.permit(*permitted_attributes, rules: rule_attributes)enddef rule_attributesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rbindex b9c11ac6bf..11549337f9 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rb@@ -10,6 +10,13 @@ module Spreeclass OriginGroupsController < ResourceControllerscoped_resource :settings+ request_params 'DeliveryOriginGroupParams' do+ string :name, nullable: true, example: 'EU warehouse'+ integer :position+ id :stock_location_ids, array: true,+ description: 'Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location.'+ end+def create@resource = scope.new(assignable_params)authorize_resource!(@resource, :create)@@ -46,7 +53,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :position, stock_location_ids: [])+ params.permit(*permitted_attributes)enddef collection_includesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rbindex fbe22b785b..1259e85ac2 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb@@ -9,6 +9,16 @@ module Spreeclass DeliveryProfilesController < ResourceControllerscoped_resource :settings+ request_params 'DeliveryProfileParams' do+ string :name, example: 'Oversized'+ string :kind, example: 'shipping',+ description: 'Registered profile kind (`shipping`, `digital`, extension kinds) from the kinds endpoint. Read on create only; defaults to shipping.'+ boolean :default, description: 'Promotes this profile to the store default; the previous default is demoted.'+ integer :position+ id :stock_location_ids, array: true,+ description: 'Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location.'+ end+# GET /api/v3/admin/delivery_profiles/kinds# Registered profile kinds, so admin UIs offer extension-added# kinds without hardcoding the built-ins.@@ -58,7 +68,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :default, :position, :kind, stock_location_ids: [])+ params.permit(*permitted_attributes)enddef collection_includesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rbindex 3c2f59b4d2..537026a1bf 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb@@ -8,6 +8,21 @@ module Spreeclass DeliveryZonesController < ResourceControllerscoped_resource :settings+ request_params 'DeliveryZoneParams' do+ string :name, example: 'US North-East'+ string :description, nullable: true+ id :delivery_profile_id,+ description: 'Delivery profile this zone belongs to (`fp_...`); defaults to the store default profile.'+ id :delivery_origin_group_id, description: 'Origin group this zone belongs to (`og_...`).'+ object :members, array: true, as: 'DeliveryZoneMemberParams',+ description: "Replaces the zone's full member set atomically." do+ string :member_type, required: true, enum: Spree::DeliveryZoneMember::MEMBER_TYPES+ string :country_code, example: 'US'+ string :state_code, description: 'A subdivision code or name. Without `country_code` the country is inferred when only one country matches.'+ string :postal_code_prefix, :postal_code_from, :postal_code_to+ end+ end+def create@resource = model_class.new(zone_params)authorize_resource!(@resource, :create)@@ -50,11 +65,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :name, :description, :delivery_profile_id, :delivery_origin_group_id,- members: [:member_type, :country_code, :state_code, :postal_code_prefix, :postal_code_from, :postal_code_to]- )+ params.permit(*permitted_attributes)enddef collection_includesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/email_templates/drafts_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/email_templates/drafts_controller.rbindex 0ec2ebed5b..39b9bf1ee4 100644--- a/spree/api/app/controllers/spree/api/v3/admin/email_templates/drafts_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/email_templates/drafts_controller.rb@@ -8,6 +8,15 @@ module Spreeclass DraftsController < Admin::BaseControllerinclude Spree::Api::V3::Admin::EmailTemplateLookup+ request_params 'EmailTemplateDraftParams' do+ include_fields Spree::Api::V3::RequestShapes::EMAIL_TEMPLATE_LANGUAGE+ string :subject, nullable: true, example: 'Your order {{ order.number }} is confirmed'+ string :body, example: '<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name }}!</mj-text></mj-column></mj-section>'+ integer :lock_version, nullable: true, example: 0,+ description: 'The `lock_version` the draft was loaded with, or null when there was no draft; a save from an older copy is refused with 409. Omit it to save without checking.'+ boolean :rebase, description: "Marks the draft as based on Spree's current default, after reviewing what changed in it."+ end+# PUT /api/v3/admin/email_templates/:email_template_id/draft## Send the `lock_version` the draft was loaded with: a save made from@@ -18,7 +27,7 @@ module Spreeresult = Spree.email_template_save_draft_workflow.call(store: current_store, key: email_template.key, locale: language, actor: current_actor,- attributes: params.permit(:subject, :body, :lock_version, :rebase).to_h.symbolize_keys+ attributes: params.permit(*declared_permitted_attributes).to_h.symbolize_keys)render_email_template_result(result)enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/email_templates/previews_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/email_templates/previews_controller.rbindex 76f39a2cdf..83d653e73e 100644--- a/spree/api/app/controllers/spree/api/v3/admin/email_templates/previews_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/email_templates/previews_controller.rb@@ -6,6 +6,10 @@ module Spreeclass PreviewsController < Admin::BaseControllerinclude Spree::Api::V3::Admin::EmailTemplateLookup+ request_params 'EmailTemplatePreviewParams' do+ include_fields Spree::Api::V3::RequestShapes::EMAIL_TEMPLATE_PREVIEW+ end+before_action :authorize_sample_data!# POST /api/v3/admin/email_templates/:email_template_id/previewdiff --git a/spree/api/app/controllers/spree/api/v3/admin/email_templates/publications_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/email_templates/publications_controller.rbindex 7e46922d45..a7881f245d 100644--- a/spree/api/app/controllers/spree/api/v3/admin/email_templates/publications_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/email_templates/publications_controller.rb@@ -6,6 +6,12 @@ module Spreeclass PublicationsController < Admin::BaseControllerinclude Spree::Api::V3::Admin::EmailTemplateLookup+ request_params 'EmailTemplateVersionParams' do+ include_fields Spree::Api::V3::RequestShapes::EMAIL_TEMPLATE_LANGUAGE+ integer :lock_version, permit: false,+ description: "The draft's `lock_version` as reviewed. A draft saved since is refused with 409."+ end+before_action :authorize_sample_data!# POST /api/v3/admin/email_templates/:email_template_id/publicationdiff --git a/spree/api/app/controllers/spree/api/v3/admin/email_templates/restorations_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/email_templates/restorations_controller.rbindex 8318d18bad..a265714092 100644--- a/spree/api/app/controllers/spree/api/v3/admin/email_templates/restorations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/email_templates/restorations_controller.rb@@ -6,6 +6,12 @@ module Spreeclass RestorationsController < Admin::BaseControllerinclude Spree::Api::V3::Admin::EmailTemplateLookup+ request_params 'EmailTemplateRestoreParams' do+ include_fields Spree::Api::V3::RequestShapes::EMAIL_TEMPLATE_LANGUAGE+ integer :lock_version, nullable: true, permit: false,+ description: "The open draft's `lock_version`, or null when there is none; checked as when saving."+ end+# POST /api/v3/admin/email_templates/:email_template_id/revisions/:revision_id/restoration## Copies the revision into the language's draft, to be publisheddiff --git a/spree/api/app/controllers/spree/api/v3/admin/email_templates/test_emails_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/email_templates/test_emails_controller.rbindex 4dd838e965..70f2744c42 100644--- a/spree/api/app/controllers/spree/api/v3/admin/email_templates/test_emails_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/email_templates/test_emails_controller.rb@@ -6,6 +6,10 @@ module Spreeclass TestEmailsController < Admin::BaseControllerinclude Spree::Api::V3::Admin::EmailTemplateLookup+ request_params 'EmailTemplatePreviewParams' do+ include_fields Spree::Api::V3::RequestShapes::EMAIL_TEMPLATE_PREVIEW+ end+before_action :authorize_sample_data!# POST /api/v3/admin/email_templates/:email_template_id/test_emaildiff --git a/spree/api/app/controllers/spree/api/v3/admin/exports_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/exports_controller.rbindex e6a00f6884..3f3c5a7e8e 100644--- a/spree/api/app/controllers/spree/api/v3/admin/exports_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/exports_controller.rb@@ -16,6 +16,19 @@ module Spree# readable ones instead of gating on a single scope.skip_scope_check! only: :index+ request_params :export do+ string :type, required: :create, example: 'products',+ description: 'Which dataset to export, as its shorthand: `products`, `orders`, `customers`, `product_translations`, `gift_cards`, `coupon_codes`, `newsletter_subscribers`, `price_list_prices`, `purchase_orders`, or a type an extension registers.'+ string :record_selection, enum: %w[filtered all], example: 'filtered',+ description: '`filtered` (the default) keeps `search_params`; `all` ignores them and exports every record in scope.'+ string :results_url, example: 'https://admin.example.com/store_abc/exports',+ 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 allowed origins."+ # Read from the raw params: a Ransack hash nests groupings, which+ # `permit(search_params: {})` rejects.+ object :search_params, permit: false, example: { name_cont: 'shirt' },+ description: 'A Ransack query, with the predicates the list endpoint accepts. A `price_list_prices` export requires `price_list_id_eq` naming a price list of the current store, and refuses `record_selection: "all"`.'+ end+# We stream the CSV inline rather than redirecting to ActiveStorage's# signed-URL endpoint because the SPA's Vite proxy only forwards# `/api/*`. A cross-origin redirect to `/rails/active_storage/...`@@ -92,13 +105,10 @@ module Spreeklass.new(attrs)end- # `search_params` carries an arbitrary Ransack hash with nested- # groupings (`{ g: [{ name_cont: 'foo' }] }`). Rails' `permit(k: {})`- # rejects nested hashes, so we extract via `to_unsafe_h`. `:format`- # is intentionally dropped — only CSV is supported and Rails' request- # format would otherwise overwrite the model's enum.+ # `:format` is intentionally dropped — only CSV is supported and Rails'+ # request format would otherwise overwrite the model's enum.def permitted_params- attrs = params.permit(*model_additional_permitted_attributes, :type, :record_selection, :results_url)+ attrs = params.permit(*permitted_attributes)raw = params[:search_params]attrs[:search_params] = raw.respond_to?(:to_unsafe_h) ? raw.to_unsafe_h : raw if raw.present?attrsdiff --git a/spree/api/app/controllers/spree/api/v3/admin/files_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/files_controller.rbindex e871db665e..bf7897e7ba 100644--- a/spree/api/app/controllers/spree/api/v3/admin/files_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/files_controller.rb@@ -12,6 +12,18 @@ module Spreeskip_before_action :authenticate_user+ # Permitted by Spree::Api::V3::FileUploads, shared with the seller branch.+ request_params 'FileUploadCreateParams', action: :create do+ string :filename, required: true, permit: false, example: 'products.csv'+ string :content_type, required: true, permit: false, example: 'text/csv'+ integer :byte_size, permit: false, example: 48_213+ string :checksum, permit: false, example: 'rL0Y20zC+Fzt72VPzMSk2A==',+ description: 'Base64-encoded MD5 digest of the file; the storage service checks the bytes against it.'+ string :visibility, permit: false, enum: Spree::FileUpload::VISIBILITIES,+ description: '`public` (the default) for images and videos customers see, `private` for anything else.'+ string :file, permit: false, format: :binary, description: 'The bytes, for a multipart upload.'+ end+privatedef file_upload_serializerdiff --git a/spree/api/app/controllers/spree/api/v3/admin/gift_card_batches_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/gift_card_batches_controller.rbindex c115ea641a..bcbcfc4041 100644--- a/spree/api/app/controllers/spree/api/v3/admin/gift_card_batches_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/gift_card_batches_controller.rb@@ -11,6 +11,17 @@ module Spreeclass GiftCardBatchesController < ResourceControllerscoped_resource :gift_cards+ request_params :gift_card_batch do+ string :prefix, required: :create, example: 'WELCOME',+ description: 'Lowercased and prepended to every generated code.'+ decimal :amount, required: :create, example: '25.00',+ description: 'The amount of each card, greater than zero.'+ integer :codes_count, required: :create, example: 100,+ description: 'How many cards to generate. Capped at `gift_card_batch_limit`; batches over `gift_card_batch_web_limit` generate in the background.'+ string :currency, example: 'USD', description: 'ISO 4217 currency code. Defaults to the store currency.'+ date :expires_at, nullable: true, example: '2030-12-31'+ end+protecteddef model_class@@ -22,7 +33,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :prefix, :codes_count, :amount, :expires_at, :currency)+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/gift_cards_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/gift_cards_controller.rbindex f00a534cde..6d290848f9 100644--- a/spree/api/app/controllers/spree/api/v3/admin/gift_cards_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/gift_cards_controller.rb@@ -13,6 +13,16 @@ module Spreeclass GiftCardsController < ResourceControllerscoped_resource :gift_cards+ request_params :gift_card do+ decimal :amount, required: :create, example: '25.00', description: 'Greater than zero.'+ string :currency, example: 'USD', description: 'ISO 4217 currency code. Defaults to the store currency.'+ string :code, example: 'WELCOME50', description: 'Generated when omitted.'+ date :expires_at, nullable: true, example: '2030-12-31'+ # Resolved through the caller's ability by `resolve_customer`.+ id :customer_id, nullable: true, permit: false, example: 'cus_UkLWZg9DAJ',+ description: 'The customer the card belongs to. Needs the `read_customers` permission; null detaches it.'+ end+before_action :resolve_customer, only: [:create, :update]protected@@ -26,7 +36,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :code, :amount, :expires_at, :currency).tap do |attributes|+ params.permit(*permitted_attributes).tap do |attributes|attributes[:customer] = @customer if params.key?(:customer_id)endenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/imports_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/imports_controller.rbindex a46c19b28a..38a87acf7a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/imports_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/imports_controller.rb@@ -21,6 +21,28 @@ module Spree# writable ones instead of gating on a single scope.skip_scope_check! only: :index+ request_params :import do+ string :type, required: :create, example: 'products',+ description: 'Which dataset to import, as its shorthand: `products`, `customers`, `product_translations`, `price_list_prices`, `purchase_orders`, or a type an extension registers.'+ string :attachment_signed_id, required: :create,+ description: 'The `signed_id` of the uploaded CSV, from `files.upload()` with `visibility: "private"`.'+ string :delimiter, enum: [',', ';', '|', "\t"], example: ',',+ description: 'CSV column separator. Defaults to a comma.'+ string :results_url, example: 'https://admin.example.com/store_abc/settings/imports',+ 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 allowed origins."+ id :price_list_id, description: 'For `price_list_prices` imports: the price list the rows are merged into. Must belong to the current store; other types ignore it.'+ end++ request_params 'ImportCompleteMappingParams', action: :complete_mapping do+ object :mappings, array: true,+ description: 'Column assignments to apply before processing starts. Omit to accept the ones assigned on create.' do+ string :schema_field, required: true, example: 'slug',+ description: "A schema field name from the import's `schema_fields`."+ string :file_column, nullable: true, example: 'Product Handle',+ description: 'The CSV header to read the field from; null unmaps the field.'+ end+ end+# POST /api/v3/admin/imports## `attachment_signed_id` is a signed id obtained from@@ -257,7 +279,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, :attachment_signed_id, :delimiter, :results_url, :price_list_id)+ params.permit(*permitted_attributes)end# A price-list import writes into one list, named by its prefixed id.diff --git a/spree/api/app/controllers/spree/api/v3/admin/integrations_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/integrations_controller.rbindex 3ec201d473..aad61f55b1 100644--- a/spree/api/app/controllers/spree/api/v3/admin/integrations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/integrations_controller.rb@@ -15,6 +15,13 @@ module Spreesubclassed_via -> { Spree::Integration.registered_classes },unknown_type_error: 'unknown_integration_type'+ request_params :integration do+ string :type, required: true, only: :create, example: 'carrier',+ description: 'Wire shorthand from the integration types endpoint.'+ boolean :active, description: 'Activating runs the connection check, and a failed check is a 422.'+ object :preferences, description: 'Credential values. Secret preferences come back masked, and sending a masked value back keeps the stored secret.'+ end+# GET /api/v3/admin/integrations/types# Pure registry discovery — which integrations are installed and how# they're configured. Deliberately carries no per-store connected@@ -47,7 +54,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, :active, preferences: {})+ params.permit(*permitted_attributes)end# `types` is read-only discovery — maps to the read scope.diff --git a/spree/api/app/controllers/spree/api/v3/admin/invitation_acceptances_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/invitation_acceptances_controller.rbindex c8c165ab9c..5f4f81fcc0 100644--- a/spree/api/app/controllers/spree/api/v3/admin/invitation_acceptances_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/invitation_acceptances_controller.rb@@ -10,6 +10,11 @@ module Spreeskip_scope_check!skip_before_action :authenticate_admin!, only: [:lookup, :accept]+ request_params 'InvitationAcceptParams', action: :accept do+ string :password, description: 'Required when the invitee has no account yet: it creates one. An existing account signs in without it.'+ string :password_confirmation, :first_name, :last_name+ end+rate_limit to: Spree::Api::Config[:rate_limit_login],within: Spree::Api::Config[:rate_limit_window].seconds,store: Rails.cache,@@ -24,7 +29,6 @@ module Spreeend# POST /api/v3/admin/auth/invitations/:id/accept?token=:token- # Body: { password?, password_confirmation?, first_name?, last_name? }def acceptreturn unless load_invitation@@ -99,7 +103,7 @@ module Spreeenddef signup_params(invitation)- params.permit(:password, :password_confirmation, :first_name, :last_name).+ params.permit(*declared_permitted_attributes).merge(email: invitation.email)enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/invitations_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/invitations_controller.rbindex b27832a759..9eab8f93d2 100644--- a/spree/api/app/controllers/spree/api/v3/admin/invitations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/invitations_controller.rb@@ -13,6 +13,11 @@ module Spree# grantable separately from store configuration (6.0-admin-rbac.md).scoped_resource :staff+ request_params :invitation do+ string :email, required: :create+ id :role_id, required: :create, description: 'The role (`role_...`) the invitee gets on accepting.'+ end+# POST /api/v3/admin/invitations# Guards against inviting a new staff member straight into the admin# super-role unless the inviter already holds it.@@ -65,7 +70,7 @@ module Spree# No extension union: an invitation carries only the role grant, which is# the authorization surface itself, not extensible resource data.def permitted_params- attrs = params.permit(:email, :role_id)+ attrs = params.permit(*declared_permitted_attributes)if attrs[:role_id].present? && Spree::PrefixedId.prefixed_id?(attrs[:role_id])attrs[:role_id] = Spree::PrefixedId.decode_prefixed_id(attrs[:role_id])enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/markets_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/markets_controller.rbindex 90f451ab5a..31b343bc1f 100644--- a/spree/api/app/controllers/spree/api/v3/admin/markets_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/markets_controller.rb@@ -13,6 +13,22 @@ module Spreeclass MarketsController < ResourceControllerscoped_resource :settings+ request_params :market do+ string :name, required: :create, example: 'Europe', description: 'Display name, unique within the store.'+ string :currency, required: :create, example: 'EUR', description: 'ISO 4217 currency code.'+ string :default_locale, required: :create, example: 'de',+ description: 'Locale used as the market default. Always part of `supported_locales`.'+ boolean :tax_inclusive, description: 'Display prices with tax included.'+ string :tax_provider, nullable: true, example: 'internal',+ description: 'Shorthand of the tax engine that prices this market, from the tax providers endpoint. Null uses the installation default.'+ boolean :default, description: 'Setting true demotes the previous default market of the store.'+ integer :position, description: 'Sort order within the store; lower comes first.'+ string :supported_locales, array: true, example: %w[de en],+ description: 'Locales available in this market. The default locale is always included.'+ string :country_codes, array: true, required: :create, example: %w[DE FR],+ description: 'ISO 3166-1 alpha-2 codes of the countries in this market. At least one is required.'+ end+protecteddef model_class@@ -30,15 +46,6 @@ module Spreedef scopesuper.orderedend-- def permitted_params- normalize_params(- params.permit(- :name, :currency, :default_locale, :tax_inclusive, :tax_provider,- :default, :position, supported_locales: [], country_codes: []- )- )- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/me_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/me_controller.rbindex 6b0d885f32..1520207454 100644--- a/spree/api/app/controllers/spree/api/v3/admin/me_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/me_controller.rb@@ -7,6 +7,13 @@ module Spreeskip_scope_check!+ request_params :me do+ string :selected_locale, example: 'de', description: 'The dashboard display language.'+ string :first_name, :last_name+ string :avatar_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` to set the avatar, or null to remove it. Omit it to keep the current photo.'+ end+before_action :require_current_user!# GET /api/v3/admin/me@@ -70,7 +77,7 @@ module Spreeenddef permitted_params- params.permit(:selected_locale, :first_name, :last_name, :avatar_signed_id)+ params.permit(*declared_permitted_attributes)enddef me_responsediff --git a/spree/api/app/controllers/spree/api/v3/admin/media_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/media_controller.rbindex 273ba73083..fd7d1649bb 100644--- a/spree/api/app/controllers/spree/api/v3/admin/media_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/media_controller.rb@@ -5,6 +5,26 @@ module Spreeclass MediaController < ResourceControllerscoped_resource :products+ # The media file, a URL to fetch one from, and the library row to copy+ # are transport, not attributes (+media_attributes+ drops them).+ request_params :media do+ external_references+ string :alt, nullable: true, example: 'Front view'+ integer :position, example: 1+ string :media_type, enum: Spree::Media::MEDIA_TYPES, example: 'image',+ description: 'Defaults to `image`. `video` needs a `signed_id`; `external_video` needs an `external_video_url`.'+ string :external_video_url, nullable: true, description: 'YouTube or Vimeo link. Required when `media_type` is `external_video`.'+ string :poster_signed_id, description: "A `signed_id` from `files.upload()` for a video's poster frame."+ number :focal_point_x, :focal_point_y, nullable: true+ string :attachment, description: 'The file itself, sent as multipart form data. JSON clients upload first and send `signed_id`.'+ string :url, description: 'Fetch an image from this URL, in the background. Images only: an external video uses `external_video_url`.'+ string :signed_id, description: 'A `signed_id` from `files.upload()` for the media file itself.'+ id :source_media_id,+ description: 'Place a file that is already in the library. The new row shares the source file rather than copying it, and takes its own alt, position and variant links from here.'+ id :variant_ids, array: true,+ description: 'Variants to link this product-level media to. Variants of other products are dropped.'+ end+def create# An external video has no file, so it takes the plain create path# even though a URL is present — `url` means "fetch this image from@@ -91,16 +111,8 @@ module Spreepermitted_params.except(:attachment, :url, :signed_id, :source_media_id)end- # The media file, a URL to fetch one from, and the library row to copy- # are transport, not attributes — everything a client can set lives on- # the model.def permitted_params- params.permit(- *model_additional_permitted_attributes,- *Spree::Media::WRITABLE_ATTRIBUTES,- :attachment, :url, :signed_id, :source_media_id,- variant_ids: []- )+ params.permit(*permitted_attributes)enddef external_video_request?diff --git a/spree/api/app/controllers/spree/api/v3/admin/media_library_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/media_library_controller.rbindex e9b5c5f3d8..855104ba79 100644--- a/spree/api/app/controllers/spree/api/v3/admin/media_library_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/media_library_controller.rb@@ -19,6 +19,10 @@ module Spree# `products` — those are one product's own media, reached through a# product the caller can already see.scoped_resource :media++ request_params :media_library do+ include_fields MediaController.request_params_schema+ end# Restates the base class's member actions with `usage` added — a# second `before_action :set_resource` would replace that filter# rather than extend it, leaving show/update/destroy without a record.diff --git a/spree/api/app/controllers/spree/api/v3/admin/option_types_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/option_types_controller.rbindex 8660caaf49..f143c64cba 100644--- a/spree/api/app/controllers/spree/api/v3/admin/option_types_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/option_types_controller.rb@@ -5,6 +5,24 @@ module Spreeclass OptionTypesController < ResourceControllerscoped_resource :products+ request_params :option_type do+ string :name, required: :create, example: 'color'+ string :label, required: :create, example: 'Color'+ integer :position+ boolean :filterable+ string :kind, enum: Spree::OptionType::KINDS+ object :option_values, array: true, as: 'OptionValueParams',+ description: 'Inline option values. Values left out of the list on update are destroyed, so send the full set every time.' do+ id :id, description: 'Present for existing values. Omit to create a new one.'+ string :name, example: 'red'+ string :label, example: 'Red'+ integer :position+ string :color_code, nullable: true, example: '#FF0000',+ description: "Hex color. Only meaningful when the option type's `kind` is `color_swatch`."+ string :image_signed_id, nullable: true, description: 'A `signed_id` from `files.upload()`, or null to remove the image.'+ end+ end+protecteddef model_class@@ -20,13 +38,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :name, :label, :position, :filterable, :kind,- option_values: [- :id, :name, :label, :position, :color_code, :image_signed_id- ]- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/order_cancellation_reasons_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/order_cancellation_reasons_controller.rbindex cbd5825bfe..9133088b50 100644--- a/spree/api/app/controllers/spree/api/v3/admin/order_cancellation_reasons_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/order_cancellation_reasons_controller.rb@@ -5,6 +5,11 @@ module Spreeclass OrderCancellationReasonsController < ResourceControllerscoped_resource :settings+ request_params :reason do+ string :name, required: :create+ boolean :active, description: 'Whether the reason is offered on new records.'+ end+protecteddef model_class@@ -16,7 +21,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :active)+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/order_routing_rules_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/order_routing_rules_controller.rbindex 7b3ae0db7a..69cb8780e8 100644--- a/spree/api/app/controllers/spree/api/v3/admin/order_routing_rules_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/order_routing_rules_controller.rb@@ -13,6 +13,14 @@ module Spreesubclassed_via -> { Spree.order_routing.rules },unknown_type_error: 'unknown_order_routing_rule_type'+ request_params :order_routing_rule do+ string :type, required: true, only: :create, example: 'preferred_location',+ description: 'Wire shorthand for the rule kind, from the order routing rule types endpoint.'+ boolean :active+ integer :position, description: "1-based priority in the channel's rule list. Omitted on create, the rule goes last; a new position reorders the rest of the list around it."+ object :preferences, description: "Values for the rule kind's preference schema."+ end+def typesauthorize! :read, model_class@@ -30,7 +38,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, :active, :position, preferences: {})+ params.permit(*permitted_attributes)end# `types` is read-only discovery — maps to the read scope + :show ability.diff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/claims_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/claims_controller.rbindex c64d887d7d..dc33900381 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/claims_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/claims_controller.rb@@ -12,6 +12,37 @@ module Spree# would name a key no catalog knows.scoped_resource :orders+ request_params :claim do+ object :items, array: true, required: :create, only: :create,+ description: 'Affected items, and how each should be made right.' do+ id :line_item_id, required: true+ integer :quantity, required: true+ string :description+ boolean :send_replacement+ id :replacement_variant_id, description: 'Defaults to the variant that was bought.'+ decimal :refund_amount+ end+ id :reason_id, description: "One of the store's claim reasons."+ string :memo+ object :metadata, only: :update+ end++ request_params 'ClaimResolveParams', action: :resolve do+ string :resolution, required: true, enum: Spree::Claim::RESOLUTIONS, description: 'Money back, a replacement shipment, or both.'+ string :refund_method, enum: Spree::RefundMethods::METHODS, description: 'Defaults to `store_credit`.'+ decimal :amount, description: 'Defaults to the claim total.'+ id :replacement_line_item_ids, array: true,+ description: 'Which claim lines to send a replacement for. Omit to keep what the claim was opened with.'+ end++ request_params 'ClaimDenyParams', action: :deny do+ string :reason, description: 'Recorded on the claim for the customer.'+ end++ request_params 'ClaimCancelParams', action: :cancel do+ string :reason, description: 'A note on why the claim was canceled.'+ end+before_action :set_resource, only: [:show, :update, :approve, :resolve, :deny, :cancel]# PATCH /api/v3/admin/orders/:order_id/claims/:id@@ -36,7 +67,7 @@ module Spreeenddef permitted_params- params.permit(:memo, :reason_id, metadata: {})+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/deliveries_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/deliveries_controller.rbindex 8784a7f171..9d358ea39a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/deliveries_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/deliveries_controller.rb@@ -13,6 +13,21 @@ module Spreeclass DeliveriesController < BaseControllerinclude Spree::Api::V3::Orders::DeliveryActions+ # The permit list itself lives in DeliveryActions, shared with the+ # seller branch; this declaration documents it.+ request_params :delivery do+ string :tracking_number, required: :create,+ description: 'A carrier tracking number, a freight PRO or container number, or a full tracking link. A corrected number resets the carrier status to `pending`.'+ string :carrier, description: "Free text; detected from the number's format when omitted."+ string :service, :tracking_url+ end++ request_params 'DeliveryMarkDeliveredParams', action: :mark_delivered do+ datetime :delivered_at, description: 'When it arrived. Defaults to now.'+ boolean :notify_customer,+ description: 'Whether the customer gets a delivery notification once the parcel completes. Defaults to true.'+ end+before_action :set_resource, only: [:show, :update, :destroy, :mark_delivered]# PATCH .../deliveries/:id/mark_delivered — staff saying this one@@ -47,7 +62,7 @@ module Spreeprivatedef mark_delivered_params- @mark_delivered_params ||= params.permit(:delivered_at, :notify_customer)+ @mark_delivered_params ||= params.permit(*declared_permitted_attributes)end# Only an explicit false suppresses the email.diff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/discount_codes_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/discount_codes_controller.rbindex 0ce1ce4446..299d8c1791 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/discount_codes_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/discount_codes_controller.rb@@ -10,6 +10,10 @@ module Spree# orders are frozen; their discounts change only through manual rows# (see DiscountsController).class DiscountCodesController < BaseController+ request_params 'DiscountCodeApplyParams' do+ string :code, required: true+ end+skip_before_action :set_resource, raise: false# POST /api/v3/admin/orders/:order_id/discount_codes@@ -76,7 +80,7 @@ module Spreeenddef permitted_params- params.permit(:code)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/discounts_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/discounts_controller.rbindex d6bcc25291..eba453e52d 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/discounts_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/discounts_controller.rb@@ -11,6 +11,16 @@ module Spreeclass DiscountsController < BaseControllerscoped_resource :orders+ request_params :discount do+ string :label, required: :create, example: 'Customer appeasement'+ decimal :value, only: :create, example: '10.00',+ description: 'An amount in the order currency for a `flat` discount, or a percentage for a `percent` one.'+ decimal :amount, description: 'On create, an older spelling of `value`, read when `value` is absent. On update, the new amount of the row.'+ string :value_type, only: :create, enum: %w[flat percent], description: 'Defaults to `flat`.'+ id :line_item_id, only: :create, nullable: true,+ description: 'The line item the discount applies to. Omitted, the value is distributed across the line items.'+ end+# POST /api/v3/admin/orders/:order_id/discountsdef createwith_order_lock do@@ -80,7 +90,7 @@ module Spreeenddef permitted_params- params.permit(:label, :amount)+ params.permit(*permitted_attributes)enddef collection_includesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/exchanges_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/exchanges_controller.rbindex 33e76d89a0..0fac32437b 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/exchanges_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/exchanges_controller.rb@@ -13,6 +13,36 @@ module Spree# would name a key no catalog knows.scoped_resource :orders+ request_params :exchange do+ object :items, array: true, required: :create, only: :create,+ description: 'Items coming back, and what goes out in their place.' do+ id :fulfillment_item_id, :new_variant_id, required: true+ integer :quantity, required: true+ end+ id :stock_location_id, description: 'Where the goods come back to.'+ id :reason_id, description: "One of the store's return reasons."+ string :memo+ object :metadata, only: :update+ end++ request_params 'ExchangeReceiveParams', action: :receive do+ object :items, array: true,+ description: 'What actually arrived. Omit to receive everything as requested and resellable.' do+ id :exchange_line_item_id, required: true+ integer :quantity, required: true+ boolean :resellable, description: 'Goods that cannot be resold are received but never restocked. Defaults to true.'+ end+ end++ request_params 'ExchangeFulfillParams', action: :fulfill do+ string :refund_method, enum: Spree::RefundMethods::METHODS,+ description: 'How a credit is returned when the replacements cost less than what came back. Defaults to `store_credit`. A balance the customer owes is left for the merchant to collect.'+ end++ request_params 'ExchangeCancelParams', action: :cancel do+ string :reason, description: 'A note on why the exchange was canceled.'+ end+before_action :set_resource, only: [:show, :update, :approve, :receive, :fulfill, :cancel]# PATCH /api/v3/admin/orders/:order_id/exchanges/:id@@ -37,7 +67,7 @@ module Spreeenddef permitted_params- params.permit(:memo, :reason_id, :stock_location_id, metadata: {})+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/fees_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/fees_controller.rbindex d84eebcb08..b6e7f540af 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/fees_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/fees_controller.rb@@ -11,6 +11,15 @@ module Spreeclass FeesController < BaseControllerscoped_resource :orders+ request_params :fee do+ string :label, required: :create, example: 'Gift wrap'+ decimal :amount, required: :create, example: '4.00'+ string :kind, enum: Spree::Fee::KINDS, example: 'gift_wrap', description: 'Defaults to `surcharge`.'+ # Resolved through the order by the controller, never assigned.+ id :line_item_id, :fulfillment_id, only: :create, nullable: true, permit: false,+ description: 'The line item or fulfillment the fee belongs to. Omitted, the fee is order-level.'+ end+# POST /api/v3/admin/orders/:order_id/feesdef createwith_order_lock do@@ -60,7 +69,7 @@ module Spreeenddef permitted_params- params.permit(:label, :amount, :kind)+ params.permit(*permitted_attributes)enddef collection_includesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/fulfillments_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/fulfillments_controller.rbindex ea77cec93f..896eafb38a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/fulfillments_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/fulfillments_controller.rb@@ -14,6 +14,53 @@ module Spreescoped_resource :fulfillments+ request_params :fulfillment do+ id :stock_location_id, required: :create,+ description: "The location the fulfillment ships from. On update, moving it re-prices the fulfillment against that location's rates."+ id :source_fulfillment_id, only: :create,+ description: "The only fulfillment of this order to move units from, its exchange and claim replacements included: how a canceled replacement is sent again. Omitted, the customer's bought units are taken from every unshipped fulfillment."+ string :tracking, description: 'Carrier tracking number, or a full `https://` tracking link, which is served back as `tracking_url` unchanged.'+ string :tracking_carrier, only: :update,+ description: "Which carrier the tracking number belongs to: a slug from the tracking carriers endpoint. Left blank, it is detected from the number's format where possible."+ id :selected_delivery_rate_id, only: :update+ id :delivery_method_id, only: :create,+ description: 'Delivery method attached as the selected rate. Defaults to the delivery method of the fully drained source fulfillments.'+ decimal :cost, only: :create, example: '7.42',+ description: 'Explicit shipping cost, such as the 3PL price. Defaults to the summed cost of the fully drained source fulfillments, which keeps the order total unchanged. Persists only with `status: shipped`; pending fulfillments are re-priced by the rate engine.'+ string :status, only: :create, enum: %w[shipped], description: 'Pass `shipped` to register an already-shipped external fulfillment.'+ object :metadata, only: :create+ object :items, array: true, only: :create,+ description: 'Line item quantities to fulfill. Omit to fulfill every unit not yet shipped.' do+ id :item_id, required: true+ integer :quantity, required: true+ end+ end++ request_params 'FulfillmentFulfillParams', action: :fulfill do+ object :items, array: true,+ description: 'Line item quantities to ship. Omit to ship everything the fulfillment holds; a subset is split onto a new fulfillment, which is the one that ships.' do+ id :item_id, required: true+ integer :quantity, required: true+ end+ string :tracking, description: 'Carrier tracking number or a full `https://` tracking link, stored on the fulfillment that ships.'+ string :tracking_carrier, description: 'Which carrier the number belongs to; detected from the number when omitted.'+ boolean :notify_customer,+ description: 'Whether the customer gets the shipment email. Defaults to true; pass false to suppress it for this dispatch only.'+ boolean :force,+ description: 'Hand the goods over even though the order is unpaid or holds backordered units.'+ end++ request_params 'FulfillmentMarkDeliveredParams', action: :mark_delivered do+ datetime :delivered_at, description: 'When it arrived. Defaults to now; return windows run from this time.'+ boolean :notify_customer, description: 'Whether the customer gets a delivery notification. Defaults to true.'+ end++ request_params 'FulfillmentSplitParams', action: :split do+ id :variant_id, required: true, description: 'The variant being moved out.'+ integer :quantity, required: true+ id :stock_location_id, description: "Origin of the new fulfillment. Defaults to the source fulfillment's location."+ end+before_action :set_resource, only: [:show, :update, :fulfill, :mark_delivered, :cancel, :split]# POST /api/v3/admin/orders/:order_id/fulfillments@@ -74,7 +121,7 @@ module Spreeenddef permitted_params- params.permit(:tracking, :tracking_carrier, :selected_delivery_rate_id, :stock_location_id)+ params.permit(*permitted_attributes)endprivate@@ -101,11 +148,11 @@ module Spreeenddef create_params- @create_params ||= params.permit(:stock_location_id, :source_fulfillment_id, :tracking, :delivery_method_id, :cost, :status, metadata: {}, items: [:item_id, :quantity])+ @create_params ||= params.permit(*declared_permitted_attributes)enddef mark_delivered_params- @mark_delivered_params ||= params.permit(:delivered_at, :notify_customer)+ @mark_delivered_params ||= params.permit(*declared_permitted_attributes)enddef find_stock_location!(id)diff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/gift_cards_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/gift_cards_controller.rbindex df1f596083..498b39890d 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/gift_cards_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/gift_cards_controller.rb@@ -6,9 +6,11 @@ module Spreeclass GiftCardsController < BaseControllerskip_before_action :set_resource, raise: false+ request_params 'GiftCardApplyParams' do+ string :code, required: true, description: 'The gift card code; matched case-insensitively.'+ end+# POST /api/v3/admin/orders/:order_id/gift_cards- #- # Body: { code: String }def createwith_order_lock dogift_card = find_gift_card!diff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/items_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/items_controller.rbindex 696b38fdbb..0788355ff5 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/items_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/items_controller.rb@@ -4,6 +4,15 @@ module Spreemodule Adminmodule Ordersclass ItemsController < BaseController+ request_params :line_item do+ id :variant_id, required: true, only: :create+ integer :quantity, example: 1, description: 'Defaults to 1 when adding an item.'+ decimal :price, nullable: true,+ description: "Negotiated unit price. Stamps the line `price_source: 'manual'`, so quantity changes and recalculation never re-price it; an explicit null reverts the line to catalog pricing. Omit to leave pricing alone. Draft (incomplete) orders only."+ object :options, only: :create+ object :metadata, only: :update+ end+# POST /api/v3/admin/orders/:order_id/itemsdef createwith_order_lock do@@ -69,7 +78,7 @@ module Spreeenddef permitted_params- params.permit(:variant_id, :quantity, :price, metadata: {}, options: {})+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/labels_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/labels_controller.rbindex b950b54d27..b7fb049e03 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/labels_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/labels_controller.rb@@ -11,6 +11,20 @@ module Spreeclass LabelsController < BaseControllerinclude Spree::Api::V3::Orders::ShippingLabelActions+ # The permit list itself lives in ShippingLabelActions, shared with+ # the seller branch; this declaration documents it.+ request_params :shipping_label do+ string :file_signed_id,+ description: 'A `signed_id` from `files.upload()`. Its presence records a label bought elsewhere instead of buying one; without it the body is ignored and the label is bought through the carrier.'+ string :tracking_number, description: 'The number printed on an uploaded label. Required with `file_signed_id`.'+ string :carrier, description: "Free text; a forwarder's name is as valid as a carrier slug. Detected from the number when omitted."+ string :service, description: 'Carrier service the label was bought at.'+ decimal :cost, description: "What the merchant paid the carrier. Accounting data only; it never touches the order's shipping charge."+ string :currency, description: 'Currency of the cost.'+ string :file_format, enum: %w[pdf png zpl], description: 'Taken from the file when omitted.'+ string :tracking_url, description: 'Tracking page for the consignment the label mints.'+ end+before_action :set_resource, only: [:show, :download, :refund, :destroy]# POST .../labelsdiff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/payments_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/payments_controller.rbindex 34b9ec99c8..e0a1c15bd8 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/payments_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/payments_controller.rb@@ -6,6 +6,16 @@ module Spreeclass PaymentsController < BaseControllerscoped_resource :payments+ request_params :payment do+ id :payment_method_id, required: :create+ decimal :amount, description: "Defaults to the order total left after store credit."+ id :source_id, description: "A saved payment source of the order's customer (a credit card), for an off-session charge. Used only by payment methods that require a source."+ end++ request_params 'PaymentCaptureParams', action: :capture do+ decimal :amount, description: 'Captures part of the authorized amount. Defaults to all of it.'+ end+before_action :set_resource, only: [:show, :capture, :void]# POST /api/v3/admin/orders/:order_id/payments@@ -79,10 +89,6 @@ module SpreeSpree.api.admin_payment_serializerend- def permitted_params- params.permit(:amount, :payment_method_id, :source_id)- end-# Saved-source charges require an order customer — sources are scoped# to that customer to prevent attaching customer A's card to# customer B's order. Refuse if no customer is assigned.diff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/refunds_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/refunds_controller.rbindex 89c5f4efbf..e3caf8bbd9 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/refunds_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/refunds_controller.rb@@ -6,6 +6,12 @@ module Spreeclass RefundsController < BaseControllerscoped_resource :refunds+ request_params :refund do+ id :payment_id, required: :create+ decimal :amount, required: :create+ id :refund_reason_id, description: "Defaults to the store's first refund reason."+ end+# POST /api/v3/admin/orders/:order_id/refunds## Deliberately not wrapped in with_order_lock: the workflow callsdiff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/returns_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/returns_controller.rbindex 2c423cc2f0..ea2dd0a121 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/returns_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/returns_controller.rb@@ -19,6 +19,37 @@ module Spree# would be wrongly denied.scoped_resource :orders+ request_params :return do+ object :items, array: true, required: :create, only: :create,+ description: 'Fulfilled units coming back, and how many of each.' do+ id :fulfillment_item_id, required: true+ integer :quantity, required: true+ end+ id :stock_location_id, description: 'Where the goods come back to. Defaults to the location that shipped them.'+ id :reason_id, description: "One of the store's return reasons."+ string :memo+ object :metadata, only: :update+ end++ request_params 'ReturnReceiveParams', action: :receive do+ object :items, array: true,+ description: 'What actually arrived. Omit to receive everything as requested and resellable; send rows for a partial or damaged receipt.' do+ id :return_line_item_id, required: true+ integer :quantity, required: true+ boolean :resellable, description: 'Goods that cannot be resold are received but never restocked. Defaults to true.'+ end+ end++ request_params 'ReturnRefundParams', action: :refund do+ decimal :amount, description: 'Defaults to the value of what was actually received.'+ string :refund_method, enum: Spree::RefundMethods::METHODS,+ description: '`store_credit` issues credit immediately; `original_payment` (the default) refunds through the gateway that took the money.'+ end++ request_params 'ReturnCancelParams', action: :cancel do+ string :reason, description: 'A note on why the return was canceled.'+ end+before_action :set_resource, only: [:show, :update, :approve, :receive, :refund, :cancel]# PATCH /api/v3/admin/orders/:order_id/returns/:id@@ -50,7 +81,7 @@ module Spreeenddef permitted_params- params.permit(:memo, :reason_id, :stock_location_id, metadata: {})+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/orders/store_credits_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders/store_credits_controller.rbindex 2178a78d1c..993192a741 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders/store_credits_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders/store_credits_controller.rb@@ -6,10 +6,12 @@ module Spreeclass StoreCreditsController < BaseControllerskip_before_action :set_resource, raise: false+ request_params 'StoreCreditApplyParams' do+ decimal :amount, description: "Defaults to the customer's available store credit, up to the order total."+ end+# POST /api/v3/admin/orders/:order_id/store_credits#- # Body: { amount: Number (optional) }- ## When `amount` is omitted, applies the customer's available store# credit up to the order total.def creatediff --git a/spree/api/app/controllers/spree/api/v3/admin/orders_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/orders_controller.rbindex bb00f47b9c..21a469eccb 100644--- a/spree/api/app/controllers/spree/api/v3/admin/orders_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/orders_controller.rb@@ -10,6 +10,68 @@ module Spree# The order accepts a `po_document_signed_id` and streams it back.include ActiveStorage::SetCurrent+ ADDRESS = Spree::Api::V3::RequestSchema.shape('AddressInputParams') do+ string :first_name, :last_name+ string :firstname, :lastname, description: 'Legacy spelling of `first_name` / `last_name`; send only one of the two.'+ string :address1, :address2, :city+ string :postal_code+ string :zipcode, description: 'Legacy spelling of `postal_code`; send only one of the two.'+ string :country_code, example: 'US'+ string :state_code, example: 'NY'+ string :state_name, description: 'For countries without states in the database.'+ string :phone, :alternative_phone, :company, :label+ end++ request_params :order do+ external_references+ string :email, example: '[email protected]'+ id :customer_id+ boolean :use_customer_default_address, only: :create,+ description: "With `customer_id`, copies the customer's saved billing and shipping addresses onto the order."+ string :currency, example: 'USD'+ id :market_id+ id :channel_id, description: 'Defaults to the store primary channel when omitted.'+ string :locale, example: 'en-US'+ string :customer_note, description: 'Public, customer-visible note.'+ string :internal_note, description: 'Staff-only note. Rich text HTML; reads come back as this plus `internal_note_html`.'+ string :po_number, description: "The buyer's own purchase-order reference. Searchable alongside the order number, and rendered on every order-facing document."+ string :po_document_signed_id, nullable: true,+ description: "The `signed_id` of the buyer's purchase order, from `files.upload()` with `visibility: 'private'`. Null removes the document the order carries."+ id :shipping_address_id, :billing_address_id, only: :create, description: 'An existing address of the customer.'+ id :preferred_stock_location_id,+ description: "Stock location to prefer for fulfillment. Order Routing's built-in preferred-location rule ranks it first; routing falls back to the next rule when the location can't cover the cart."+ id :company_id, nullable: true,+ description: "Makes the order a company purchase, with that company's catalog prices and tax treatment. Null makes a draft a plain customer order again."+ string :coupon_code, only: :create, description: 'Applied non-fatally: an invalid code does not block creation.'+ object :metadata+ string :tags, array: true+ object :shipping_address, shape: ADDRESS+ object :billing_address, shape: ADDRESS+ object :items, array: true,+ description: 'Line items to upsert, keyed by variant. An entry sets that variant\'s quantity, creating the line item when the order has none; `quantity: 0` removes it. Variants you do not send are left alone.' do+ id :variant_id, required: true+ integer :quantity, example: 1+ decimal :price, nullable: true,+ description: "Negotiated unit price; stamps `price_source: 'manual'`. Null reverts the line to catalog pricing. Draft orders only."+ object :metadata+ end+ end++ request_params 'OrderCompleteParams', action: :complete do+ boolean :payment_pending+ boolean :notify_customer, description: 'Send the order confirmation email after completion.'+ end++ request_params 'OrderCancelParams', action: :cancel do+ id :cancel_reason_id, description: "Why the order was canceled: the id of one of the store's cancellation reasons."+ string :cancel_note, description: 'Staff-facing note about the cancellation.'+ boolean :refund_payments,+ description: "Whether this order's share of a payment shared across a split checkout is handed back."+ decimal :refund_amount,+ description: 'How much of that share to return. Defaults to all of it; refused on an order whose payment is not shared.'+ boolean :notify_customer, description: 'Send the order cancellation email after canceling.'+ end+skip_before_action :set_resource, only: [:index, :create]before_action :set_resource, only: [:show, :update, :destroy, :complete, :cancel, :approve, :resend_confirmation, :resend_digital_links, :po_document]@@ -260,44 +322,13 @@ module Spreeenddef order_create_params- permitted = normalize_params(- params.permit(- :email, :customer_id, :use_customer_default_address,- :currency, :market_id, :channel_id, :locale,- :customer_note, :internal_note,- # The buyer's own purchase-order reference, and the signed blob- # id of the document behind it — a PO arriving by email and- # keyed in is the draft-order flow plus these two fields.- :po_number, :po_document_signed_id,- :shipping_address_id, :billing_address_id,- :preferred_stock_location_id, :company_id,- :coupon_code,- metadata: {},- tags: [],- shipping_address: address_permitted_keys,- billing_address: address_permitted_keys,- items: item_permitted_keys- )- )- resolve_company_param(permitted)+ resolve_company_param(normalize_params(params.permit(*request_params_schema.permit_list(:create))))end+ # Named rather than read from the action, since an upsert reaches+ # update from the create action.def order_update_params- permitted = normalize_params(- params.permit(- :email, :customer_id,- :customer_note, :internal_note,- :po_number, :po_document_signed_id,- :currency, :locale, :market_id, :channel_id,- :preferred_stock_location_id, :company_id,- metadata: {},- tags: [],- shipping_address: address_permitted_keys,- billing_address: address_permitted_keys,- items: item_permitted_keys- )- )- resolve_company_param(permitted)+ resolve_company_param(normalize_params(params.permit(*request_params_schema.permit_list(:update))))end# An incidental lookup like any other: resolved through the store so@@ -315,20 +346,6 @@ module Spreeendpermittedend-- def address_permitted_keys- [- :firstname, :lastname, :first_name, :last_name,- :address1, :address2, :city,- :country_code, :state_code,- :zipcode, :postal_code, :phone, :alternative_phone,- :state_name, :company, :label- ]- end-- def item_permitted_keys- [:variant_id, :quantity, :price, { metadata: {} }]- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/package_types_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/package_types_controller.rbindex 95bd768e3f..504b75c44f 100644--- a/spree/api/app/controllers/spree/api/v3/admin/package_types_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/package_types_controller.rb@@ -14,6 +14,20 @@ module Spreeclass PackageTypesController < ResourceControllerscoped_resource :package_types+ request_params :package_type do+ string :name, required: :create, example: 'Euro pallet', description: 'Unique within the store.'+ string :kind, required: :create, enum: Spree::PackageType::KINDS, example: 'pallet',+ description: 'What this packaging is: the box parcels ship in, or the carton, pallet or container a wholesale order leaves on.'+ number :length, :width, :height, nullable: true+ string :dimensions_unit, nullable: true, enum: Spree::Variant::DIMENSION_UNITS, example: 'cm',+ description: "Unit the three dimensions are in; falls back to the store's unit system."+ number :weight, nullable: true, description: "The empty package's own weight, added to content weight on every quote."+ number :max_weight, nullable: true, description: 'What the package can hold, not the same as its own weight.'+ string :weight_unit, nullable: true, enum: Spree::Variant::WEIGHT_UNITS, example: 'kg'+ boolean :default, description: 'The box every parcel quote is built on. Setting this demotes whichever row held it.'+ object :metadata+ end+protecteddef model_class@@ -27,11 +41,6 @@ module Spreedef collection_includes[:seller]end-- def resource_permitted_attributes- [:name, :kind, :length, :width, :height, :dimensions_unit,- :weight, :max_weight, :weight_unit, :default, { metadata: {} }]- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/password_resets_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/password_resets_controller.rbindex 67d0e5b6e8..bc0b8adbef 100644--- a/spree/api/app/controllers/spree/api/v3/admin/password_resets_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/password_resets_controller.rb@@ -15,6 +15,16 @@ module Spreeskip_before_action :authenticate_admin!+ request_params 'PasswordResetRequestParams', action: :create do+ string :email, required: true, permit: false, format: :email, example: '[email protected]'+ string :redirect_url, permit: false, example: 'https://admin.your-store.com/reset-password',+ description: 'The page the emailed reset link points at, with the reset token appended. Honored only on the dashboard origin, for an account that is staff of the store; ignored otherwise.'+ end++ request_params 'PasswordResetParams', action: :update do+ string :password, :password_confirmation, required: true, permit: false+ end+# POST /api/v3/admin/password_resetsdef createuser = Spree.admin_user_class.find_by(email: params[:email])diff --git a/spree/api/app/controllers/spree/api/v3/admin/payment_methods_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/payment_methods_controller.rbindex deee8628dd..d81da6bc14 100644--- a/spree/api/app/controllers/spree/api/v3/admin/payment_methods_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/payment_methods_controller.rb@@ -10,6 +10,21 @@ module Spreesubclassed_via -> { Spree::PaymentMethod.providers },unknown_type_error: 'unknown_payment_method_type'+ request_params :payment_method do+ string :type, required: true, only: :create, permit: false, example: 'check',+ description: 'Wire shorthand from the payment method types endpoint.'+ string :name, required: :create+ string :description, nullable: true+ boolean :active+ boolean :storefront_visible, description: 'False keeps the method to the dashboard; true also offers it on the storefront.'+ boolean :auto_capture, nullable: true, description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ string :capture_method, nullable: true, enum: Spree::CaptureMethod::CAPTURE_METHODS,+ description: 'When customers are charged for this method. Null inherits the store setting.'+ integer :position+ object :metadata+ object :preferences, description: "Values for the provider's preference schema, from the payment method types endpoint."+ end+# Lists available payment provider subclasses for the create form.# Returns: { data: [{ type, label, description, schema }] }.# `schema` is the JSON Schema of the provider-specific@@ -42,19 +57,14 @@ module SpreeSpree.api.admin_payment_method_serializerend- # Explicit allowlist per the v3 convention — flat params. `type` and- # `preferences` are added by `SubclassedResource` on top.+ # `type` is read by `SubclassedResource` from the raw params.# Deliberately NOT routed through `normalize_params`: `metadata` holds# opaque merchant values, and prefixed-ID resolution recurses into# nested hashes — a value like `we_1MqJ8b...` matches the prefixed-ID# shape and would be decoded to an integer. `preferences` decode their# own ids from their schema.def permitted_params- params.permit(- :name, :description, :active, :storefront_visible, :auto_capture, :capture_method, :position,- *model_additional_permitted_attributes,- metadata: {}, preferences: {}- )+ params.permit(*permitted_attributes)enddef scopediff --git a/spree/api/app/controllers/spree/api/v3/admin/policies_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/policies_controller.rbindex c2f4f08efd..6c20d1f76e 100644--- a/spree/api/app/controllers/spree/api/v3/admin/policies_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/policies_controller.rb@@ -8,6 +8,12 @@ module Spreeclass PoliciesController < ResourceControllerscoped_resource :settings+ request_params :policy do+ string :name, required: :create, example: 'Wholesale Policy'+ string :slug, example: 'wholesale-policy'+ string :body, nullable: true, example: '<p>Trade orders ship within five working days.</p>'+ end+protecteddef model_class@@ -18,10 +24,6 @@ module SpreeSpree.api.admin_policy_serializerend- def resource_permitted_attributes- [:name, :slug, :body]- end-# Accept slug (e.g. returns-policy) or prefixed ID (e.g. pol_abc123),# matching the storefront's lookup.def find_resourcediff --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 000608e570..71c18f1e06 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@@ -26,6 +26,26 @@ module Spree# actions. Wrapping it under a different name keeps both.before_action :load_member_resource, only: [:activate, :deactivate]+ request_params :price_list do+ string :name, required: :create, example: 'EU wholesale'+ string :description, nullable: true+ integer :position, example: 1+ datetime :starts_at, nullable: true, example: '2026-06-01T00:00:00Z',+ description: 'Pair with `ends_at` to schedule the list: activating a list whose start is in the future marks it `scheduled`.'+ datetime :ends_at, nullable: true, example: '2026-09-01T00:00:00Z'+ string :match_policy, enum: Spree::PriceList::MATCH_POLICIES, example: 'all',+ description: '`all`: every rule must match. `any`: one matching rule is enough.'+ decimal :price_adjustment_percentage, nullable: true, example: '-15.0',+ description: 'Signed: negative discounts off base prices, positive marks up.'+ boolean :adjust_compare_at+ object :rules, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_LIST_RULE,+ description: 'The complete rule set: rules are matched by `id` and updated, new ones are built, and rules left out are removed.'+ object :price_adjustment_tiers, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_ADJUSTMENT_TIER,+ description: "Quantity bands on the list's percentage. The payload is the whole ladder: a band left out is removed."+ object :prices, array: true, shape: Spree::Api::V3::RequestShapes::PRICE_LIST_PRICE,+ description: 'Per-variant price overrides. Each row upserts, so the variants it names become part of the list. Curating whole products goes through the nested products endpoint instead.'+ end+# GET /api/v3/admin/price_lists/price_rule_types## Returns `[{ type, label, description, schema }]`@@ -97,20 +117,6 @@ module Spree[:price_adjustment_tiers]end- def permitted_params- normalize_params(- params.permit(- *model_additional_permitted_attributes,- :name, :description, :position,- :starts_at, :ends_at, :match_policy,- :price_adjustment_percentage, :adjust_compare_at,- rules: [:id, :type, { preferences: {} }],- price_adjustment_tiers: [:min_quantity, :percentage],- prices: [:id, :variant_id, :currency, :min_quantity, :amount, :compare_at_amount]- )- )- end-private# Loads the record without the action-derived authorizationdiff --git a/spree/api/app/controllers/spree/api/v3/admin/prices_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/prices_controller.rbindex 00a54b0645..ac7819a74c 100644--- a/spree/api/app/controllers/spree/api/v3/admin/prices_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/prices_controller.rb@@ -13,6 +13,36 @@ module Spreebefore_action :require_ids!, only: [:bulk_destroy]before_action :require_prices!, only: [:bulk_upsert]+ # variant_id and price_list_id resolve through the current store's+ # scopes (+permitted_params+), so a foreign or unknown id 404s.+ request_params :price do+ id :variant_id, required: :create, example: 'variant_xY9'+ string :currency, required: :create, example: 'USD'+ integer :min_quantity,+ description: 'The quantity a line must reach for this price to apply. Omit for the bottom rung of the ladder. Anything above 1 requires a `price_list_id`.'+ decimal :amount, :compare_at_amount, nullable: true, example: '19.99'+ id :price_list_id, nullable: true, example: 'pl_aBc123',+ description: 'Omit or null for a base price; a price list for a list override.'+ end++ request_params 'PriceBulkUpsertParams', action: :bulk_upsert do+ object :prices, array: true, required: true, as: 'PriceBulkUpsertRowParams',+ description: 'Send an empty list to change nothing.' do+ id :id, nullable: true, example: 'price_aBc123',+ description: 'Present: updates that row. Absent: upserts on `(variant_id, currency, price_list_id, min_quantity)`.'+ id :variant_id, required: true, example: 'variant_xY9'+ string :currency, required: true, example: 'USD'+ id :price_list_id, nullable: true, example: 'pl_aBc123', description: 'Omit or null for a base price.'+ integer :min_quantity,+ description: "The rung of the variant's ladder. Omit for the bottom rung; anything above 1 requires a `price_list_id`. A variant carries at most ten rungs on one list per currency."+ decimal :amount, :compare_at_amount, nullable: true, example: '19.99'+ end+ end++ request_params 'PriceBulkDestroyParams', action: :bulk_destroy do+ id :ids, array: true, required: true, example: %w[price_aBc123]+ end+# Bulk-upserts prices on the unique key# `(variant_id, currency, price_list_id, min_quantity)` — one row per# rung of a variant's ladder (docs/plans/6.0-volume-pricing.md).@@ -169,11 +199,8 @@ module Spreefalseend- # Resolves variant_id / price_list_id through the current store's- # scopes so a foreign or unknown id 404s instead of binding the- # price to another store's record.def permitted_params- permitted = params.permit(*model_additional_permitted_attributes, :variant_id, :currency, :min_quantity, :amount, :compare_at_amount, :price_list_id)+ permitted = params.permit(*permitted_attributes)permitted[:variant_id] = store_variants.find_by_prefix_id!(permitted[:variant_id]).id if permitted[:variant_id].present?permitted[:price_list_id] = store_price_lists.find_by_prefix_id!(permitted[:price_list_id]).id if permitted[:price_list_id].present?permitteddiff --git a/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rbindex 96b0d7c8e4..af53823ba7 100644--- a/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb@@ -11,6 +11,23 @@ module Spreeclass ProductTypesController < ResourceControllerscoped_resource :product_types+ # The associations are a template for products created with this type:+ # replace-sets that never change the products already carrying it.+ request_params :product_type do+ string :name, required: :create, example: 'Hoodie'+ id :delivery_profile_id, nullable: true, example: 'fp_86Rf07xd4z',+ description: 'Delivery profile stamped onto products created with this type. Null leaves new products on the store default profile.'+ id :option_type_ids, array: true,+ description: 'Option types seeded onto products that get this type. Use apply to products to backfill existing ones.'+ id :category_ids, array: true, description: 'Categories seeded onto products that get this type. Categories from other stores are ignored.'+ object :custom_field_definitions, array: true, as: 'ProductTypeCustomFieldDefinitionParams',+ description: 'The custom field definitions the product form shows. Definitions not listed are removed from the type.' do+ id :id, required: true, example: 'cfdef_abc123', description: 'The custom field definition.'+ boolean :required+ integer :sort_order+ end+ end+# Backfills this type's option types and categories onto the products# that already carry it. Additive and idempotent — nothing is removed.def apply_to_products@@ -50,14 +67,7 @@ module Spreeenddef permitted_params- attrs = params.permit(- *model_additional_permitted_attributes,- :name,- :delivery_profile_id,- option_type_ids: [],- category_ids: [],- custom_field_definitions: [:id, :required, :sort_order]- )+ attrs = params.permit(*permitted_attributes)attrs = scope_delivery_profile(attrs)scope_category_ids(attrs)enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/products/digital_assets_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/products/digital_assets_controller.rbindex 9ab250de04..db268fcb65 100644--- a/spree/api/app/controllers/spree/api/v3/admin/products/digital_assets_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/products/digital_assets_controller.rb@@ -6,6 +6,23 @@ module Spreeclass DigitalAssetsController < ResourceControllerscoped_resource :products+ request_params :digital_asset do+ # Names a blob rather than a column, so it is attached+ # separately (+attach_uploaded_file+).+ string :signed_id, permit: false,+ description: "A `signed_id` from `files.upload()` with `visibility: 'private'`. Required for an uploaded file, omitted for a provider-backed asset. On update it replaces the file for everyone who already bought it."+ # Resolved through the parent rather than assigned, so an asset+ # can't be pointed at a variant of another product or store.+ id :variant_id, permit: false, description: "Defaults to the product's default variant when omitted."+ # The model validates it names a registered provider.+ string :provider_type, description: 'A provider shorthand from the providers endpoint. Omit for an uploaded file.'+ # Its keys are declared by the provider, so it lands verbatim+ # under one key in the asset's metadata.+ object :provider_settings, description: "Values for the provider's settings schema, keyed by field name."+ integer :authorized_clicks, :authorized_days, nullable: true,+ description: "Null means the store's download settings apply."+ end+# PATCH /api/v3/admin/products/:product_id/digital_assets/:id## Replacing the file keeps every already-issued link working, since@@ -84,17 +101,8 @@ module Spree[:variant, { attachment_attachment: :blob }]end- # variant_id is resolved through the parent rather than assigned:- # mass-assigning it would let a caller point an asset at a variant- # of any product, in any store. signed_id likewise names a blob- # rather than a column, so it is attached separately.- # provider_type is mass-assignable: the model validates it names a- # registered provider, so an unknown value is a 422, not a hazard.- # provider_settings is an open hash — its keys are declared by the- # provider, not fixed here — so it is permitted as arbitrary scalars- # and lands verbatim under one key in the asset's metadata.def permitted_params- params.permit(:authorized_clicks, :authorized_days, :provider_type, provider_settings: {})+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/products/variants_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/products/variants_controller.rbindex 815da47cdb..f87c956d08 100644--- a/spree/api/app/controllers/spree/api/v3/admin/products/variants_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/products/variants_controller.rb@@ -6,6 +6,13 @@ module Spreeclass VariantsController < ResourceControllerscoped_resource :products+ request_params :variant do+ external_references+ include_fields Spree::Api::V3::RequestShapes::VARIANT_ATTRIBUTES+ object :options, array: true, required: :create, shape: Spree::Api::V3::RequestShapes::VARIANT_OPTION,+ description: 'One pair per option type the variant takes part in (size, color). Option types and values are created when missing. On update, omit to leave the option values untouched.'+ end+protecteddef model_class@@ -42,20 +49,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :sku, :barcode,- :cost_price, :cost_currency,- :weight, :height, :width, :depth, :weight_unit, :dimensions_unit,- :hs_code, :country_of_origin, :customs_description,- :minimum_order_quantity, :order_multiple, :purchase_unit, :units_per_carton,- :carton_package_type_id, :carton_weight, :cartons_per_pallet,- :seller_id, :delivery_profile_id,- :track_inventory, :preorderable, :preorder_ships_at, :backorder_limit, :tax_category_id, :position,- options: [:name, :value],- prices: [:amount, :compare_at_amount, :currency],- stock_levels: [:stock_location_id, :count_on_hand, :backorderable]- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rbindex 000e3bbc02..c9bea67280 100644--- a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb@@ -8,6 +8,71 @@ module Spreescoped_resource :products+ # Product is purely a catalog grouping in API v3: every purchasable+ # attribute lives on variants (docs/plans/6.0-remove-master-variant.md).+ request_params :product do+ external_references+ string :name, required: :create, example: 'Premium T-Shirt'+ string :description, description: 'Rich text HTML. Reads come back as this (plain text) plus `description_html`.'+ string :slug+ string :status, enum: Spree::Product::STATUSES+ string :meta_title, :meta_description, :meta_keywords+ id :tax_category_id+ id :product_type_id, nullable: true,+ description: 'The product type this product is created from (`pt_...`). Its option types and categories seed onto the product and its custom field definitions drive the product form. Editing the type later never rewrites existing products.'+ id :delivery_profile_id, nullable: true,+ description: 'The delivery profile deciding how this product ships (`fp_...`); null falls back to the store default.'+ boolean :promotionable+ string :tags, array: true, example: %w[eco sale]+ id :category_ids, array: true+ # Reachable with `write_products` rather than `write_collections`:+ # filing a product into its groupings is part of maintaining it.+ id :collection_ids, array: true,+ description: 'Manual collections this product belongs to. Automatic collections are kept as they are, since their rules decide membership.'+ object :metadata+ object :prices, array: true, shape: Spree::Api::V3::RequestShapes::PRICE,+ 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. Don't pass both."+ object :custom_fields, array: true, shape: Spree::Api::V3::RequestShapes::CUSTOM_FIELD_VALUE,+ description: 'Custom field values, each validated against its definition.'+ # `external_url` is left out on purpose: it makes the server fetch+ # a URL the caller chose, so it belongs to trusted importers.+ object :media, array: true, as: 'ProductMediaParams',+ description: 'Media written with the product. Entries with `id` update an existing asset; entries with `signed_id` attach a fresh upload; an external video needs only its URL.' do+ id :id+ string :signed_id, description: 'A `signed_id` from `files.upload()`.'+ id :source_media_id, description: 'Copies an asset from the media library.'+ string :alt, nullable: true+ integer :position+ string :media_type, enum: Spree::Media::MEDIA_TYPES+ string :external_video_url, nullable: true+ string :poster_signed_id+ number :focal_point_x, :focal_point_y, nullable: true+ id :variant_ids, array: true, description: 'Replaces the variants this media is linked to. An empty list clears them.'+ end+ object :digital_assets, array: true, as: 'ProductDigitalAssetParams',+ description: 'Downloadable files written with the product. Each entry carries a `signed_id` (an upload to private storage) or a `provider_type` (a provider-backed asset), and attaches to the default variant unless `variant_id` is given. An `id` updates that asset in place, so replaying the list does not duplicate it; removal uses the nested digital assets endpoint.' do+ id :id+ string :signed_id+ id :variant_id+ string :provider_type, description: 'A provider shorthand from the digital asset providers endpoint.'+ object :provider_settings, description: "Values for the provider's settings schema, keyed by field name."+ integer :authorized_clicks, :authorized_days, nullable: true,+ description: "Null means the store's download settings apply."+ end+ object :product_publications, array: true, as: 'ProductPublicationParams' do+ id :id+ id :channel_id+ datetime :published_at, :unpublished_at, nullable: true+ end+ object :variants, array: true, as: 'ProductVariantParams',+ description: 'Every purchasable attribute (sku, prices, stock, weight, dimensions) lives on variants. An entry without `options` upserts onto the default variant of a simple product; pass `id` to update an existing variant.' do+ id :id+ include_fields Spree::Api::V3::RequestShapes::VARIANT_ATTRIBUTES+ object :options, array: true, shape: Spree::Api::V3::RequestShapes::VARIANT_OPTION,+ description: 'One pair per option type the variant takes part in (size, color). Option types and values are created when missing.'+ end+ end+before_action :require_ids!, only: [:bulk_status_update,:bulk_add_to_categories,@@ -19,6 +84,37 @@ module Spree:bulk_destroy]+ request_params 'ProductRejectParams', action: :reject do+ string :reason, description: 'Why the submission was turned down. Sent back to the seller.'+ end++ request_params 'ProductBulkStatusParams', action: :bulk_status_update do+ id :ids, array: true, required: true, example: ['prod_UkLWZg9DAJ']+ string :status, required: true, enum: Spree::Product::STATUSES,+ description: 'Products in review are skipped and counted in `skipped_in_review_count`.'+ end++ {+ 'ProductBulkCategoriesParams' => [:category_ids, %i[bulk_add_to_categories bulk_remove_from_categories]],+ 'ProductBulkCollectionsParams' => [:collection_ids, %i[bulk_add_to_collections bulk_remove_from_collections]],+ 'ProductBulkChannelsParams' => [:channel_ids, %i[bulk_add_to_channels bulk_remove_from_channels]]+ }.each do |name, (field, actions)|+ actions.each do |action|+ request_params(name, action: action) do+ id :ids, array: true, required: true+ id field, array: true, required: true+ end+ end+ end++ %i[bulk_add_tags bulk_remove_tags].each do |action|+ request_params('BulkTagsParams', action: action) { include_fields Spree::Api::V3::RequestShapes::BULK_TAGS }+ end++ request_params 'ProductBulkDestroyParams', action: :bulk_destroy do+ id :ids, array: true, required: true, description: 'Products the caller cannot delete are skipped.'+ end+# POST /api/v3/admin/products/:id/clonedef clone@resource = find_resource@@ -209,76 +305,7 @@ module Spreeenddef permitted_params- # Product is purely a catalog grouping in API v3. All purchasable- # attributes (sku, barcode, price, weight, dimensions, stock,- # track_inventory) live on variants. See- # docs/plans/6.0-remove-master-variant.md.- #- # Top-level `prices` is a convenience for simple (no-options)- # products: the merchant doesn't need to know about the default- # variant, so they ship prices alongside name/status and the- # `Spree::Product#prices=` setter forwards them to it.- params.permit(- *model_additional_permitted_attributes,- :name, :description, :slug, :status,- :meta_title, :meta_description, :meta_keywords,- :tax_category_id, :product_type_id, :delivery_profile_id,- :promotionable,- tags: [],- category_ids: [],- # Manual collection membership only — the model setter ignores- # incoming automatic collections and preserves the product's- # existing ones, since those are materialized from their rules.- #- # Deliberately reachable with `write_products` rather than- # `write_collections`: filing a product into its groupings is part- # of maintaining the product, which is why `category_ids` and the- # bulk membership endpoints have always worked this way too.- # Creating or configuring a collection still needs- # `write_collections`.- collection_ids: [],- metadata: {},- prices: [:amount, :compare_at_amount, :currency],- # Inline custom field values keyed by definition id. The model- # setter (`Spree::HasCustomFields#custom_fields=`) validates each- # entry against its definition. We permit `value` as a scalar AND- # as `value: []` / `value: {}` so JSON custom_fields round-trip- # whether the parsed payload is an array or an object, while- # text/number/boolean ship scalars.- custom_fields: [:id, :custom_field_definition_id, :value, { value: [] }, { value: {} }],- # Inline media. Entries with `id` patch an existing asset.- # Entries with `signed_id` create + attach a fresh upload; an- # external video creates with a URL and no file. Lets the- # dashboard ship media changes alongside the rest of the product- # form. See `Spree::Products::NestedAttributes`.- #- # `external_url` is deliberately not permitted here: it makes the- # server fetch a URL the caller chose, so it belongs to trusted- # importers rather than to a request body.- media: [*Spree::Media::WRITABLE_ATTRIBUTES, :id, :signed_id, :source_media_id, { variant_ids: [] }],- # Inline digital files, so a new product ships its downloadable- # files in the same request. Additive: an entry carries a- # `signed_id` (uploaded file) or a `provider_type` (provider-backed- # asset), and an `id` patches that asset in place rather than- # building a duplicate — so replaying a product's list on update- # does not accumulate copies. Removal uses the nested- # digital_assets endpoint. See `Spree::Product#digital_assets=`.- digital_assets: [:id, :signed_id, :variant_id, :provider_type, :authorized_clicks, :authorized_days, provider_settings: {}],- product_publications: [:id, :channel_id, :published_at, :unpublished_at],- variants: [- :id, :sku, :barcode,- :cost_price, :cost_currency,- :weight, :height, :width, :depth, :weight_unit, :dimensions_unit,- :hs_code, :country_of_origin, :customs_description,- :minimum_order_quantity, :order_multiple, :purchase_unit, :units_per_carton,- :carton_package_type_id, :carton_weight, :cartons_per_pallet,- :seller_id, :delivery_profile_id,- :track_inventory, :preorderable, :preorder_ships_at, :backorder_limit, :tax_category_id, :position,- options: [:name, :value],- prices: [:amount, :compare_at_amount, :currency],- stock_levels: [:id, :stock_location_id, :count_on_hand, :backorderable]- ]- ).tap { |attrs| attrs.delete(:status) if review_status?(attrs[:status]) }+ params.permit(*permitted_attributes).tap { |attrs| attrs.delete(:status) if review_status?(attrs[:status]) }end# A review status is an outcome, not a value to assign: `proposed`diff --git a/spree/api/app/controllers/spree/api/v3/admin/promotion_actions_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/promotion_actions_controller.rbindex 11b0370136..b8dcb177c6 100644--- a/spree/api/app/controllers/spree/api/v3/admin/promotion_actions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/promotion_actions_controller.rb@@ -13,6 +13,12 @@ module Spreesubclassed_via -> { Spree.promotions.actions },unknown_type_error: 'unknown_promotion_action_type'+ request_params :promotion_action do+ string :type, required: :create, only: :create, example: 'free_shipping',+ description: 'The action kind, from `GET /promotion_actions/types`.'+ include_fields Spree::Api::V3::RequestShapes::PROMOTION_ACTION_FIELDS+ end+def typesauthorize! :read, model_class@@ -56,7 +62,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, preferences: {})+ params.permit(*permitted_attributes)end# `types`/`calculators` are read-only discovery — read scope + :show ability.diff --git a/spree/api/app/controllers/spree/api/v3/admin/promotion_rules_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/promotion_rules_controller.rbindex dab7b4fd35..3430604e5c 100644--- a/spree/api/app/controllers/spree/api/v3/admin/promotion_rules_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/promotion_rules_controller.rb@@ -13,6 +13,12 @@ module Spreesubclassed_via -> { Spree.promotions.rules },unknown_type_error: 'unknown_promotion_rule_type'+ request_params :promotion_rule do+ string :type, required: :create, only: :create, example: 'currency',+ description: 'The rule kind, from `GET /promotion_rules/types`.'+ include_fields Spree::Api::V3::RequestShapes::PROMOTION_RULE_FIELDS+ end+def typesauthorize! :read, model_class@@ -30,7 +36,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, preferences: {})+ params.permit(*permitted_attributes)end# `types` is read-only discovery — maps to the read scope + :show ability.diff --git a/spree/api/app/controllers/spree/api/v3/admin/promotions_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/promotions_controller.rbindex 0cb6282d2d..347943e52a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/promotions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/promotions_controller.rb@@ -5,6 +5,39 @@ module Spreeclass PromotionsController < ResourceControllerscoped_resource :promotions+ request_params :promotion do+ string :name, required: :create+ string :description, nullable: true+ string :code, nullable: true,+ description: 'Required for single-code coupon promotions. Ignored when `multi_codes` is true.'+ string :path, nullable: true+ datetime :starts_at, :expires_at, nullable: true+ integer :usage_limit, nullable: true+ string :match_policy, enum: Spree::Promotion::MATCH_POLICIES+ string :kind, enum: Spree::Promotion.kinds.keys,+ description: '`coupon_code` needs a code (or `multi_codes`); `automatic` applies without one.'+ boolean :multi_codes, description: 'Generates `number_of_codes` codes starting with `code_prefix`.'+ integer :number_of_codes, nullable: true+ string :code_prefix, nullable: true+ id :promotion_category_id, nullable: true+ # Rules and actions are permitted below, with the keys each+ # registered kind adds.+ object :rules, array: true, permit: false, as: 'PromotionRuleDraftParams',+ description: 'The rules the promotion should have: entries with `id` update, entries without are created, and rules left out are removed.' do+ id :id+ string :type, required: true, example: 'currency',+ description: 'The rule kind, from `GET /promotion_rules/types`.'+ include_fields Spree::Api::V3::RequestShapes::PROMOTION_RULE_FIELDS+ end+ object :actions, array: true, permit: false, as: 'PromotionActionDraftParams',+ description: 'The actions the promotion should have, matched the same way as `rules`.' do+ id :id+ string :type, required: true, example: 'free_shipping',+ description: 'The action kind, from `GET /promotion_actions/types`.'+ include_fields Spree::Api::V3::RequestShapes::PROMOTION_ACTION_FIELDS+ end+ end+protecteddef model_class@@ -23,21 +56,12 @@ module Spreepromotion_includesend- # A single POST/PATCH /promotions can ship rules and actions- # alongside the basics; `Promotion#rules=` / `actions=` reconcile- # to the desired set. The nested allowlist below is the union of- # every built-in rule/action's expected keys. Plugin-defined- # subclasses can add to it — see `additional_permitted_attributes`- # below.+ # `Promotion#rules=` / `actions=` reconcile to the desired set. The+ # nested allowlists are the union of every registered rule/action+ # kind's keys, so plugin-defined kinds add to them through+ # `additional_permitted_attributes`.def resource_permitted_attributes- [- :name, :description, :code, :path,- :starts_at, :expires_at, :usage_limit, :match_policy,- :kind, :multi_codes, :number_of_codes, :code_prefix,- :promotion_category_id,- rules: rule_attributes,- actions: action_attributes- ]+ [*super, { rules: rule_attributes, actions: action_attributes }]enddef rule_attributesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/purchase_orders_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/purchase_orders_controller.rbindex 1503a513e3..cd52a3b2dd 100644--- a/spree/api/app/controllers/spree/api/v3/admin/purchase_orders_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/purchase_orders_controller.rb@@ -16,6 +16,35 @@ module Spreescoped_resource :purchasing+ # The supplier, the warehouse and the lines are read from the raw+ # params and resolved through the store (see ReceivableActions), so+ # only the document's own fields are permitted.+ request_params :purchase_order do+ id :supplier_id, required: :create, permit: false, example: 'sup_1234567890'+ id :destination_location_id, required: :create, permit: false, example: 'sloc_1234567890'+ string :currency, nullable: true, example: 'USD',+ description: "Defaults to the store's currency; set it for a foreign-currency order."+ date :expected_at, nullable: true, example: '2026-10-01', description: 'The day the supplier promised. `null` clears it.'+ date :cancel_by, nullable: true, description: 'The day after which the goods are no longer wanted. `null` clears it.'+ string :reference, nullable: true, description: "The supplier's own order number. `null` clears it."+ string :notes, nullable: true+ object :items, array: true, permit: false, as: 'PurchaseOrderItemParams',+ description: 'Sending the list replaces whatever the order currently holds.' do+ id :variant_id, required: true, example: 'variant_1234567890'+ integer :quantity_ordered, required: true, example: 100+ decimal :unit_cost, example: '12.50', description: 'What the merchant agreed to pay per unit.'+ end+ object :metadata, nullable: true, only: :update+ end++ request_params 'ReceivableCloseParams', action: :close do+ string :reason, nullable: true, description: 'Why the balance is not coming.'+ end++ request_params 'PurchaseOrderCancelParams', action: :cancel do+ string :reason, example: 'Supplier went under', description: "Appended to the order's notes."+ end+# The base registers this for show/update/destroy; a second# `before_action :set_resource` replaces that registration rather than# adding to it, so those three are listed again here.@@ -121,13 +150,6 @@ module Spree}end- # The supplier and the warehouse are resolved through the store- # instead, since an id the payload names has to be proved to belong- # here.- def resource_permitted_attributes- [:currency, :expected_at, :cancel_by, :reference, :notes, { metadata: {} }]- end-def editable_attributesattributes = permitted_params.to_h.symbolize_keysattributes[:supplier] = supplier_from_params if params.key?(:supplier_id)diff --git a/spree/api/app/controllers/spree/api/v3/admin/refund_reasons_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/refund_reasons_controller.rbindex 5de70654ce..1d85cc4fd5 100644--- a/spree/api/app/controllers/spree/api/v3/admin/refund_reasons_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/refund_reasons_controller.rb@@ -5,6 +5,11 @@ module Spreeclass RefundReasonsController < ResourceControllerscoped_resource :settings+ request_params :reason do+ string :name, required: :create+ boolean :active, description: 'Whether the reason is offered on new records.'+ end+protecteddef model_class@@ -16,7 +21,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :active)+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/reporting/saved_reports_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/reporting/saved_reports_controller.rbindex d300a6b2b7..ccee13c053 100644--- a/spree/api/app/controllers/spree/api/v3/admin/reporting/saved_reports_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/reporting/saved_reports_controller.rb@@ -11,6 +11,13 @@ module Spreeclass SavedReportsController < ResourceControllerscoped_resource :reports+ request_params :saved_report do+ string :name, required: :create+ string :description, nullable: true+ object :query, required: :create,+ description: 'A reporting query, validated against the reporting registry on save.'+ end+protecteddef model_class@@ -31,7 +38,7 @@ module Spree# nested hashes — they would be decoded to integers on save and# never resolve again. Extension attributes are splatted in.def permitted_params- params.permit(:name, :description, *model_additional_permitted_attributes, query: {})+ params.permit(*permitted_attributes)enddef build_resourcediff --git a/spree/api/app/controllers/spree/api/v3/admin/reporting_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/reporting_controller.rbindex fd8ac6063c..e910b5e3cb 100644--- a/spree/api/app/controllers/spree/api/v3/admin/reporting_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/reporting_controller.rb@@ -14,6 +14,35 @@ module SpreeQUERY_KEYS = %w[metrics dimensions filters metric_filters time_range compare sort limit currency].freeze+ request_params 'ReportingQueryParams', action: :query do+ string :metrics, array: true, required: true,+ description: 'Registered metric names, from the reporting schema endpoint.'+ any :dimensions, array: true, description: <<~TEXT.squish+ Up to #{Spree::Reporting::Query::MAX_DIMENSIONS} dimensions to break the metrics down by. Each is a dimension+ name, or `{ name, grain, include_empty }`: `grain` (`hour`, `day`, `week`, `month`) buckets a time+ dimension, and `include_empty` lists members with no matching rows where the schema entry supports it.+ TEXT+ object :filters, array: true, description: 'Narrows the rows by dimension value.' do+ string :dimension, required: true+ string :op, required: true, enum: Spree::Reporting::Query::FILTER_OPS+ any :value, required: true, description: 'One value for `eq`, a list for `in`.'+ end+ object :metric_filters, array: true,+ description: "Filters on an aggregate, such as `units_sold = 0`. Narrows the rows only; the totals stay the period's real figure. The metric must also appear in `metrics`, and cannot be a derived one." do+ string :metric, required: true+ string :op, required: true, enum: Spree::Reporting::Query::METRIC_FILTER_OPS+ number :value, required: true+ end+ object :time_range,+ description: "A named preset (`last_month`, `week_to_date`, any `last_<n>_<days|weeks|months>`), or ISO 8601 dates or times in `since` and `until` (a bare date covers the store's whole day). Defaults to the last 30 days, in the store's time zone." do+ string :preset, :since, :until+ end+ string :compare, enum: Spree::Reporting::Query::COMPARE_MODES+ string :sort, description: 'A metric name; prefix it with `-` to sort descending.'+ integer :limit, description: "At most #{Spree::Reporting::Query::MAX_LIMIT}."+ string :currency+ end+# POST /api/v3/admin/reporting/querydef queryreporting_query = Spree::Reporting::Query.new(store: current_store, params: query_params)diff --git a/spree/api/app/controllers/spree/api/v3/admin/return_reasons_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/return_reasons_controller.rbindex c66dccdb05..a29ffd8086 100644--- a/spree/api/app/controllers/spree/api/v3/admin/return_reasons_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/return_reasons_controller.rb@@ -5,6 +5,11 @@ module Spreeclass ReturnReasonsController < ResourceControllerscoped_resource :settings+ request_params :reason do+ string :name, required: :create+ boolean :active, description: 'Whether the reason is offered on new records.'+ end+protecteddef model_class@@ -16,7 +21,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :active)+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/roles_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/roles_controller.rbindex e39c622539..13e219032b 100644--- a/spree/api/app/controllers/spree/api/v3/admin/roles_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/roles_controller.rb@@ -13,6 +13,15 @@ module Spreescoped_resource :staff+ request_params :role do+ string :name, required: :create, example: 'order_manager',+ description: 'Unique role name, the machine identifier shown capitalized in the dashboard.'+ string :description, nullable: true, example: 'Handles daily orders'+ # A caller may only grant permissions they hold themselves.+ string :permissions, array: true, example: %w[write_orders read_customers],+ description: 'Permission keys (`read_orders`, `write_products`, ...) from the permissions endpoint. You can only grant keys you hold yourself.'+ end+# POST /api/v3/admin/roles# A caller may only grant permissions they effectively hold — the# same anti-amplification rule as role grants and API-key minting.@@ -58,7 +67,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :description, permissions: [])+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/seller_payouts_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/seller_payouts_controller.rbindex f5b5e003ac..08061b5377 100644--- a/spree/api/app/controllers/spree/api/v3/admin/seller_payouts_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/seller_payouts_controller.rb@@ -12,6 +12,10 @@ module Spreeclass SellerPayoutsController < ResourceControllerscoped_resource :payouts+ request_params 'SellerPayoutCompleteParams', action: :complete do+ string :reference, example: 'TRF-8842', description: "The provider's own id for the settlement, when one made it."+ end+# PATCH /api/v3/admin/seller_payouts/:id/complete## What the built-in provider waits for: the operator saying the bankdiff --git a/spree/api/app/controllers/spree/api/v3/admin/seller_requirement_submissions_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/seller_requirement_submissions_controller.rbindex 04f26f33f7..fcb2347f6c 100644--- a/spree/api/app/controllers/spree/api/v3/admin/seller_requirement_submissions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/seller_requirement_submissions_controller.rb@@ -12,6 +12,18 @@ module Spreeclass SellerRequirementSubmissionsController < ResourceControllerscoped_resource :sellers+ request_params 'SellerRequirementWaiveParams', action: :create do+ id :requirement_id, required: true, example: 'selreq_UkLWZg9DAJ',+ description: 'The requirement the seller is excused from.'+ string :review_note, description: 'Why the seller is excused. Kept with the decision.'+ end++ %i[accept reject].each do |action|+ request_params('SellerRequirementReviewParams', action: action) do+ string :review_note, description: 'Kept with the decision. On a rejection it is the reason sent back to the seller.'+ end+ end+before_action :set_resource, only: [:show, :accept, :reject, :download]# POST /api/v3/admin/sellers/:seller_id/requirement_submissionsdiff --git a/spree/api/app/controllers/spree/api/v3/admin/seller_requirements_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/seller_requirements_controller.rbindex 1d63fe7937..2191487f60 100644--- a/spree/api/app/controllers/spree/api/v3/admin/seller_requirements_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/seller_requirements_controller.rb@@ -16,6 +16,26 @@ module Spreesubclassed_via -> { Spree.seller_requirements },unknown_type_error: 'unknown_seller_requirement_type'+ # `type` is stripped before assignment by the subclassed-resource+ # flow, so a saved row's kind can never change — which matters+ # because its submissions answered the old one.+ request_params :seller_requirement do+ string :type, required: true, only: :create, example: 'document',+ description: 'The kind, from the seller requirement types endpoint.'+ string :name, example: 'Business registration',+ 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.'+ string :description, example: 'A copy of your certificate of incorporation.', description: 'Instructions shown to the seller.'+ integer :position, example: 1, description: 'Place in the checklist.'+ boolean :active, example: true+ boolean :required, example: true, description: 'Whether this blocks approval. Off means recommended.'+ object :preferences, example: { accepted_content_types: ['application/pdf'] },+ description: "Configuration for this kind, per its type's `schema`."+ object :metadata+ # Permitted per kind, from the kind's own `additional_permitted_attributes`.+ id :custom_field_definition_ids, array: true, permit: false,+ description: 'Custom field definitions this requirement asks the seller to fill in (`required_custom_fields` kind).'+ end+# GET /api/v3/admin/seller_requirements/types## The kinds an operator can add, with the shape of each one's@@ -70,12 +90,8 @@ module Spreesuper.orderedend- # `type` is stripped before assignment by the subclassed-resource- # flow, so a saved row's kind can never change — which matters- # because its submissions answered the old one.def permitted_params- params.permit(:type, :name, :description, :position, :active, :required,- preferences: {}, metadata: {})+ params.permit(*declared_permitted_attributes)end# `types` is read-only discovery — maps to the read scope.diff --git a/spree/api/app/controllers/spree/api/v3/admin/sellers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/sellers_controller.rbindex 74d8283090..ad12a1986a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/sellers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/sellers_controller.rb@@ -19,6 +19,76 @@ module Spreebefore_action :set_resource, only: [:show, :update, :destroy, :invite, :approve, :suspend, :reject,:onboarding, :reopen_onboarding]+ # Enumerated rather than borrowing the legacy global list, which+ # permits :id, :user_id and :deleted_at — the first of which would+ # reintroduce the address-by-id hole below.+ # The seller's own profile fields, plus the settlement and tax+ # configuration only the operator sets. `status` is absent by+ # design — see the class comment.+ #+ # Addresses are written as nested attributes, never as ids: an+ # address has no store of its own, so accepting `billing_address_id`+ # would bind an arbitrary row and the serializer would render it+ # back in full — an enumeration oracle over every customer address+ # on the installation.+ request_params :seller do+ external_references+ string :name, required: :create, example: 'Northwind Books'+ string :slug, example: 'northwind-books', description: 'URL-safe slug, derived from the name when omitted.'+ string :contact_email, nullable: true, example: '[email protected]'+ string :billing_email, nullable: true, example: '[email protected]'+ string :about, nullable: true, example: '<p>Independent bookshop.</p>', description: "Sanitized HTML: the seller's public description."+ string :logo_signed_id, nullable: true,+ description: 'A `signed_id` from the files upload endpoint to set the image, `null` to remove it, or omit the key to leave it untouched. The same applies to `square_logo_signed_id` and `cover_photo_signed_id`.'+ string :square_logo_signed_id, :cover_photo_signed_id, nullable: true+ string :tax_remittance, enum: Spree::Seller::TAX_REMITTANCES, example: 'seller'+ string :payouts_schedule_interval, nullable: true, enum: Spree::Seller::PAYOUT_INTERVALS+ decimal :minimum_payout_amount, nullable: true, example: '25.0'+ datetime :holiday_mode_until, nullable: true, description: 'Set while the seller is away: the catalog stays but stops selling.'+ string :legal_name, :registration_number, nullable: true+ object :metadata+ object :billing_address, as: 'SellerAddressParams',+ description: "The seller's own billing 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." do+ string :first_name, example: 'Ada'+ string :last_name, example: 'Lovelace'+ string :company, example: 'Sparks Audio Ltd'+ string :address1, example: '1 Seller Way'+ string :address2, example: 'Unit 4'+ string :city, example: 'London'+ string :postal_code, example: 'EC1A 1BB'+ string :zipcode+ string :phone, example: '+44 20 7946 0000'+ string :country_code, example: 'GB'+ string :state_code, :state_name+ string :label, example: 'Head office'+ end+ object :custom_fields, array: true, shape: Spree::Api::V3::RequestShapes::CUSTOM_FIELD_VALUE,+ description: 'Custom field values, each validated against its definition.'+ end++ request_params 'SellerInviteParams', action: :invite do+ string :email, required: true, example: '[email protected]'+ id :role_id, nullable: true, example: 'role_UkLWZg9DAJ',+ description: "A role this seller owns; defaults to the seller's own admin role."+ end++ request_params 'SellerApproveParams', action: :approve do+ boolean :override_requirements,+ description: 'Admits a seller whose onboarding checklist is unfinished: the operator\'s deliberate exception, which the `seller.approved` event records along with what was outstanding.'+ end++ request_params 'SellerReopenOnboardingParams', action: :reopen_onboarding do+ string :note, description: 'What the seller has to fix.'+ end++ request_params 'SellerSuspendParams', action: :suspend do+ string :reason, example: 'Counterfeit goods'+ end++ request_params 'SellerRejectParams', action: :reject do+ string :reason, example: 'Incomplete paperwork'+ end+# POST /api/v3/admin/sellers/:id/invite## Opens the seller's team to someone. They become a member when they@@ -125,29 +195,8 @@ module Spree{ store: :seller_requirements, logo_attachment: :blob, cover_photo_attachment: :blob }]end- # Enumerated rather than borrowing the legacy global list, which- # permits :id, :user_id and :deleted_at — the first of which would- # reintroduce the address-by-id hole below.- # The seller's own profile fields, plus the settlement and tax- # configuration only the operator sets. `status` is absent by- # design — see the class comment.- #- # Addresses are written as nested attributes, never as ids: an- # address has no store of its own, so accepting `billing_address_id`- # would bind an arbitrary row and the serializer would render it- # back in full — an enumeration oracle over every customer address- # on the installation.def permitted_params- normalize_params(- params.permit(:name, :slug, :contact_email, :billing_email, :about,- :logo_signed_id, :square_logo_signed_id, :cover_photo_signed_id,- :tax_remittance, :payouts_schedule_interval, :minimum_payout_amount,- :holiday_mode_until,- :legal_name, :registration_number,- metadata: {},- billing_address: Spree::Api::V3::AddressParams::ADDRESS_KEYS,- custom_fields: [:id, :custom_field_definition_id, :value, { value: [] }, { value: {} }])- )+ normalize_params(params.permit(*declared_permitted_attributes))end# Creating a seller provisions their stock location too, so it goesdiff --git a/spree/api/app/controllers/spree/api/v3/admin/setup_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/setup_controller.rbindex 84ccb2864b..ef53039839 100644--- a/spree/api/app/controllers/spree/api/v3/admin/setup_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/setup_controller.rb@@ -14,6 +14,23 @@ module Spreeskip_scope_check!skip_before_action :authenticate_admin!, only: [:show, :countries, :create]+ request_params 'SetupParams', action: :create do+ string :setup_token, required: true, permit: false, description: 'The one-time token from the install output.'+ string :email, required: true, format: :email, example: '[email protected]'+ string :password, required: true+ string :password_confirmation+ string :first_name, example: 'Olivia'+ string :last_name, example: 'Owner'+ string :store_name, permit: false, example: 'My Store'+ string :country_code, required: true, permit: false, example: 'US',+ description: 'ISO 3166-1 alpha-2 country the store sells from. It determines the default market, the warehouse, the delivery zones and the currency.'+ string :locale, permit: false, example: 'en', description: "Storefront locale. Defaults to the country's own language."+ string :currency, permit: false, example: 'USD',+ description: "ISO 4217 currency. Defaults to the country's own currency: pass one only when the store prices in something else."+ boolean :sample_data, permit: false,+ description: 'Load the demo catalog, customers and orders in the background once the admin account exists. The load takes minutes, so the response does not wait for it.'+ end+# Only create checks the setup token, so only create needs the strict# login budget against guessing. The status and countries reads stay# on the general per-caller limit: sharing the login budget with them@@ -43,9 +60,6 @@ module Spreeend# POST /api/v3/admin/auth/setup- # Body: { setup_token, email, password, password_confirmation?,- # first_name?, last_name?, store_name, country_code,- # locale?, currency?, sample_data? }# Currency defaults to the country's own; an unknown code is refused# rather than ignored, since the token is spent in the same request.def create@@ -172,7 +186,7 @@ module Spreeenddef admin_user_params- params.permit(:email, :password, :password_confirmation, :first_name, :last_name)+ params.permit(*declared_permitted_attributes)end# The seed already created the default store (every downstream seeddiff --git a/spree/api/app/controllers/spree/api/v3/admin/stock_levels_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/stock_levels_controller.rbindex d9e28a634e..ceb8e9250c 100644--- a/spree/api/app/controllers/spree/api/v3/admin/stock_levels_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/stock_levels_controller.rb@@ -10,6 +10,34 @@ module Spreebefore_action :require_stock_levels!, only: [:bulk_upsert]+ # Stock levels are auto-created against a (variant, stock_location)+ # pair and never re-pointed, so update only touches the count and+ # backorder flag, not the variant or location.+ request_params :stock_level do+ external_references+ integer :count_on_hand,+ description: 'The count the shelf should end at: a whole number of zero or more. The API records the difference as an `adjusted` movement, so the correction appears in the stock history.'+ integer :adjustment,+ description: 'A signed change to the shelf instead of a target count, applied to the count the API holds at that moment and recorded the same way. Cannot be sent together with `count_on_hand`.'+ boolean :backorderable, description: 'Whether this location sells the variant beyond what it holds.'+ # Optional so an audit requirement never turns an existing+ # endpoint into a 422.+ string :reason, description: 'Labels the correction in the stock history. Defaults to "Manual adjustment".'+ object :metadata+ end++ request_params 'StockLevelBulkUpsertParams', action: :bulk_upsert do+ object :stock_levels, array: true, required: true, as: 'StockLevelBulkUpsertRowParams',+ description: 'Send an empty list to change nothing.' do+ id :variant_id, required: true, example: 'variant_xY9'+ id :stock_location_id, required: true, example: 'sloc_aBc'+ integer :count_on_hand, nullable: true, example: 42, description: 'The absolute level the external system reports.'+ integer :adjustment, nullable: true, example: -3,+ description: 'A relative change, for feeds that report movements rather than levels. Each row needs `count_on_hand` or `adjustment`.'+ boolean :backorderable, nullable: true+ end+ end+def bulk_upsertauthorize! :update, Spree::StockLevel@@ -101,16 +129,8 @@ module Spreecollection.order(Spree::StockLevel.arel_table[:id].asc)end- # Stock levels are auto-created against a (variant, stock_location)- # pair and never re-pointed, so update only touches the count and- # backorder flag — not the variant or location FKs.- #- # `reason` labels the correction in the stock history. It stays- # optional so an audit requirement never turns an existing endpoint- # into a 422; omitting it falls back to a translated default.def permitted_params- params.permit(*model_additional_permitted_attributes, :count_on_hand, :adjustment, :backorderable, :reason,- metadata: {})+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/stock_locations_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/stock_locations_controller.rbindex c44d566465..0836214a4d 100644--- a/spree/api/app/controllers/spree/api/v3/admin/stock_locations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/stock_locations_controller.rb@@ -5,6 +5,28 @@ module Spreeclass StockLocationsController < ResourceControllerscoped_resource :stock+ request_params :stock_location do+ external_references+ string :name, required: :create, example: 'Brooklyn warehouse'+ string :admin_name, nullable: true, description: 'Internal name shown only in the admin.'+ boolean :active+ boolean :default, description: 'Setting to true demotes the previous default.'+ string :kind, example: 'warehouse',+ description: "Categorizes the location. Built-in values: #{Spree::StockLocation::KINDS.map { |kind| "`#{kind}`" }.join(', ')}; extensions may add their own."+ boolean :propagate_all_variants, :backorderable_default+ string :address1, :address2, :city, :zipcode, :phone, :company, nullable: true+ string :country_code, nullable: true, example: 'US', description: 'ISO-3166 alpha-2 country code.'+ string :state_code, nullable: true, example: 'NY',+ description: "State or province abbreviation, resolved against the selected country's states."+ string :state_name, nullable: true, description: "Free-text state for countries that don't have a states list."+ boolean :pickup_enabled+ string :pickup_stock_policy, enum: Spree::StockLocation::PICKUP_STOCK_POLICIES,+ description: '`local` collects only items at this location; `any` lets items transfer in from other locations (ship-to-store).'+ integer :pickup_ready_in_minutes, nullable: true+ boolean :returns_enabled, description: 'Whether customers may send returns to this location.'+ string :pickup_instructions, nullable: true+ end+protecteddef model_class@@ -26,15 +48,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :name, :admin_name, :active, :default,- :kind, :propagate_all_variants, :backorderable_default,- :address1, :address2, :city, :zipcode, :phone, :company,- :country_code, :state_code, :state_name,- :pickup_enabled, :pickup_stock_policy, :returns_enabled,- :pickup_ready_in_minutes, :pickup_instructions- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/stock_transfers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/stock_transfers_controller.rbindex 03828556ca..2401a2aa46 100644--- a/spree/api/app/controllers/spree/api/v3/admin/stock_transfers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/stock_transfers_controller.rb@@ -18,6 +18,35 @@ module Spreescoped_resource :stock+ # The warehouses and lines are read from the raw params and resolved+ # through the store (see ReceivableActions), so only the document's+ # own fields are permitted.+ request_params :stock_transfer do+ id :source_location_id, :destination_location_id, required: :create, permit: false, example: 'sloc_1234567890'+ string :reference, nullable: true, description: "The merchant's own label for the trip. `null` clears it."+ string :notes, nullable: true+ object :items, array: true, permit: false, as: 'StockTransferItemParams',+ description: 'A draft may open empty and gain lines as the merchant packs. Sending the list replaces whatever the draft currently holds.' do+ id :variant_id, required: true, example: 'variant_1234567890'+ integer :quantity_shipped, required: true, example: 10+ end+ object :metadata, nullable: true, only: :update+ end++ request_params 'StockTransferMarkInTransitParams', action: :mark_in_transit do+ boolean :force, description: 'Ship even if it drives the source below zero.'+ end++ request_params 'ReceivableCloseParams', action: :close do+ string :reason, nullable: true, description: 'Why the balance is not coming.'+ end++ request_params 'StockTransferCancelParams', action: :cancel do+ string :on_in_transit, enum: %w[restock write_off],+ description: 'Required once the units have left the source: either they come back (`restock`) or they are written off as lost (`write_off`).'+ string :reason, nullable: true, description: 'Recorded against the written-off lines.'+ end+# The base registers this for show/update/destroy; a second# `before_action :set_resource` replaces that registration rather than# adding to it, so those three are listed again here.@@ -141,13 +170,6 @@ module Spree}end- # Only what mass assignment may safely carry. The two warehouses are- # resolved through the store instead, since an id the payload names- # has to be proved to belong here.- def resource_permitted_attributes- [:reference, :notes, { metadata: {} }]- end-# A transfer's status transitions are its own actions, so `update`# only ever edits the document — and its two ends are objects the# store handed us, never ids the payload asserted.diff --git a/spree/api/app/controllers/spree/api/v3/admin/store_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/store_controller.rbindex 20d591aa5e..273a4c3741 100644--- a/spree/api/app/controllers/spree/api/v3/admin/store_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/store_controller.rb@@ -8,6 +8,89 @@ module Spreescoped_resource :settingsaccepts_legacy_preference_params Spree::Store+ request_params :store do+ string :name, example: 'My Store'+ string :admin_locale, example: 'en'+ string :timezone, example: 'Europe/Berlin'+ string :weight_unit, enum: Spree::Variant::WEIGHT_UNITS+ string :unit_system, enum: Spree::Store::UNIT_SYSTEMS+ string :storefront_access, enum: Spree::Channel::Gating::STOREFRONT_ACCESS,+ description: "The store-wide default for what anonymous visitors can see. Channels fall back to it when they don't set their own."+ string :storefront_url, nullable: true,+ description: "The storefront's public URL, the base for links in customer emails. Saving it also completes the storefront setup task."+ boolean :guest_checkout, description: 'The store-wide default for guest checkout. Channels fall back to it.'+ boolean :always_include_confirm_step,+ description: 'Always show a confirmation step in checkout, even when no payment method requires one.'+ boolean :company_field_enabled, description: 'Shows a company field on address forms.'+ boolean :address_requires_company, description: 'Makes a company name mandatory on addresses.'+ boolean :address_requires_phone, description: 'Makes a phone number mandatory on customer addresses.'+ string :capture_method, enum: Spree::CaptureMethod::CAPTURE_METHODS,+ description: "The store-wide default for when a customer is charged rather than only authorized. A payment method's own setting wins when set."+ boolean :preferred_auto_capture, :preferred_auto_capture_on_dispatch,+ description: 'Deprecated: use `capture_method`. Removed in 6.1.'+ boolean :track_inventory_levels,+ description: 'Counts on-hand quantities. Off means everything is treated as always available.'+ boolean :stock_reservations_enabled,+ description: "Holds stock for shoppers while they check out, so the same item can't be sold twice."+ integer :low_stock_threshold,+ description: 'On-hand units at or below which a tracked variant counts as low stock on the home screen; 0 turns the warning off.'+ boolean :tax_using_ship_address,+ description: 'Calculates tax from the shipping address. When false, tax is calculated from the billing address.'+ boolean :track_price_history,+ description: 'Records price changes for the EU Omnibus lowest-price-in-30-days display.'+ boolean :show_products_without_price,+ description: "Whether products with no price in the shopper's currency still appear in listings."+ boolean :disable_sku_validation, description: 'Lets more than one variant share the same SKU.'+ string :order_routing_strategy, description: 'The store-wide order routing strategy shorthand. Channels fall back to it.'+ string :pricing_provider, description: 'Where prices come from: a registered provider key, or `internal`.'+ string :inventory_provider, description: 'Where stock levels come from: a registered provider key, or `internal`.'+ string :pricing_provider_failure_policy, enum: Spree::ProviderFailurePolicy::VALUES,+ description: '`strict` refuses to price when the provider cannot answer; `fallback` uses the catalog.'+ string :inventory_provider_failure_policy, enum: Spree::ProviderFailurePolicy::VALUES,+ description: '`fallback` sells on the local stock snapshot when the provider cannot answer; `strict` refuses.'+ string :payout_provider, description: 'Blank means the built-in provider: the marketplace settles by hand.'+ string :default_payouts_schedule_interval, enum: Spree::Seller::PAYOUT_INTERVALS+ decimal :default_minimum_payout_amount, example: '50.00', description: "In the store's currency."+ boolean :auto_approve_sellers, description: 'Admits a seller as soon as they finish onboarding, with no operator review.'+ boolean :auto_approve_seller_products,+ description: 'Puts a seller product on sale the moment it is submitted, with no review.'+ boolean :send_seller_transactional_emails,+ description: 'When false, transactional seller emails (approval, payouts and so on) are not sent.'+ decimal :default_commission_tax_rate, example: '0.23',+ description: 'Tax charged on commission as a fraction (`"0.23"` is 23%), when neither the commission rate nor the tax provider names one.'+ string :document_number_format, example: 'sequential',+ description: 'How document numbers are produced: `sequential` or `random`. Applies to every numbered document.'+ string :order_number_prefix, example: 'R',+ description: 'Leads every order number. Uppercase letters, digits, dashes and # only.'+ string :order_number_suffix, description: 'Ends every order number. Uppercase letters, digits, dashes and # only.'+ integer :order_number_sequence_start,+ description: "The first sequential order number. Only applies before the store's first order."+ boolean :limit_digital_download_count, description: 'Whether a digital download link stops working after a number of clicks.'+ integer :digital_asset_authorized_clicks, description: 'How many clicks a download link allows, unless the file sets its own.'+ boolean :limit_digital_download_days, description: 'Whether a digital download link expires after a number of days.'+ integer :digital_asset_authorized_days, description: 'How many days a download link stays valid, unless the file sets its own.'+ string :mail_from_address, description: 'Sender address of every transactional email.'+ string :customer_support_email, nullable: true,+ description: 'Customer-facing reply-to address shown in the storefront and email footers.'+ string :new_order_notifications_email, nullable: true,+ description: 'Recipient of "new order placed" staff notifications.'+ boolean :send_consumer_transactional_emails,+ description: 'When false, transactional customer emails (order confirmation and so on) are not sent.'+ string :email_accent_color, nullable: true,+ description: 'Customer email buttons and links, as `#RRGGBB`. Blank keeps the outlined buttons emails ship with.'+ string :email_background_color, nullable: true, description: 'Customer email page background, as `#RRGGBB`.'+ string :email_card_color, nullable: true, description: 'Customer email card behind the content, as `#RRGGBB`.'+ string :email_text_color, nullable: true, description: 'Customer email body text, as `#RRGGBB`.'+ string :email_heading_color, nullable: true,+ description: 'Customer email headings and emphasized text, as `#RRGGBB`.'+ string :email_font, nullable: true, example: 'inter',+ description: 'Customer email font: `inter`, `system`, `helvetica`, `georgia`, `roboto`, `lato` or `merriweather`.'+ string :logo_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the store logo, or null to remove it.'+ string :mailer_logo_signed_id, nullable: true,+ description: 'A `signed_id` from `files.upload()` for the logo in transactional emails, or null to remove it.'+ end+# Reading the current store is shell data — the dashboard needs the# name, logo, timezone, currency and locales to render anything at# all, so every signed-in staff member can read it regardless of@@ -74,60 +157,7 @@ module Spreeenddef permitted_params- params.permit(- :name,- :admin_locale,- :timezone,- :weight_unit,- :unit_system,- :storefront_access,- :storefront_url,- :guest_checkout,- :always_include_confirm_step,- :company_field_enabled,- :address_requires_company,- :address_requires_phone,- :capture_method,- # @deprecated Superseded by capture_method; the model maps them- # onto it. Removed in 6.1.- :preferred_auto_capture,- :preferred_auto_capture_on_dispatch,- :track_inventory_levels,- :stock_reservations_enabled,- :low_stock_threshold,- :tax_using_ship_address,- :track_price_history,- :show_products_without_price,- :disable_sku_validation,- :order_routing_strategy,- :pricing_provider,- :inventory_provider,- :pricing_provider_failure_policy,- :inventory_provider_failure_policy,- :payout_provider,- :default_payouts_schedule_interval,- :default_minimum_payout_amount,- :auto_approve_sellers,- :auto_approve_seller_products,- :send_seller_transactional_emails,- :default_commission_tax_rate,- :document_number_format,- :order_number_prefix,- :order_number_suffix,- :order_number_sequence_start,- :mail_from_address,- :customer_support_email,- :new_order_notifications_email,- :send_consumer_transactional_emails,- :email_accent_color,- :email_background_color,- :email_card_color,- :email_text_color,- :email_heading_color,- :email_font,- :logo_signed_id,- :mailer_logo_signed_id- )+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/suppliers_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/suppliers_controller.rbindex eb509625a8..61cc7c0606 100644--- a/spree/api/app/controllers/spree/api/v3/admin/suppliers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/suppliers_controller.rb@@ -8,6 +8,22 @@ module Spreeclass SuppliersController < ResourceControllerscoped_resource :purchasing+ request_params :supplier do+ string :name, required: :create, example: 'Northwind Trading'+ string :contact_name, nullable: true, example: 'Dana Okafor'+ string :email, nullable: true, example: '[email protected]'+ string :phone, nullable: true, example: '555-0100'+ string :notes, nullable: true+ string :address1, nullable: true, example: '1 Warehouse Way'+ string :address2, nullable: true+ string :city, nullable: true, example: 'Brooklyn'+ string :state_name, nullable: true+ string :state_code, nullable: true, example: 'NY'+ string :country_code, nullable: true, example: 'US'+ string :postal_code, nullable: true, example: '11201'+ object :metadata, nullable: true+ end+protecteddef model_class@@ -17,12 +33,6 @@ module Spreedef serializer_classSpree.api.admin_supplier_serializerend-- def resource_permitted_attributes- [:name, :contact_name, :email, :phone, :notes,- :address1, :address2, :city, :state_name, :state_code,- :country_code, :postal_code, { metadata: {} }]- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/tax_categories_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/tax_categories_controller.rbindex 556fac0ff4..fd44ac09aa 100644--- a/spree/api/app/controllers/spree/api/v3/admin/tax_categories_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/tax_categories_controller.rb@@ -5,6 +5,12 @@ module Spreeclass TaxCategoriesController < ResourceControllerscoped_resource :settings+ request_params :tax_category do+ string :name, required: :create+ string :tax_code, :description, nullable: true+ boolean :is_default+ end+protecteddef model_class@@ -14,10 +20,6 @@ module Spreedef serializer_classSpree.api.admin_tax_category_serializerend-- def resource_permitted_attributes- [:name, :tax_code, :description, :is_default]- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/tax_rates_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/tax_rates_controller.rbindex 8fb111c7b3..ee69ead133 100644--- a/spree/api/app/controllers/spree/api/v3/admin/tax_rates_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/tax_rates_controller.rb@@ -7,6 +7,18 @@ module Spreeclass TaxRatesController < ResourceControllerscoped_resource :settings+ request_params 'TaxRateParams' do+ string :name, example: 'VAT', description: 'Customer-facing rate name.'+ decimal :rate, example: '0.19', description: 'The rate as a fraction. Send this or `rate_percent`.'+ decimal :rate_percent, example: '19', description: 'The rate as a percentage.'+ boolean :included_in_price, :show_rate_in_label+ id :tax_category_id+ string :country_code, nullable: true, example: 'DE',+ description: 'ISO country code. A rate naming no country taxes everywhere.'+ string :state_code, nullable: true, example: 'CA', description: 'State abbreviation within that country.'+ object :metadata+ end+protecteddef model_class@@ -22,9 +34,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :rate, :rate_percent, :included_in_price,- :show_rate_in_label, :tax_category_id,- :country_code, :state_code, metadata: {})+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/admin/translations/batches_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/translations/batches_controller.rbindex cc49caf05b..6cbbbde614 100644--- a/spree/api/app/controllers/spree/api/v3/admin/translations/batches_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/translations/batches_controller.rb@@ -13,15 +13,6 @@ module Spree# resource_type + resource_id, so the controller stays free of# per-model branching.#- # POST /api/v3/admin/translations/batch- # Body:- # { "translations": [- # { "resource_type": "option_type", "resource_id": "opt_…",- # "values": { "de": { "label": "Größe" } } },- # { "resource_type": "option_value", "resource_id": "optval_…",- # "values": { "de": { "label": "Klein" } } }- # ] }- ## All entries succeed or none do — a validation failure on any entry# rolls back the whole transaction and returns per-entry detail.# The orchestration (resolve → upsert → rollback) lives in@@ -34,6 +25,17 @@ module Spree# which is stricter than the static check and keeps the audit model.skip_scope_check!+ request_params 'TranslationBatchParams' do+ object :translations, array: true, required: true, as: 'TranslationBatchEntryParams',+ description: 'At least one entry. All entries are saved, or none are.' do+ string :resource_type, required: true, example: 'option_type',+ description: 'Translatable resource type token, e.g. `option_type`.'+ id :resource_id, required: true, example: 'opt_abc123'+ object :values, required: true, example: { de: { label: 'Größe' } },+ description: 'Translated fields keyed by locale code, then by field name.'+ end+ end+# POST /api/v3/admin/translations/batchdef createraw = params[:translations]diff --git a/spree/api/app/controllers/spree/api/v3/admin/webhook_endpoints_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/webhook_endpoints_controller.rbindex 01d70facf6..6b53cd54b5 100644--- a/spree/api/app/controllers/spree/api/v3/admin/webhook_endpoints_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/webhook_endpoints_controller.rb@@ -8,6 +8,20 @@ module Spreeclass WebhookEndpointsController < ResourceControllerscoped_resource :webhooks+ request_params :webhook_endpoint do+ string :name, nullable: true, example: 'Order pipeline', description: 'A label shown in the dashboard list.'+ string :url, required: :create, example: 'https://example.com/webhooks/orders',+ description: 'HTTPS destination URL. It cannot resolve to a private IP address outside development.'+ boolean :active, description: 'Defaults to true on create. Prefer the disable and enable endpoints to pause one.'+ string :subscriptions, array: true, example: %w[order.placed order.canceled],+ description: 'Event names this endpoint receives. An empty list or `["*"]` subscribes to every event; otherwise list exact names (`order.completed`) or patterns (`order.*`).'+ end++ request_params 'WebhookEndpointDisableParams', action: :disable do+ string :reason, example: 'Investigating elevated 5xx rate',+ description: 'Shown next to the disabled indicator. Defaults to "Manually disabled".'+ end+before_action :reject_unauthorized_credential_subscription!, only: [:create, :update]# POST /api/v3/admin/webhook_endpoints/:id/send_test@@ -68,7 +82,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :name, :url, :active, subscriptions: [])+ params.permit(*permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/base_controller.rb b/spree/api/app/controllers/spree/api/v3/base_controller.rbindex 6d09952e92..a02c55d718 100644--- a/spree/api/app/controllers/spree/api/v3/base_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/base_controller.rb@@ -13,6 +13,7 @@ module Spreeinclude Spree::Api::V3::ApiKeyAuthenticationinclude Spree::Api::V3::ErrorHandlerinclude Spree::Api::V3::MoneyParams+ include Spree::Api::V3::RequestParamsinclude Spree::Api::V3::SecurityHeadersinclude Spree::Api::V3::ResourceSerializerinclude Spree::Api::V3::RateLimitHeadersdiff --git a/spree/api/app/controllers/spree/api/v3/resource_controller.rb b/spree/api/app/controllers/spree/api/v3/resource_controller.rbindex 82db210481..640cb1854e 100644--- a/spree/api/app/controllers/spree/api/v3/resource_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/resource_controller.rb@@ -561,9 +561,12 @@ module Spreeresource_permitted_attributes + model_additional_permitted_attributesend- # Override in subclass to declare the resource's writable attributes.+ # The resource's writable attributes: its `request_params`+ # declaration, or an override in the subclass.def resource_permitted_attributes- raise NotImplementedError, 'Subclass must implement resource_permitted_attributes or permitted_params'+ return declared_permitted_attributes if request_params_schema++ raise NotImplementedError, 'Subclass must declare request_params, or implement resource_permitted_attributes or permitted_params'end# Attributes extensions have declared on the model viadiff --git a/spree/api/app/controllers/spree/api/v3/seller/auth_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/auth_controller.rbindex cc105c9e9c..7565577f9d 100644--- a/spree/api/app/controllers/spree/api/v3/seller/auth_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/auth_controller.rb@@ -35,6 +35,12 @@ module Spreeskip_before_action :set_current_seller_context, only: [:create, :refresh, :logout, :providers]skip_before_action :authenticate_seller!, only: [:create, :refresh, :logout, :providers]+ request_params 'LoginParams' do+ string :provider, enum: %w[email], description: 'The authentication method. Defaults to `email`.'+ string :email, required: true, example: '[email protected]'+ string :password, required: true, example: 'password123'+ end+# POST /api/v3/seller/auth/logindef createstrategy = authentication_strategydiff --git a/spree/api/app/controllers/spree/api/v3/seller/delivery_methods_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/delivery_methods_controller.rbindex 4ad234e130..801507cead 100644--- a/spree/api/app/controllers/spree/api/v3/seller/delivery_methods_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/delivery_methods_controller.rb@@ -23,6 +23,33 @@ module Spreescoped_resource :delivery_methods+ # No provider fields: both are fixed for a seller's method, and+ # permitting them would let a write fail validation for a choice the+ # seller was never offered. No markup either — that prices a+ # carrier's quote, and a seller has no carrier.+ request_params 'DeliveryMethodParams' do+ string :name+ string :admin_name, :code, nullable: true+ id :delivery_profile_id, description: "One of the marketplace's delivery profiles."+ id :delivery_zone_id, nullable: true, description: 'Narrows where the method ships; null serves everywhere the profile reaches.'+ boolean :storefront_visible+ string :tracking_url, nullable: true+ integer :estimated_transit_business_days_min, :estimated_transit_business_days_max, nullable: true+ object :calculator, description: "How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per that type's `schema`." do+ string :type, example: 'flat_rate'+ object :preferences, example: { amount: '12.5' }+ end+ # Permitted in `permitted_params`, together with the attributes+ # the seller's rule kinds declare on their own classes.+ object :rules, array: true, permit: false, as: 'DeliveryMethodRuleParams',+ description: 'Replaces the whole set: a rule dropped here is deleted, so re-send surviving rules with their `id`. An empty list clears every condition.' do+ id :id+ string :type, required: true, description: 'A type from `/delivery_methods/rule_types`.'+ boolean :active+ object :preferences+ end+ end+# GET /api/v3/seller/delivery_methods/calculators# The ways a seller can price a method, with the preference schema# each one's form is rendered from.@@ -122,18 +149,10 @@ module Spreeaction_name == 'show' ? super : resource_scope.find_by_prefix_id!(params[:id])end- # No provider fields: both are fixed for a seller's method, and- # permitting them would let a write fail validation for a choice the- # seller was never offered. No markup either — that prices a- # carrier's quote, and a seller has no carrier.def permitted_paramsparams.permit(- *model_additional_permitted_attributes,- :name, :admin_name, :code, :storefront_visible, :tracking_url,- :estimated_transit_business_days_min, :estimated_transit_business_days_max,- :delivery_profile_id, :delivery_zone_id,- calculator: [:type, { preferences: {} }],- rules: [:id, :type, :active, { preferences: {} }, *subclassed_rule_attributes]+ *permitted_attributes,+ rules: [*request_params_schema.fields[:rules].schema.permit_list, *subclassed_rule_attributes])enddiff --git a/spree/api/app/controllers/spree/api/v3/seller/exports_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/exports_controller.rbindex 84081b2abc..bc473eae93 100644--- a/spree/api/app/controllers/spree/api/v3/seller/exports_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/exports_controller.rb@@ -25,6 +25,18 @@ module Spreescoped_resource :exports+ request_params 'SellerExportCreateParams' do+ string :type, required: true, enum: ALLOWED_TYPES, description: 'Which dataset to export.'+ string :record_selection, enum: %w[filtered all],+ description: '`filtered` (default) keeps `search_params`; `all` exports everything this seller owns.'+ # Read from the raw params: an arbitrary Ransack hash with nested+ # groupings, which `permit(k: {})` rejects.+ object :search_params, permit: false,+ description: 'Ransack predicates, the same shape the list endpoints take. Ignored when `record_selection` is `all`.'+ string :results_url,+ description: "Panel URL the export-done email links back to. Honored only when it matches one of the store's allowed origins."+ end+# POST /api/v3/seller/exports## Refused before the record is built when the type is not one a@@ -140,7 +152,7 @@ module Spree# `to_unsafe_h`. `:format` is deliberately dropped: only CSV exists,# and Rails' request format would otherwise overwrite the enum.def permitted_params- attrs = params.permit(*model_additional_permitted_attributes, :type, :record_selection, :results_url)+ attrs = params.permit(*permitted_attributes)raw = params[:search_params]attrs[:search_params] = raw.respond_to?(:to_unsafe_h) ? raw.to_unsafe_h : raw if raw.present?attrsdiff --git a/spree/api/app/controllers/spree/api/v3/seller/files_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/files_controller.rbindex 11cbd385ae..e0aee75aef 100644--- a/spree/api/app/controllers/spree/api/v3/seller/files_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/files_controller.rb@@ -11,6 +11,18 @@ module Spreescoped_resource :seller_profile+ # Documented only: the shared FileUploads concern does the permitting.+ request_params 'FileUploadCreateParams', action: :create do+ string :filename, required: true, permit: false, example: 'registration.pdf'+ string :content_type, required: true, permit: false, example: 'application/pdf'+ integer :byte_size, permit: false, example: 51_234+ string :checksum, permit: false, example: 'rL0Y20zC+Fzt72VPzMSk2A==',+ description: 'Base64-encoded MD5 digest of the file; the storage service checks the bytes against it.'+ string :visibility, permit: false, enum: Spree::FileUpload::VISIBILITIES,+ description: '`public` (the default) for web images, videos and CSV, `private` for any type.'+ string :file, permit: false, format: :binary, description: 'The bytes, for a multipart upload.'+ end+privatedef file_upload_serializerdiff --git a/spree/api/app/controllers/spree/api/v3/seller/imports_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/imports_controller.rbindex 8aeed67139..49cae8a863 100644--- a/spree/api/app/controllers/spree/api/v3/seller/imports_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/imports_controller.rb@@ -36,6 +36,22 @@ module Spreescoped_resource :products+ request_params 'ImportCreateParams' do+ string :type, required: true, enum: %w[products]+ string :attachment_signed_id, required: true,+ description: "The `signed_id` of the uploaded CSV, from `POST /files` with `visibility: 'private'`."+ string :delimiter, description: 'CSV column separator. Defaults to a comma.'+ string :results_url,+ description: "Absolute URL of the panel's imports view; the import-done email links back to it. Honored only when it matches one of the store's allowed origins."+ end++ request_params 'ImportCompleteMappingParams', action: :complete_mapping do+ object :mappings, array: true, permit: false, description: 'Column assignments to apply before processing starts.' do+ string :schema_field, required: true, description: 'Canonical schema field name.'+ string :file_column, required: true, nullable: true, description: 'CSV header to read the field from; `null` unmaps the field.'+ end+ end+# POST /api/v3/seller/imports## `attachment_signed_id` is a signed id from@@ -246,7 +262,7 @@ module Spreeenddef permitted_params- params.permit(*model_additional_permitted_attributes, :type, :attachment_signed_id, :delimiter, :results_url)+ params.permit(*permitted_attributes)end# The registered Import subclass matching `name`, or nil.diff --git a/spree/api/app/controllers/spree/api/v3/seller/invitation_acceptances_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/invitation_acceptances_controller.rbindex 7c1337dd5a..8cd6ff630d 100644--- a/spree/api/app/controllers/spree/api/v3/seller/invitation_acceptances_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/invitation_acceptances_controller.rb@@ -22,6 +22,12 @@ module Spreeonly: [:lookup, :accept],with: -> { render_rate_limited(limit: Spree::Api::Config[:rate_limit_login]) }+ request_params 'InvitationAcceptParams', action: :accept do+ string :password, description: 'Sets the password of a new account, or confirms the password of an existing one.'+ string :password_confirmation+ string :first_name, :last_name, description: 'Used only when the invitation creates a new account.'+ end+# GET /api/v3/seller/auth/invitations/:id/lookup?token=:tokendef lookupreturn unless load_invitation@@ -121,7 +127,7 @@ module Spreeenddef signup_params(invitation)- params.permit(:password, :password_confirmation, :first_name, :last_name).+ params.permit(*declared_permitted_attributes).merge(email: invitation.email)enddiff --git a/spree/api/app/controllers/spree/api/v3/seller/me_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/me_controller.rbindex ab25d32b28..8815c4db3b 100644--- a/spree/api/app/controllers/spree/api/v3/seller/me_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/me_controller.rb@@ -16,6 +16,14 @@ module Spreeskip_before_action :set_current_seller_contextbefore_action :require_current_user!+ request_params 'AccountUpdateParams' do+ string :first_name, example: 'Ada'+ string :last_name, example: 'Lovelace'+ string :selected_locale, example: 'de', description: "The panel's display language, as a code the panel ships."+ string :avatar_signed_id, nullable: true,+ description: 'A `signed_id` from `POST /files` to set the photo, or `null` to remove it. Omit to leave the current one alone.'+ end+def showrender json: me_responseend@@ -40,7 +48,7 @@ module Spreeprivatedef permitted_params- params.permit(:selected_locale, :first_name, :last_name, :avatar_signed_id)+ params.permit(*declared_permitted_attributes)enddef me_responsediff --git a/spree/api/app/controllers/spree/api/v3/seller/onboarding_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/onboarding_controller.rbindex 3a72fe05ae..6063063eba 100644--- a/spree/api/app/controllers/spree/api/v3/seller/onboarding_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/onboarding_controller.rb@@ -12,6 +12,11 @@ module Spreeclass OnboardingController < Seller::BaseControllerscoped_resource :seller_profile+ request_params 'OnboardingPayoutAccountParams', action: :payout_account do+ string :refresh_url, :return_url, required: true, format: :uri,+ description: "Where the provider sends the seller back. Must be on the seller panel's origin; any other address is replaced with the panel's."+ end+# GET /api/v3/seller/onboardingdef showrender json: onboarding_payloaddiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/claims_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/claims_controller.rbindex aa3bf1d7eb..46ac08e9c9 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/claims_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/claims_controller.rb@@ -17,6 +17,35 @@ module Spreebefore_action :set_resource, only: [:show, :approve, :resolve, :deny, :cancel]+ request_params :claim do+ object :items, array: true, required: true do+ id :line_item_id, required: true+ integer :quantity, required: true+ string :description, nullable: true+ boolean :send_replacement+ id :replacement_variant_id, nullable: true, description: "One of this seller's own variants."+ decimal :refund_amount, nullable: true+ end+ id :reason_id, nullable: true+ string :memo, nullable: true+ end++ request_params 'ClaimResolveParams', action: :resolve do+ string :resolution, required: true, enum: %w[refund replacement refund_and_replacement]+ string :refund_method, enum: %w[original_payment store_credit], description: 'Defaults to `store_credit`.'+ decimal :amount, nullable: true+ id :replacement_line_item_ids, array: true,+ description: 'Which claimed lines to replace. Omit to keep the lines the claim was opened with.'+ end++ request_params 'ClaimDenyParams', action: :deny do+ string :reason, description: 'Recorded on the claim for the customer.'+ end++ request_params 'ClaimCancelParams', action: :cancel do+ string :reason, description: 'A note on why the claim was canceled.'+ end+protecteddef serializer_classdiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/deliveries_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/deliveries_controller.rbindex 1eac8af4d0..748592a3c1 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/deliveries_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/deliveries_controller.rb@@ -16,6 +16,15 @@ module Spreeclass DeliveriesController < BaseControllerinclude Spree::Api::V3::Orders::DeliveryActions+ # The permit list itself lives in DeliveryActions, shared with the+ # operator's branch; this declaration documents it.+ request_params :delivery do+ string :tracking_number, required: :create,+ description: 'A carrier tracking number, a freight PRO or container number, or a full tracking link. A corrected number resets the carrier status to `pending`.'+ string :carrier, description: "Free text; detected from the number's format when omitted."+ string :service, :tracking_url+ end+before_action :set_resource, only: [:show, :update, :destroy]protecteddiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/exchanges_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/exchanges_controller.rbindex 1912e1918b..aead72178a 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/exchanges_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/exchanges_controller.rb@@ -17,6 +17,34 @@ module Spreebefore_action :set_resource, only: [:show, :approve, :receive, :fulfill, :cancel]+ request_params :exchange do+ object :items, array: true, required: true do+ id :fulfillment_item_id, required: true+ id :new_variant_id, required: true, description: "One of this seller's own variants."+ integer :quantity, required: true+ end+ id :reason_id, nullable: true+ id :stock_location_id, nullable: true, description: "One of this seller's own stock locations, where the goods are restocked."+ string :memo, nullable: true+ end++ request_params 'ExchangeReceiveParams', action: :receive do+ object :items, array: true,+ description: 'What actually arrived. Omit to receive everything as requested and resellable.' do+ id :exchange_line_item_id, required: true+ integer :quantity, required: true+ boolean :resellable, description: 'Goods that cannot be resold are received but never restocked. Defaults to true.'+ end+ end++ request_params 'ExchangeCancelParams', action: :cancel do+ string :reason, description: 'A note on why the exchange was canceled.'+ end++ request_params 'ExchangeFulfillParams', action: :fulfill do+ string :refund_method, enum: %w[original_payment store_credit], description: 'Defaults to `store_credit`.'+ end+protecteddef serializer_classdiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/fulfillments_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/fulfillments_controller.rbindex 583f177632..c1c2b8ae2a 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/fulfillments_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/fulfillments_controller.rb@@ -23,6 +23,28 @@ module Spreebefore_action :set_resource, only: [:show, :update, :fulfill, :cancel, :split]+ request_params :fulfillment do+ string :tracking, :tracking_carrier, nullable: true+ id :stock_location_id, description: "One of this seller's own stock locations; the rates requote from there."+ id :selected_delivery_rate_id, description: 'One of the rates quoted for this parcel from its current origin.'+ end++ request_params 'FulfillmentFulfillParams', action: :fulfill do+ string :tracking, description: 'Carrier tracking number.'+ string :tracking_carrier, description: 'Carrier name.'+ boolean :notify_customer, description: 'Send the dispatch email (default true).'+ object :items, array: true, description: 'Ship only these lines; the rest split onto a new fulfillment.' do+ id :item_id, required: true, description: 'Prefixed line item ID.'+ integer :quantity, required: true+ end+ end++ request_params 'FulfillmentSplitParams', action: :split do+ id :variant_id, required: true, description: 'The variant being moved out.'+ integer :quantity, required: true+ id :stock_location_id, description: "One of this seller's own stock locations. Defaults to the source fulfillment's location."+ end+protecteddef serializer_class@@ -34,8 +56,7 @@ module Spreeenddef permitted_params- params.permit(:tracking, :tracking_carrier, :stock_location_id,- :selected_delivery_rate_id)+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/labels_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/labels_controller.rbindex 406df63778..4a174297fc 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/labels_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/labels_controller.rb@@ -15,6 +15,19 @@ module Spreeclass LabelsController < BaseControllerinclude Spree::Api::V3::Orders::ShippingLabelActions+ # The permit list itself lives in ShippingLabelActions, shared with+ # the operator's branch; this declaration documents it.+ request_params :shipping_label do+ string :file_signed_id, required: true, description: 'A `signed_id` from `files.upload()`.'+ string :tracking_number, required: true, description: 'The number printed on the label.'+ string :carrier, description: "Free text; a forwarder's name is as valid as a carrier slug. Detected from the number when omitted."+ string :service, description: 'Carrier service the label was bought at.'+ decimal :cost, description: "What the seller paid the carrier. Accounting data only; it never touches the order's shipping charge."+ string :currency, description: 'Currency of the cost.'+ string :file_format, enum: %w[pdf png zpl], description: 'Taken from the file when omitted.'+ string :tracking_url, description: 'Tracking page for the consignment the label mints.'+ end+before_action :set_resource, only: [:show, :download, :destroy]# POST .../labelsdiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/notes_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/notes_controller.rbindex 5f1894a4c9..57823b019a 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/notes_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/notes_controller.rb@@ -17,6 +17,12 @@ module Spree# there is no member record to fetch.skip_before_action :set_resource, raise: false+ request_params 'OrderNotesParams' do+ string :customer_note, nullable: true, description: 'What the buyer asked for.'+ string :internal_note, nullable: true,+ description: "The seller's own working note, as HTML. Sanitized on save; `internal_note_html` reads it back."+ end+# GET /api/v3/seller/orders/:order_id/notesdef showrender json: serialize_resource(@order)@@ -59,7 +65,7 @@ module Spree# model sanitizes — the `_html` reader is its round-trip partner,# never a write.def notes_params- permitted = params.permit(:customer_note, :internal_note)+ permitted = params.permit(*declared_permitted_attributes){}.tap do |attributes|attributes[:customer_note] = permitted[:customer_note] if params.key?(:customer_note)diff --git a/spree/api/app/controllers/spree/api/v3/seller/orders/returns_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders/returns_controller.rbindex fc7cf82e6a..a834bea020 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders/returns_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders/returns_controller.rb@@ -17,6 +17,33 @@ module Spreebefore_action :set_resource, only: [:show, :approve, :receive, :refund, :cancel]+ request_params :return do+ object :items, array: true, required: true do+ id :fulfillment_item_id, required: true+ integer :quantity, required: true+ end+ id :reason_id, nullable: true+ id :stock_location_id, nullable: true, description: "One of this seller's own stock locations, where the goods are restocked."+ string :memo, nullable: true+ end++ request_params 'ReturnReceiveParams', action: :receive do+ object :items, array: true, description: 'What actually arrived. Omit to receive everything as requested and resellable.' do+ id :return_line_item_id, required: true+ integer :quantity, required: true+ boolean :resellable, description: 'Defaults to true.'+ end+ end++ request_params 'ReturnRefundParams', action: :refund do+ decimal :amount, nullable: true+ string :refund_method, enum: %w[original_payment store_credit], description: 'Defaults to `original_payment`.'+ end++ request_params 'ReturnCancelParams', action: :cancel do+ string :reason, description: 'A note on why the return was canceled.'+ end+protecteddef serializer_classdiff --git a/spree/api/app/controllers/spree/api/v3/seller/orders_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/orders_controller.rbindex d305245ad8..f9e1bfb9ac 100644--- a/spree/api/app/controllers/spree/api/v3/seller/orders_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/orders_controller.rb@@ -21,6 +21,26 @@ module Spreescoped_resource :orders+ ADDRESS = Spree::Api::V3::RequestSchema.shape('OrderAddressParams') do+ string :first_name, :last_name, :address1, :city, :postal_code, :zipcode+ string :company, :address2, :phone, :alternative_phone, :state_code, :state_name, :label, nullable: true+ string :country_code, example: 'US'+ end++ request_params 'OrderCancelParams', action: :cancel do+ id :cancel_reason_id, nullable: true, description: 'A reason from the order cancellation reasons endpoint.'+ string :cancel_note, nullable: true, description: 'Free text beside the reason.'+ boolean :refund_payments, description: "Hand back what the buyer paid for this order's goods."+ boolean :notify_customer, description: 'Email the customer about the cancellation.'+ end++ request_params 'OrderAddressCorrectionParams', action: :address do+ object :shipping_address, shape: ADDRESS,+ description: 'Only the lines that change; the rest of the address is carried over.'+ object :billing_address, shape: ADDRESS,+ description: 'Only the lines that change; the rest of the address is carried over.'+ end+before_action :set_resource, only: [:show, :cancel, :address]# PATCH /api/v3/seller/orders/:id/canceldiff --git a/spree/api/app/controllers/spree/api/v3/seller/package_types_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/package_types_controller.rbindex 8d0652374d..5d154d371c 100644--- a/spree/api/app/controllers/spree/api/v3/seller/package_types_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/package_types_controller.rb@@ -18,6 +18,23 @@ module Spreeclass PackageTypesController < Seller::ResourceControllerscoped_resource :package_types+ # The same set the operator's controller permits — a seller measures+ # their own packaging, so every field on the shared form is theirs+ # to set. `seller_id` is deliberately absent: ownership comes from+ # the authenticated seller, never the payload.+ request_params 'PackageTypeParams' do+ string :name+ string :kind, enum: Spree::PackageType::KINDS+ number :length, :width, :height, nullable: true+ string :dimensions_unit, nullable: true, enum: Spree::Variant::DIMENSION_UNITS+ number :weight, nullable: true, description: "The empty package's own weight, added to every quote."+ number :max_weight, nullable: true+ string :weight_unit, nullable: true, enum: Spree::Variant::WEIGHT_UNITS+ boolean :default,+ description: "Makes this the box this seller's parcels are quoted with. One default per seller, so it never displaces the marketplace's."+ object :metadata, nullable: true+ end+protecteddef model_class@@ -84,15 +101,6 @@ module SpreeSpree::PackageType.arel_table[:name].asc)end-- # The same set the operator's controller permits — a seller measures- # their own packaging, so every field on the shared form is theirs- # to set. `seller_id` is deliberately absent: ownership comes from- # the authenticated seller, never the payload.- def resource_permitted_attributes- [:name, :kind, :length, :width, :height, :dimensions_unit,- :weight, :max_weight, :weight_unit, :default, { metadata: {} }]- endendendenddiff --git a/spree/api/app/controllers/spree/api/v3/seller/password_resets_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/password_resets_controller.rbindex 7a1dcde917..b951017899 100644--- a/spree/api/app/controllers/spree/api/v3/seller/password_resets_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/password_resets_controller.rb@@ -25,6 +25,13 @@ module Spreestore: Rails.cache,with: RATE_LIMIT_RESPONSE+ request_params :password_reset do+ string :email, required: true, only: :create, example: '[email protected]'+ string :redirect_url, only: :create, example: 'https://sellers.your-store.com/reset-password',+ description: 'Must match an allowed origin of the store; ignored otherwise.'+ string :password, :password_confirmation, required: true, only: :update, example: 'new-password-123'+ end+# POST /api/v3/seller/auth/password_resetsdef createuser = Spree.admin_user_class.find_by(email: params[:email])diff --git a/spree/api/app/controllers/spree/api/v3/seller/policies_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/policies_controller.rbindex a6eb1b5c8a..51b78db4b4 100644--- a/spree/api/app/controllers/spree/api/v3/seller/policies_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/policies_controller.rb@@ -11,6 +11,14 @@ module Spreeclass PoliciesController < Seller::ResourceControllerscoped_resource :seller_profile+ request_params :policy do+ string :name, required: :create, example: 'Shipping Policy',+ description: 'When the marketplace requires a named policy, use that exact name: the onboarding check matches on it.'+ string :slug, example: 'shipping-policy'+ string :body, nullable: true, example: '<p>Orders leave the workshop within two working days.</p>',+ description: 'HTML, sanitized before it is stored. `body_html` on the response is the rendering of what was stored.'+ end+protecteddef model_class@@ -21,10 +29,6 @@ module SpreeSpree.api.seller_policy_serializerend- def resource_permitted_attributes- [:name, :slug, :body]- end-# Accept slug or prefixed ID, matching the storefront's lookup.def find_resourceif params[:id].to_s.start_with?('pol_')diff --git a/spree/api/app/controllers/spree/api/v3/seller/products_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/products_controller.rbindex e0b887399b..77f980973c 100644--- a/spree/api/app/controllers/spree/api/v3/seller/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/products_controller.rb@@ -41,8 +41,90 @@ module Spree'archived' => -> { Spree.product_archive_workflow }}.freeze+ # The operator's price shape, except `currency` may be left out: the+ # store's currency is assumed (see `default_price_currencies`).+ PRICE = Spree::Api::V3::RequestSchema.new do+ string :currency, example: 'USD',+ description: "Omit to price in the store's currency. A seller has no currency of their own."+ decimal :amount, required: true, example: '24.00',+ description: 'A canonical decimal string (`"1234.56"`: period decimal, no grouping). The API does not parse localized input.'+ decimal :compare_at_amount, nullable: true, example: '30.00'+ end+scoped_resource :products+ request_params 'ProductParams' do+ string :name, example: 'Hand-thrown mug'+ string :description+ string :slug, example: 'hand-thrown-mug'+ string :meta_title, :meta_description, :meta_keywords+ object :metadata+ id :product_type_id, nullable: true,+ description: "The marketplace's product type this product is listed against, from the product types endpoint. Null detaches it. Saving with a type seeds its option types onto the product."+ id :delivery_profile_id,+ description: "Which of the marketplace's delivery profiles the product ships under. A new product sent without one lands on the profile marked default."+ object :prices, array: true, shape: PRICE,+ description: "Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant."+ # `external_url` stays out for the same reason it does on the+ # operator's endpoint: it would make the server fetch a URL the+ # caller chose.+ object :media, array: true, as: 'SellerProductMediaParams',+ description: 'The gallery, as a whole: a file absent from the list is removed. `signed_id` attaches a fresh upload; `id` updates one already there.' do+ id :id+ string :signed_id, description: 'A `signed_id` from `POST /files`.'+ string :alt, nullable: true+ integer :position+ string :media_type, enum: Spree::Media::MEDIA_TYPES+ string :external_video_url, nullable: true+ string :poster_signed_id+ number :focal_point_x, :focal_point_y, nullable: true+ id :variant_ids, array: true, description: 'Replaces the variants this media is linked to. An empty list clears them.'+ end+ # Narrower than the operator's variant set: `seller_id` would let a+ # payload hand a variant to somebody else, and+ # `tax_category_id`/`delivery_profile_id` are marketplace+ # configuration.+ object :variants, array: true, as: 'SellerProductVariantParams',+ description: 'The variants, as a whole: one absent from the list is removed. Pass `id` to update an existing variant.' do+ id :id+ string :sku, :barcode+ decimal :cost_price, nullable: true+ string :cost_currency+ number :weight, :height, :width, :depth, nullable: true+ string :weight_unit, enum: Spree::Variant::WEIGHT_UNITS+ string :dimensions_unit, enum: Spree::Variant::DIMENSION_UNITS+ string :hs_code, :country_of_origin, :customs_description+ integer :minimum_order_quantity, :order_multiple, nullable: true+ string :purchase_unit+ integer :units_per_carton, nullable: true, description: 'How many units fill one carton.'+ id :carton_package_type_id, nullable: true, description: 'The carton this variant is packed into: a package type of kind `carton`.'+ number :carton_weight, nullable: true, description: "What one packed carton weighs, in the variant's weight unit."+ integer :cartons_per_pallet, nullable: true, description: 'How many cartons stack on one pallet.'+ boolean :track_inventory, :preorderable+ datetime :preorder_ships_at, nullable: true,+ description: 'The "ships by" date shown to customers while the variant is a pre-order. Null clears it.'+ integer :backorder_limit, nullable: true,+ description: 'Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is unlimited.'+ integer :position+ object :options, array: true, shape: Spree::Api::V3::RequestShapes::VARIANT_OPTION,+ description: 'One pair per option type the variant takes part in (size, color).'+ object :prices, array: true, shape: PRICE, description: 'Per-currency prices. Upserted by currency.'+ object :stock_levels, array: true, shape: Spree::Api::V3::RequestShapes::STOCK_LEVEL,+ description: "Stock per location, at this seller's own locations only: a location belonging to anyone else is ignored."+ end+ end++ request_params 'ProductBulkSubmitParams', action: :bulk_submit do+ id :ids, array: true, required: true,+ description: 'Only drafts and rejected listings are submitted; the rest are counted in `skipped_count`.'+ end++ request_params 'ProductBulkStatusParams', action: :bulk_status_update do+ id :ids, array: true, required: true, example: ['prod_UkLWZg9DAJ']+ string :status, required: true, enum: SELLER_BULK_STATUS_WORKFLOWS.keys,+ description: 'A listing goes on sale only when the marketplace approves it, so there is no bulk route onto `active`.'+ end+before_action :set_status_resource, only: [:submit, :draft, :archive]before_action :require_ids!, only: [:bulk_submit, :bulk_status_update, :bulk_destroy]@@ -165,34 +247,7 @@ module Spreeenddef permitted_params- attrs = params.permit(- *model_class.additional_seller_permitted_attributes,- :name, :description, :slug,- :meta_title, :meta_description, :meta_keywords,- :product_type_id, :delivery_profile_id,- metadata: {},- prices: [:amount, :compare_at_amount, :currency],- # Inline media, the same shape the operator sends. `external_url`- # stays out for the same reason it does there — it would make the- # server fetch a URL the caller chose.- media: [*Spree::Media::WRITABLE_ATTRIBUTES, :id, :signed_id, { variant_ids: [] }],- # A seller's variants. Narrower than the operator's set:- # `seller_id` would let a payload hand a variant to somebody else,- # and `tax_category_id`/`delivery_profile_id` are marketplace- # configuration.- variants: [- :id, :sku, :barcode,- :cost_price, :cost_currency,- :weight, :height, :width, :depth, :weight_unit, :dimensions_unit,- :hs_code, :country_of_origin, :customs_description,- :minimum_order_quantity, :order_multiple, :purchase_unit, :units_per_carton,- :carton_package_type_id, :carton_weight, :cartons_per_pallet,- :track_inventory, :preorderable, :preorder_ships_at, :backorder_limit, :position,- options: [:name, :value],- prices: [:amount, :compare_at_amount, :currency],- stock_levels: [:id, :stock_location_id, :count_on_hand, :backorderable]- ]- )+ attrs = params.permit(*permitted_attributes)# Assigned only when present: writing a nil `prices` or# `stock_levels` key reaches the association setter as nil, whichdiff --git a/spree/api/app/controllers/spree/api/v3/seller/profile_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/profile_controller.rbindex d190a46de2..e55ed92808 100644--- a/spree/api/app/controllers/spree/api/v3/seller/profile_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/profile_controller.rb@@ -20,6 +20,25 @@ module Spreescoped_resource :seller_profile+ # Enumerated rather than borrowing the legacy global list, which+ # permits :id, :user_id and :deleted_at.+ request_params 'ProfileUpdateParams' do+ string :name, example: 'Acme Supplies'+ string :contact_email, :billing_email, nullable: true, format: :email+ string :about, nullable: true, description: "Sanitized HTML: the seller's public description."+ string :legal_name, nullable: true, description: 'The business a commission invoice is made out to.'+ string :registration_number, nullable: true+ string :logo_signed_id, :square_logo_signed_id, :cover_photo_signed_id, nullable: true,+ description: 'A `signed_id` from `POST /files`; `null` removes the image.'+ object :billing_address, as: 'SellerAddressParams' do+ include_fields Spree::Api::V3::RequestShapes::ADDRESS_FIELDS+ end+ object :custom_fields, array: true, shape: Spree::Api::V3::RequestShapes::CUSTOM_FIELD_VALUE,+ description: "Answers to the custom fields this marketplace's onboarding asks for. A field nothing asked for is ignored rather than written."+ boolean :accept_terms, permit: false,+ description: "Stamps the moment the seller accepted the marketplace's terms. One-way: sending `false` does not unmake the stamp."+ end+def showrender json: serialize_sellerend@@ -54,8 +73,6 @@ module Spree%w[show]end- # Enumerated rather than borrowing the legacy global list, which- # permits :id, :user_id and :deleted_at.# Accepting the marketplace's terms is a profile write, not an endpoint# of its own: `accept_terms: true` stamps the time, which is what the# AcceptTerms requirement reads.@@ -104,14 +121,7 @@ module Spreeenddef permitted_params- normalize_params(- params.permit(:name, :contact_email, :billing_email, :about,- :legal_name, :registration_number,- :logo_signed_id, :square_logo_signed_id, :cover_photo_signed_id,- billing_address: Spree::Api::V3::AddressParams::ADDRESS_KEYS,- custom_fields: [:id, :custom_field_definition_id, :value,- { value: [] }, { value: {} }])- )+ normalize_params(params.permit(*declared_permitted_attributes))endprivatediff --git a/spree/api/app/controllers/spree/api/v3/seller/requirement_submissions_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/requirement_submissions_controller.rbindex c0a627089e..43f151b475 100644--- a/spree/api/app/controllers/spree/api/v3/seller/requirement_submissions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/requirement_submissions_controller.rb@@ -12,6 +12,14 @@ module Spreeclass RequirementSubmissionsController < Seller::BaseControllerscoped_resource :seller_profile+ # `file_signed_id` comes from POST /files, so the bytes are already in+ # storage by the time this runs.+ request_params 'RequirementSubmissionParams' do+ string :note, description: 'Anything the seller wants to say alongside the submission.'+ string :reference, description: 'A reference number or external identifier, for requirements that ask for one.'+ string :file_signed_id, description: 'A `signed_id` from `POST /files`, for requirements that ask for a document.'+ end+before_action :set_requirement, only: [:create]before_action :set_submission, only: [:download]@@ -57,11 +65,8 @@ module Spreeprotected- # What a seller may say about a requirement. `file_signed_id` comes- # from POST /files, so the bytes are already in storage by the time- # this runs.def permitted_params- params.permit(:note, :reference, :file_signed_id)+ params.permit(*declared_permitted_attributes)enddef read_actionsdiff --git a/spree/api/app/controllers/spree/api/v3/seller/resource_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/resource_controller.rbindex 9a86066874..f1facaa86c 100644--- a/spree/api/app/controllers/spree/api/v3/seller/resource_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/resource_controller.rb@@ -66,6 +66,13 @@ module Spreemodel_class.table_name.delete_prefix('spree_').to_symend+ # What extensions opened to sellers, never the operator-level list:+ # an attribute opened to operators must not become seller-writable+ # by accident.+ def model_additional_permitted_attributes+ Array(model_class.try(:additional_seller_permitted_attributes))+ end+def authorize_resource!(resource = @resource, action = action_name.to_sym)authorize!(action, resource)enddiff --git a/spree/api/app/controllers/spree/api/v3/seller/stock_locations_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/stock_locations_controller.rbindex 24b957d18b..88ba496e17 100644--- a/spree/api/app/controllers/spree/api/v3/seller/stock_locations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/stock_locations_controller.rb@@ -24,6 +24,31 @@ module Spree# stock.scoped_resource :stock+ # The same set the operator's controller permits: a seller runs+ # their own warehouse, so every field on the shared form is theirs to+ # set. Anything missing here is dropped by `permit` without a word,+ # and the form would appear to save while quietly discarding it.+ request_params 'StockLocationParams' do+ string :name, example: 'Main warehouse'+ string :admin_name, nullable: true+ boolean :active, description: 'Set `false` to retire a location: there is no delete.'+ boolean :default+ string :kind, example: 'warehouse',+ description: "Categorizes the location. Built-in values: #{Spree::StockLocation::KINDS.map { |kind| "`#{kind}`" }.join(', ')}; extensions may add their own."+ boolean :propagate_all_variants, :backorderable_default+ string :address1, :address2, :city, :zipcode, :phone, :company, nullable: true+ string :country_code, nullable: true, example: 'US', description: 'ISO-3166 alpha-2 country code.'+ string :state_code, nullable: true, example: 'OR',+ description: "State or province abbreviation, resolved against the selected country's states."+ string :state_name, nullable: true, description: "Free-text state for countries that don't have a states list."+ boolean :pickup_enabled+ string :pickup_stock_policy, enum: Spree::StockLocation::PICKUP_STOCK_POLICIES,+ description: '`local` collects only items at this location; `any` lets items transfer in from other locations (ship-to-store).'+ integer :pickup_ready_in_minutes, nullable: true+ boolean :returns_enabled, description: 'Whether customers may send returns to this location.'+ string :pickup_instructions, nullable: true+ end+protecteddef model_class@@ -34,20 +59,8 @@ module SpreeSpree.api.seller_stock_location_serializerend- # The same set the operator's controller permits: a seller runs- # their own warehouse, so every field on the shared form is theirs to- # set. Anything missing here is dropped by `permit` without a word,- # and the form would appear to save while quietly discarding it.def permitted_params- params.permit(- *model_additional_permitted_attributes,- :name, :admin_name, :active, :default,- :kind, :propagate_all_variants, :backorderable_default,- :address1, :address2, :city, :zipcode, :phone, :company,- :country_code, :state_code, :state_name,- :pickup_enabled, :pickup_stock_policy, :returns_enabled,- :pickup_ready_in_minutes, :pickup_instructions- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/seller/tax_identifiers_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/tax_identifiers_controller.rbindex 4c438f4b8e..33497adf1d 100644--- a/spree/api/app/controllers/spree/api/v3/seller/tax_identifiers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/tax_identifiers_controller.rb@@ -24,6 +24,13 @@ module Spree# standard actions have to be listed alongside the custom one.before_action :set_resource, only: [:show, :update, :destroy, :validate]+ request_params 'SellerTaxIdentifierParams' do+ string :kind, example: 'eu_vat',+ description: "#{Spree::Api::V3::RequestShapes::TAX_IDENTIFIER_KIND} One registration per kind."+ string :value, example: 'DE100000008',+ description: 'A number the validator for its kind refuses is rejected rather than stored.'+ end+protecteddef model_class@@ -39,7 +46,7 @@ module Spreeenddef permitted_params- params.permit(:kind, :value)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/seller/team_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/team_controller.rbindex d222ebe3b3..1d1d84555b 100644--- a/spree/api/app/controllers/spree/api/v3/seller/team_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/seller/team_controller.rb@@ -16,6 +16,10 @@ module Spreebefore_action :set_member, only: [:destroy]+ request_params :team_member do+ string :email, required: true, example: '[email protected]'+ end+def indexrender json: { data: members.map { |member| serialize_member(member) } }enddiff --git a/spree/api/app/controllers/spree/api/v3/store/auth_controller.rb b/spree/api/app/controllers/spree/api/v3/store/auth_controller.rbindex ef08531c33..c80bb8aaf7 100644--- a/spree/api/app/controllers/spree/api/v3/store/auth_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/auth_controller.rb@@ -16,6 +16,14 @@ module Spreeskip_before_action :authenticate_user, only: [:create, :refresh, :logout]+ request_params 'RefreshTokenParams', action: :refresh do+ string :refresh_token, required: true, description: 'The refresh token from the login response.'+ end++ request_params 'LogoutParams', action: :logout do+ string :refresh_token, description: 'The refresh token to revoke.'+ end+# POST /api/v3/store/auth/login# Supports multiple authentication providers via :provider param# Example:diff --git a/spree/api/app/controllers/spree/api/v3/store/carts/discount_codes_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/discount_codes_controller.rbindex b6bb052477..5f1758c74b 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/discount_codes_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/discount_codes_controller.rb@@ -9,6 +9,10 @@ module Spreebefore_action :find_cart!+ request_params 'ApplyDiscountCodeParams', action: :create do+ string :code, required: true, example: 'SAVE10', description: 'The promotion code to apply.'+ end+# POST /api/v3/store/carts/:cart_id/discount_codes# Applies a discount code. A real-but-not-yet-eligible code is# accepted and persisted — recalculation activates the discount@@ -69,7 +73,7 @@ module Spreeenddef permitted_params- params.permit(:code)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/carts/fulfillments_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/fulfillments_controller.rbindex d8788c3c1a..ccc4efb431 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/fulfillments_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/fulfillments_controller.rb@@ -9,6 +9,12 @@ module Spreebefore_action :find_cart!+ request_params 'UpdateFulfillmentParams', action: :update do+ id :selected_delivery_rate_id, example: 'dr_abc123', description: 'The delivery rate to select.'+ string :pickup_point_external_id,+ description: "For a pickup point delivery method: the provider's id of the point to collect from."+ end+# PATCH /api/v3/store/carts/:cart_id/fulfillments/:id# Selects a delivery rate, and for pickup_point methods a concrete# pickup point (validated against the provider, then frozen into@@ -35,7 +41,7 @@ module Spreeprivatedef permitted_params- params.permit(:selected_delivery_rate_id, :pickup_point_external_id)+ params.permit(*declared_permitted_attributes)enddef recalculatediff --git a/spree/api/app/controllers/spree/api/v3/store/carts/gift_cards_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/gift_cards_controller.rbindex 96cb75bdd9..cae9c0626e 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/gift_cards_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/gift_cards_controller.rb@@ -9,6 +9,10 @@ module Spreebefore_action :find_cart!+ request_params 'ApplyGiftCardParams', action: :create do+ string :code, required: true, example: 'GC-ABCD-1234', description: 'The gift card code to apply.'+ end+# POST /api/v3/store/carts/:cart_id/gift_cardsdef createwith_order_lock do@@ -64,7 +68,7 @@ module Spreeenddef permitted_params- params.permit(:code)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/carts/items_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/items_controller.rbindex 3811b93ed5..a10ce19db4 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/items_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/items_controller.rb@@ -9,6 +9,20 @@ module Spreebefore_action :find_cart!+ request_params 'AddLineItemParams', action: :create do+ id :variant_id, required: true, example: 'variant_abc123'+ integer :quantity, example: 2, description: 'Defaults to 1.'+ object :metadata, example: { gift_message: 'Happy Birthday!' },+ description: 'Write-only key-value metadata.'+ object :options, description: 'Values for line item attributes an extension adds.'+ end++ request_params 'UpdateLineItemParams', action: :update do+ integer :quantity, example: 5, description: 'At least 1. Remove an item with DELETE.'+ object :metadata, example: { engraving: 'J.D.' },+ description: 'Write-only key-value metadata, merged with what the line item has.'+ end+# POST /api/v3/store/carts/:cart_id/itemsdef createwith_order_lock do@@ -113,11 +127,7 @@ module Spreeenddef permitted_params- params.permit(- :id, :variant_id, :quantity,- *Spree::LineItem.additional_permitted_attributes,- { metadata: {}, options: {} }- )+ params.permit(*declared_permitted_attributes, *Spree::LineItem.additional_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rbindex a2b1f263f5..f95dea083c 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rb@@ -10,6 +10,22 @@ module Spreebefore_action :find_cart!before_action :set_payment_session, only: [:show, :update, :complete]+ request_params 'CreatePaymentSessionParams', action: :create do+ id :payment_method_id, required: true, example: 'pm_abc123'+ decimal :amount, example: '99.99', description: 'Defaults to the order total minus store credits.'+ object :external_data, description: 'Provider-specific data passed to the gateway.'+ end++ request_params 'UpdatePaymentSessionParams', action: :update do+ decimal :amount, example: '50.00'+ object :external_data, description: 'Provider-specific data to update.'+ end++ request_params 'CompletePaymentSessionParams', action: :complete do+ string :session_result, description: 'Provider-specific session result token.'+ object :external_data, description: 'Provider-specific completion data.'+ end+# POST /api/v3/store/carts/:cart_id/payment_sessionsdef createwith_order_lock do@@ -94,15 +110,11 @@ module Spreeenddef permitted_params- params.permit(- :amount, :payment_method_id,- *Spree::PaymentSession.additional_permitted_attributes,- { external_data: {} }- )+ params.permit(*declared_permitted_attributes, *Spree::PaymentSession.additional_permitted_attributes)enddef complete_params- params.permit(:session_result, { external_data: {} })+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/carts/payments_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/payments_controller.rbindex 11388cca84..3f949ccba5 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/payments_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/payments_controller.rb@@ -8,6 +8,13 @@ module Spreebefore_action :find_cart!+ request_params 'CreatePaymentParams', action: :create do+ id :payment_method_id, required: true, example: 'pm_abc123',+ description: 'A payment method that needs no payment session.'+ decimal :amount, example: '99.99', description: 'Defaults to the order total minus store credits.'+ object :metadata, description: 'Key-value metadata to attach to the payment.'+ end+# POST /api/v3/store/carts/:cart_id/payments# Creates a payment for non-session payment methods (e.g. Check, Cash on Delivery, Bank Transfer)def creatediff --git a/spree/api/app/controllers/spree/api/v3/store/carts/po_documents_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/po_documents_controller.rbindex cfa0cf9334..9b5e618700 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/po_documents_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/po_documents_controller.rb@@ -21,6 +21,13 @@ module Spreebefore_action :find_cart!+ request_params 'CreatePoDocumentParams', action: :create do+ string :filename, :content_type, required: true+ integer :byte_size, required: true+ string :checksum, required: true,+ description: 'Base64-encoded MD5 digest of the file; the storage service checks the bytes against it.'+ end+# POST /api/v3/store/carts/:cart_id/po_document## Takes the same flat request as the Admin API's `POST /files` and@@ -43,7 +50,7 @@ module Spreevisibility: 'private',max_byte_size: Spree::Purchase::PurchaseOrder::MAX_PO_DOCUMENT_SIZE,allowed_content_types: Spree::Purchase::PurchaseOrder::PO_DOCUMENT_CONTENT_TYPES,- **params.permit(:filename, :content_type, :byte_size, :checksum).to_h.symbolize_keys+ **params.permit(*declared_permitted_attributes).to_h.symbolize_keys)return render_po_document_invalid unless file_upload.savediff --git a/spree/api/app/controllers/spree/api/v3/store/carts/store_credits_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/store_credits_controller.rbindex b595318657..1a97d1f6f2 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/store_credits_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/store_credits_controller.rb@@ -10,6 +10,10 @@ module Spreebefore_action :require_authentication!before_action :find_cart!+ request_params 'ApplyStoreCreditParams', action: :create do+ decimal :amount, example: '10.00', description: 'Defaults to as much as the cart can use.'+ end+# POST /api/v3/store/carts/:cart_id/store_creditsdef createwith_order_lock dodiff --git a/spree/api/app/controllers/spree/api/v3/store/carts/tax_identifiers_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts/tax_identifiers_controller.rbindex 9b1046a93a..c9ec4af0c5 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts/tax_identifiers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts/tax_identifiers_controller.rb@@ -25,6 +25,10 @@ module Spree# frozen onto the order at completion.before_action :require_kind_and_value!, only: :update+ request_params('TaxIdentifierParams', action: :update) do+ include_fields Spree::Api::V3::RequestShapes::TAX_IDENTIFIER_FIELDS+ end+# GET /api/v3/store/carts/:cart_id/tax_identifier## The registration this cart will be taxed against — the override@@ -73,7 +77,7 @@ module Spreeenddef permitted_params- params.permit(:kind, :value)+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts_controller.rbindex 5868923a7a..3f43c15567 100644--- a/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb@@ -11,6 +11,50 @@ module Spreeskip_before_action :set_resourceprepend_before_action :require_authentication!, only: [:index, :associate]+ CART_ADDRESS = Spree::Api::V3::RequestSchema.shape('CartAddressParams') do+ id :id, description: 'An existing address of the customer to use. The other fields are then ignored.'+ include_fields Spree::Api::V3::RequestShapes::STORE_ADDRESS_FIELDS+ boolean :quick_checkout, description: 'Relaxes validation (name, phone, postal code, street), for express checkouts that share a partial address.'+ end++ # Creating and updating a cart accept the same fields.+ CART_FIELDS = Spree::Api::V3::RequestSchema.new do+ string :email, format: :email, example: '[email protected]'+ string :customer_note, example: 'Leave at door'+ id :market_id+ string :currency, :locale+ id :shipping_address_id, description: 'An existing address to ship to.', example: 'addr_abc123'+ id :billing_address_id, description: 'An existing address to bill.', example: 'addr_def456'+ id :preferred_stock_location_id+ id :company_id, nullable: true, description: <<~TEXT.squish+ The company node this purchase is for. The buyer must have standing over it: a membership+ on that node or one of its ancestors. Null clears it, and with it the company's catalog,+ pricing and tax anchoring.+ TEXT+ string :po_number, nullable: true, description: <<~TEXT.squish+ The buyer's own purchase-order reference. Their accounting reconciles the order, the+ invoice and the payment against it. Blank clears it.+ TEXT+ string :po_document_signed_id, nullable: true, description: <<~TEXT.squish+ The `signed_id` of the buyer's purchase order, from `POST /store/carts/:id/po_document`.+ Blank detaches the document.+ TEXT+ boolean :use_shipping, description: 'When true, copies the shipping address to the billing address.'+ object :shipping_address, shape: CART_ADDRESS, description: 'A new shipping address.'+ object :billing_address, shape: CART_ADDRESS, description: 'A new billing address.'+ object :metadata, description: 'Write-only key-value metadata, merged with what the cart has.'+ object :items, array: true, as: 'LineItemInputParams',+ description: 'Items to upsert: sets the quantity of a variant already in the cart, adds the others.' do+ id :variant_id, required: true, example: 'variant_abc123'+ integer :quantity, example: 2, description: 'Defaults to 1.'+ object :metadata, description: 'Key-value metadata, merged with what the line item has.'+ object :options+ end+ end++ request_params('CreateCartParams', action: :create) { include_fields CART_FIELDS }+ request_params('UpdateCartParams', action: :update) { include_fields CART_FIELDS }+# GET /api/v3/store/carts/:id# Returns cart by prefixed ID# Auto-advances the checkout state machine so that shipments and@@ -182,41 +226,7 @@ module Spreeprivatedef permitted_params- params.permit(- *model_additional_permitted_attributes,- :email,- :customer_note,- :market_id,- :currency,- :locale,- :shipping_address_id,- :billing_address_id,- :preferred_stock_location_id,- :company_id,- # The buyer's own purchase-order reference, and the signed blob id- # of the document behind it (from POST .../carts/:id/po_document).- :po_number,- :po_document_signed_id,- :use_shipping,- shipping_address: address_params,- billing_address: address_params,- metadata: {},- items: item_params- )- end-- def address_params- [- :id, :first_name, :last_name,- :address1, :address2,- :city, :postal_code, :phone, :company,- # country_iso and state_abbr are the legacy write names, accepted until 6.1.- :country_code, :country_iso, :state_code, :state_abbr, :state_name, :quick_checkout- ]- end-- def item_params- [:variant_id, :quantity, { metadata: {}, options: {} }]+ params.permit(*permitted_attributes)end# Find incomplete cart for associate action.diff --git a/spree/api/app/controllers/spree/api/v3/store/companies/addresses_controller.rb b/spree/api/app/controllers/spree/api/v3/store/companies/addresses_controller.rbindex 047da2a298..51011df25a 100644--- a/spree/api/app/controllers/spree/api/v3/store/companies/addresses_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/companies/addresses_controller.rb@@ -9,6 +9,14 @@ module Spreeclass AddressesController < BaseControllerinclude Spree::Api::V3::CompanyAddressWrites+ request_params 'CompanyAddressParams' do+ include_fields Spree::Api::V3::RequestShapes::ADDRESS_FIELDS+ boolean :default_billing, permit: false,+ description: "True makes this the node's default billing address, false gives that up, and leaving it out changes nothing."+ boolean :default_shipping, permit: false,+ description: "True makes this the node's default shipping address, false gives that up, and leaving it out changes nothing."+ end+# POST /api/v3/store/companies/:company_id/addressesdef createresult = Spree.address_create_service.call(@@ -67,7 +75,7 @@ module Spreeenddef permitted_params- params.permit(:label, *Spree::Api::V3::AddressParams::ADDRESS_KEYS)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/companies/members_controller.rb b/spree/api/app/controllers/spree/api/v3/store/companies/members_controller.rbindex f906d5e49c..e6f1841d76 100644--- a/spree/api/app/controllers/spree/api/v3/store/companies/members_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/companies/members_controller.rb@@ -11,6 +11,10 @@ module Spree# email has an account. Any member can invite; restraint is# Enterprise's policy layer.class MembersController < BaseController+ request_params 'AddCompanyMemberParams', action: :create do+ string :customer_email, required: true, example: '[email protected]'+ end+# POST /api/v3/store/companies/:company_id/membersdef createresult = Spree.company_add_member_service.call(diff --git a/spree/api/app/controllers/spree/api/v3/store/companies_controller.rb b/spree/api/app/controllers/spree/api/v3/store/companies_controller.rbindex f2af170197..7fcfcdc705 100644--- a/spree/api/app/controllers/spree/api/v3/store/companies_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/companies_controller.rb@@ -10,6 +10,10 @@ module Spreeclass CompaniesController < ResourceControllerprepend_before_action :require_authentication!+ request_params 'UpdateCompanyParams', action: :update do+ string :name, example: 'Acme Industrial Group'+ end+# PATCH /api/v3/store/companies/:iddef updateauthorize_storefront_write!(@resource)@@ -38,7 +42,7 @@ module Spreeenddef permitted_params- params.permit(:name)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/company_invitations_controller.rb b/spree/api/app/controllers/spree/api/v3/store/company_invitations_controller.rbindex 541e08fa71..4f61c44aca 100644--- a/spree/api/app/controllers/spree/api/v3/store/company_invitations_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/company_invitations_controller.rb@@ -17,6 +17,13 @@ module Spree# standing scope would 404 the unauthenticated invitee.skip_before_action :set_resource+ request_params 'AcceptCompanyInvitationParams', action: :accept do+ string :first_name, example: 'Ada'+ string :last_name, example: 'Lovelace'+ string :phone+ string :password, :password_confirmation, example: 'a-strong-password'+ end+# GET /api/v3/store/company_invitations/:token — what is being# joined. Expired and revoked tokens 404.def show@@ -81,7 +88,7 @@ module Spreeenddef registration_params- params.permit(:first_name, :last_name, :phone, :password, :password_confirmation)+ params.permit(*declared_permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/customer/addresses_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customer/addresses_controller.rbindex 8423e106ef..a61dbce765 100644--- a/spree/api/app/controllers/spree/api/v3/store/customer/addresses_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customer/addresses_controller.rb@@ -7,6 +7,12 @@ module Spreeprepend_before_action :require_authentication!before_action :set_resource, only: [:show, :update, :destroy]+ request_params 'AddressParams' do+ include_fields Spree::Api::V3::RequestShapes::STORE_ADDRESS_FIELDS+ boolean :is_default_billing, description: 'Makes this the default billing address.'+ boolean :is_default_shipping, description: 'Makes this the default shipping address.'+ end+# POST /api/v3/store/customers/me/addressesdef createresult = Spree.address_create_service.call(@@ -58,13 +64,7 @@ module Spreeenddef permitted_params- params.permit(- *model_additional_permitted_attributes,- :first_name, :last_name, :address1, :address2, :city,- # country_iso and state_abbr are the legacy write names, accepted until 6.1.- :postal_code, :phone, :company, :country_code, :country_iso, :state_code, :state_abbr, :state_name,- :is_default_billing, :is_default_shipping- )+ params.permit(*permitted_attributes)endendenddiff --git a/spree/api/app/controllers/spree/api/v3/store/customer/data_requests_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customer/data_requests_controller.rbindex 9c746e3377..44c06b6671 100644--- a/spree/api/app/controllers/spree/api/v3/store/customer/data_requests_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customer/data_requests_controller.rb@@ -15,6 +15,11 @@ module Spreeprepend_before_action :require_authentication!+ request_params 'CreateDataRequestParams', action: :create do+ string :kind, enum: Spree::DataRequest::KINDS, description: 'Defaults to `access`.'+ string :current_password, description: 'Required for `erasure`.'+ end+# POST /api/v3/store/customers/me/data_requestsdef createreturn render_current_password_invalid if erasure? && !valid_current_password?diff --git a/spree/api/app/controllers/spree/api/v3/store/customer/password_resets_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customer/password_resets_controller.rbindex 5578e13f02..22e262c552 100644--- a/spree/api/app/controllers/spree/api/v3/store/customer/password_resets_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customer/password_resets_controller.rb@@ -14,6 +14,16 @@ module Spreeskip_before_action :authenticate_user+ request_params 'RequestPasswordResetParams', action: :create do+ string :email, required: true, format: :email, example: '[email protected]', description: 'The email of the account to reset.'+ string :redirect_url, format: :uri, example: 'https://myshop.com/reset-password',+ description: "Where the reset link sends the customer. Ignored unless it matches one of the store's allowed origins."+ end++ request_params 'ResetPasswordParams', action: :update do+ string :password, :password_confirmation, required: true, example: 'newsecurepassword'+ end+# POST /api/v3/store/password_resetsdef createredirect_url = params[:redirect_url]diff --git a/spree/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rbindex a1ab063f77..999462db9a 100644--- a/spree/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb@@ -9,6 +9,15 @@ module Spreeskip_before_action :set_resourcebefore_action :set_payment_setup_session, only: [:show, :complete]+ request_params 'CreatePaymentSetupSessionParams', action: :create do+ id :payment_method_id, required: true, example: 'pm_abc123'+ object :external_data, description: 'Provider-specific data passed to the gateway.'+ end++ request_params 'CompletePaymentSetupSessionParams', action: :complete do+ object :external_data, description: 'Provider-specific completion data.'+ end+# POST /api/v3/store/customer/payment_setup_sessionsdef createpayment_method = current_store.payment_methods.find_by_prefix_id!(params[:payment_method_id])@@ -58,12 +67,8 @@ module SpreeSpree.api.payment_setup_session_serializerend- def resource_permitted_attributes- [:payment_method_id, { external_data: {} }]- end-def complete_params- params.permit({ external_data: {} })+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/customer/tax_identifiers_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customer/tax_identifiers_controller.rbindex b826ff32aa..93af0d89ae 100644--- a/spree/api/app/controllers/spree/api/v3/store/customer/tax_identifiers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customer/tax_identifiers_controller.rb@@ -18,6 +18,10 @@ module Spree# the buyer never named and could not predict.before_action :require_kind!, only: %i[show update destroy]+ request_params('TaxIdentifierParams', action: :update) do+ include_fields Spree::Api::V3::RequestShapes::TAX_IDENTIFIER_FIELDS+ end+# GET /api/v3/store/customers/me/tax_identifiers## Everything the buyer could choose between at checkout. Small and@@ -65,7 +69,7 @@ module Spreeenddef permitted_params- params.permit(:kind, :value)+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customers_controller.rbindex 470c035456..7dba20e725 100644--- a/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb@@ -11,6 +11,30 @@ module Spreeskip_before_action :authenticate_user, only: [:create]prepend_before_action :require_authentication!, only: [:show, :update]+ CUSTOMER_FIELDS = Spree::Api::V3::RequestSchema.new do+ string :first_name, example: 'John'+ string :last_name, example: 'Doe'+ string :phone, example: '+1 555 123 4567'+ boolean :accepts_email_marketing+ object :metadata, description: 'Write-only key-value metadata.'+ end++ request_params 'RegisterParams', action: :create do+ string :email, required: true, format: :email, example: '[email protected]'+ string :password, required: true, example: 'password123'+ string :password_confirmation, example: 'password123'+ include_fields CUSTOMER_FIELDS+ boolean :terms_of_service, permit: false,+ description: "Whether the customer ticked the storefront's terms of service box. Recorded as their consent."+ end++ request_params 'UpdateCustomerParams', action: :update do+ string :email, format: :email, example: '[email protected]'+ string :password, :password_confirmation+ string :current_password, description: 'Required when changing the email or the password.'+ include_fields CUSTOMER_FIELDS+ end+# POST /api/v3/store/customers# Registration runs through the customer_create_workflow seam# (password requirement, newsletter-subscriber linking, registration@@ -83,8 +107,7 @@ module Spreeenddef permitted_params- params.permit(:email, :password, :password_confirmation, :first_name, :last_name,- :accepts_email_marketing, :phone, :current_password, metadata: {})+ params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/newsletter_subscribers_controller.rb b/spree/api/app/controllers/spree/api/v3/store/newsletter_subscribers_controller.rbindex 5fe057a64b..babf1da369 100644--- a/spree/api/app/controllers/spree/api/v3/store/newsletter_subscribers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/newsletter_subscribers_controller.rb@@ -10,6 +10,21 @@ module Spreeonly: [:create, :verify, :request_unsubscribe],with: -> { render_rate_limited(limit: Spree::Api::Config[:rate_limit_register]) }+ request_params 'CreateNewsletterSubscriberParams', action: :create do+ string :email, required: true, format: :email, example: '[email protected]'+ string :redirect_url, format: :uri, example: 'https://your-store.com/newsletter/confirm',+ description: "The storefront URL the verification token is appended to. Left out of the webhook payload unless it matches one of the store's allowed origins."+ end++ request_params 'VerifyNewsletterSubscriberParams', action: :verify do+ string :token, required: true, example: 'abc123def456', description: 'The verification token from the confirmation email.'+ end++ request_params 'RequestNewsletterUnsubscribeParams', action: :request_unsubscribe do+ string :email, format: :email, example: '[email protected]'+ string :redirect_url, format: :uri, description: "The storefront URL the unsubscribe token is appended to in the email. Left out of the event payload unless it matches one of the store's allowed origins."+ end+# POST /api/v3/store/newsletter_subscribersdef createsubscriber = Spree::NewsletterSubscriber.subscribe(diff --git a/spree/api/app/controllers/spree/api/v3/store/orders/claims_controller.rb b/spree/api/app/controllers/spree/api/v3/store/orders/claims_controller.rbindex 1dbaca4005..8864c445e4 100644--- a/spree/api/app/controllers/spree/api/v3/store/orders/claims_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/orders/claims_controller.rb@@ -10,6 +10,16 @@ module Spree# Whether a customer may file a claim is store policy and belongs in# a `claims.create.validate` hook rather than here.class ClaimsController < Store::ResourceController+ request_params 'CreateClaimParams', action: :create do+ object :items, array: true, required: true do+ id :line_item_id, required: true+ integer :quantity, required: true+ string :description, description: 'What is wrong with the item.'+ end+ id :reason_id, description: "One of the store's claim reasons."+ string :memo+ end+def createresult = Spree.claim_create_workflow.call(order: @parent,@@ -59,8 +69,7 @@ module Spreeenddef create_params- @create_params ||= params.permit(:memo, :reason_id,- items: [:line_item_id, :quantity, :description])+ @create_params ||= params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/orders/returns_controller.rb b/spree/api/app/controllers/spree/api/v3/store/orders/returns_controller.rbindex 4629152dac..c9bdd32632 100644--- a/spree/api/app/controllers/spree/api/v3/store/orders/returns_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/orders/returns_controller.rb@@ -17,6 +17,15 @@ module Spree# standard actions are listed alongside the label download.before_action :set_resource, only: [:show, :update, :destroy, :label]+ request_params 'CreateReturnParams', action: :create do+ object :items, array: true, required: true do+ id :fulfillment_item_id, required: true, description: 'The shipped unit coming back.'+ integer :quantity, required: true+ end+ id :reason_id, description: "One of the store's return reasons."+ string :memo+ end+# GET /api/v3/store/orders/:order_id/returns/:id/label## The customer's return label, streamed to whoever owns the order.@@ -85,7 +94,7 @@ module Spreeenddef create_params- @create_params ||= params.permit(:memo, :reason_id, items: [:fulfillment_item_id, :quantity])+ @create_params ||= params.permit(*declared_permitted_attributes)endprivatediff --git a/spree/api/app/controllers/spree/api/v3/store/wishlist_items_controller.rb b/spree/api/app/controllers/spree/api/v3/store/wishlist_items_controller.rbindex 5404f53e53..adb993b983 100644--- a/spree/api/app/controllers/spree/api/v3/store/wishlist_items_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/wishlist_items_controller.rb@@ -7,6 +7,16 @@ module Spreeprepend_before_action :require_authentication!+ request_params 'CreateWishlistItemParams', action: :create do+ id :variant_id, required: true, example: 'variant_abc123'+ integer :quantity, example: 1+ end++ request_params 'UpdateWishlistItemParams', action: :update do+ id :variant_id, description: 'Moves the item to another variant.'+ integer :quantity, example: 2+ end+protecteddef set_parent@@ -24,10 +34,6 @@ module SpreeSpree.api.wishlist_item_serializerend- def resource_permitted_attributes- [:variant_id, :quantity]- end-# The item renders its variant and product, so the variant must be# one the buyer could find in the listing — not a draft, another# catalog's product, or an id guessed from the sequence.diff --git a/spree/api/app/controllers/spree/api/v3/store/wishlists_controller.rb b/spree/api/app/controllers/spree/api/v3/store/wishlists_controller.rbindex b31afd8ded..6fb24b7df1 100644--- a/spree/api/app/controllers/spree/api/v3/store/wishlists_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/wishlists_controller.rb@@ -5,6 +5,16 @@ module Spreeclass WishlistsController < ResourceControllerprepend_before_action :require_authentication!+ request_params 'CreateWishlistParams', action: :create do+ string :name, required: true, example: 'Birthday Ideas'+ boolean :is_private, :is_default+ end++ request_params 'UpdateWishlistParams', action: :update do+ string :name, example: 'Updated Name'+ boolean :is_private, :is_default+ end+# POST /api/v3/store/wishlistsdef create@resource = current_user.wishlists.build(permitted_params)@@ -30,10 +40,6 @@ module Spreedef serializer_classSpree.api.wishlist_serializerend-- def resource_permitted_attributes- [:name, :is_default, :is_private]- endendendenddiff --git a/spree/api/app/serializers/spree/api/v3/admin/order_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/order_serializer.rbindex 81a5b2e965..fcaebe8823 100644--- a/spree/api/app/serializers/spree/api/v3/admin/order_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/order_serializer.rb@@ -34,7 +34,7 @@ module Spreetypelize status: [:string, enum: Spree::Order::STATUSES],last_ip_address: [:string, nullable: true],considered_risky: :boolean, confirmation_delivered: :boolean,- store_owner_notification_delivered: :boolean,+ store_owner_notification_delivered: [:boolean, nullable: true],internal_note: [:string, nullable: true], internal_note_html: [:string, nullable: true],approver_id: [:string, nullable: true],approver_type: [:string, nullable: true, enum: Spree::Actor::BUILT_IN_KINDS, enum_type_name: 'ActorKind'],diff --git a/spree/api/app/serializers/spree/api/v3/media_serializer.rb b/spree/api/app/serializers/spree/api/v3/media_serializer.rbindex 281405319c..211825eaf7 100644--- a/spree/api/app/serializers/spree/api/v3/media_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/media_serializer.rb@@ -32,8 +32,13 @@ module Spreeids.compact.uniqend- attributes :position, :alt, :media_type,- :focal_point_x, :focal_point_y, :external_video_url+ attributes :position, :alt, :media_type, :external_video_url++ # Decimal columns serialize as strings; a focal point is a 0–1+ # position on the image, which clients read as a number.+ %i[focal_point_x focal_point_y].each do |name|+ attribute(name) { |asset| asset.public_send(name)&.to_f }+ end# Spree parses the YouTube/Vimeo link once, here, so no storefront has# to reimplement it. Nil on anything that isn't an external video.diff --git a/spree/api/app/serializers/spree/api/v3/seller/media_serializer.rb b/spree/api/app/serializers/spree/api/v3/seller/media_serializer.rbindex 2d2afbda03..c70976cae6 100644--- a/spree/api/app/serializers/spree/api/v3/seller/media_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/seller/media_serializer.rb@@ -9,12 +9,9 @@ module Spree# it is cropped, and which variants it belongs to.class MediaSerializer < V3::MediaSerializertypelize position: :number,- variant_ids: [:string, multi: true],- focal_point_x: [:number, nullable: true],- focal_point_y: [:number, nullable: true]+ variant_ids: [:string, multi: true]- attributes :position, :focal_point_x, :focal_point_y,- created_at: :iso8601, updated_at: :iso8601+ attributes :position, created_at: :iso8601, updated_at: :iso8601attribute :variant_ids do |media|media.variants.map(&:prefixed_id)diff --git a/spree/api/app/services/spree/api/v3/request_schema.rb b/spree/api/app/services/spree/api/v3/request_schema.rbnew file mode 100644index 0000000000..6a7027b444--- /dev/null+++ b/spree/api/app/services/spree/api/v3/request_schema.rb@@ -0,0 +1,268 @@+module Spree+ module Api+ module V3+ # What one write endpoint accepts, declared once. The controller permits+ # from it, the API reference documents it, and the SDK request types are+ # generated from the reference, so the three cannot disagree.+ #+ # request_params :product do+ # string :name, required: :create+ # string :status, enum: %w[draft active archived]+ # id :category_ids, array: true+ # object :metadata+ # object :prices, array: true, shape: RequestShapes::PRICE+ # object :options, array: true do+ # string :name, :value, required: true+ # end+ # end+ #+ # `required: :create` is required when creating and optional when+ # updating; `required: true` is required in both. `only: :create` (or+ # `:update`) accepts a field on one of the two actions alone.+ # `permit: false` documents a field the controller reads from the raw+ # params itself (external references, uploads), so it is left out of+ # the permit list. `format:` documents a string's format (`email`, `uri`).+ class RequestSchema+ KINDS = {+ string: { type: :string },+ integer: { type: :integer },+ # Measurements a client sends as JSON numbers (weights, dimensions,+ # coordinates). Money is never a number: use `decimal`.+ number: { type: :number },+ # Amounts, rates and quantities with decimals travel as canonical+ # decimal strings, never JSON numbers (see Spree::Money::Rounding).+ decimal: { type: :string, format: :decimal, pattern: '^-?\d+(\.\d+)?$' },+ boolean: { type: :boolean },+ date: { type: :string, format: :date },+ datetime: { type: :string, format: :'date-time' },+ id: { type: :string },+ any: {}+ }.freeze++ ACTIONS = %i[create update].freeze++ class Field+ attr_reader :name, :kind, :array, :required, :nullable, :description, :example, :enum, :only, :schema, :permit,+ :format++ def initialize(name, kind, array: false, required: false, nullable: false, description: nil,+ example: nil, enum: nil, only: nil, schema: nil, permit: true, format: nil)+ unless required.in?([true, false, :create])+ raise ArgumentError, "required: must be true, false or :create (#{name})"+ end+ raise ArgumentError, "only: must be :create or :update (#{name})" if only && !only.in?(ACTIONS)++ @name = name.to_sym+ @kind = kind+ @array = array+ @required = required+ @nullable = nullable+ @description = description+ @example = example+ @enum = enum&.map(&:to_s)+ @only = only+ @schema = schema+ @permit = permit+ @format = format+ end++ # @param action [Symbol, nil]+ def accepted_on?(action)+ only.nil? || action.nil? || only == action+ end++ # @param action [Symbol, nil]+ def required_on?(action)+ required == true || (required == :create && action == :create)+ end++ # A hash of any keys, such as `metadata` or `provider_settings`.+ def free_object?+ kind == :object && schema.nil?+ end+ end++ attr_reader :name, :fields++ # A shape shared between several endpoints (a price, an address),+ # published as its own component so each SDK has one type for it.+ #+ # @param name [String] the component name, such as `PriceParams`+ # @return [RequestSchema]+ def self.shape(name, &block)+ raise ArgumentError, "a shape's name ends in Params (#{name})" unless name.to_s.end_with?('Params')++ new(name, &block)+ end++ # @param name [String, Symbol, nil] the resource, `product` publishing+ # `ProductCreateParams` and `ProductUpdateParams`; or a name ending+ # in `Params`, published as given for every action+ def initialize(name = nil, &block)+ @name = name&.to_s+ @fields = {}+ instance_eval(&block) if block+ end++ KINDS.each_key do |kind|+ # @param names [Array<Symbol>] one or more fields of this kind+ define_method(kind) do |*names, **options|+ names.each { |field_name| add(Field.new(field_name, kind, **options)) }+ end+ end++ # A nested hash. Without a block or `shape:` it takes any keys.+ #+ # @param name [Symbol]+ # @param shape [RequestSchema, nil] a shared shape+ # @param as [String, nil] publishes the block's fields as a component+ # of this name, for a nested type clients want to name+ def object(name, shape: nil, as: nil, **options, &block)+ schema = shape || (block && (as ? RequestSchema.shape(as, &block) : RequestSchema.new(&block)))+ if options[:array] && schema.nil?+ raise ArgumentError, "#{name}: an array of objects needs a shape, since any-key hashes cannot be permitted in a list"+ end++ add(Field.new(name, :object, schema: schema, **options))+ end++ # The identities a record has in external systems, which the Admin API+ # reads from the raw params (Admin::Concerns::ExternalReferences).+ def external_references+ object :external_references, permit: false, description: <<~TEXT.squish+ Identities the record has in external systems, keyed by system: the same+ `{ system: external_id }` map the Admin API renders, so what you read can be+ sent straight back. Systems you do not name keep the reference they have.+ A list of `{ system, external_id }` entries is accepted too.+ TEXT+ end++ # Adds the fields of another schema, for endpoints that extend a+ # shared set.+ #+ # @param other [RequestSchema]+ def include_fields(other)+ other.fields.each_value { |field| add(field) }+ end++ # The `params.permit` list for an action.+ #+ # @param action [Symbol, String, nil] `create` or `update`; nil+ # accepts every field+ # @return [Array<Symbol, Hash>]+ def permit_list(action = nil)+ action = action&.to_sym+ scalars = []+ nested = []++ fields_for(action).each do |field|+ next unless field.permit++ if field.schema+ nested << { field.name => field.schema.permit_list }+ elsif field.free_object?+ nested << { field.name => {} }+ elsif field.kind == :any+ # A value of any JSON type: a scalar, a list or a hash.+ scalars << field.name+ nested << { field.name => [] } << { field.name => {} }+ elsif field.array+ nested << { field.name => [] }+ else+ scalars << field.name+ end+ end++ scalars + nested+ end++ # The JSON Schema of the request body for an action.+ #+ # @param action [Symbol, String, nil]+ # @return [Hash]+ def json_schema(action = nil)+ action = action&.to_sym+ fields = fields_for(action)+ required = fields.select { |field| field.required_on?(action) }.map { |field| field.name.to_s }++ schema = { type: :object, properties: fields.to_h { |field| [field.name, property_schema(field)] } }+ schema[:required] = required if required.any?+ schema+ end++ # The component name published for an action.+ #+ # @param action [Symbol, String]+ # @return [String]+ def component_name(action)+ return name if name.end_with?('Params')++ "#{name.camelize}#{action.to_s.camelize}Params"+ end++ # Every named shape this schema reaches, nested ones included.+ #+ # @return [Array<RequestSchema>]+ def shapes+ fields.each_value.flat_map do |field|+ next [] unless field.schema++ nested = field.schema.shapes+ shape?(field.schema) ? [field.schema, *nested] : nested+ end.uniq+ end++ def shape?(schema)+ schema.name.present?+ end++ private++ def add(field)+ raise ArgumentError, "#{field.name} is declared twice" if fields.key?(field.name)++ fields[field.name] = field+ end++ def fields_for(action)+ fields.values.select { |field| field.accepted_on?(action) }+ end++ def property_schema(field)+ item = item_schema(field)+ documentation = { description: field.description, example: field.example }.compact++ if field.array+ schema = { type: :array, items: item }.merge(documentation)+ schema[:nullable] = true if field.nullable+ return schema+ end++ # A $ref ignores the keys beside it, so a described or nullable+ # reference wraps it.+ if item.key?(:$ref) && (documentation.any? || field.nullable)+ item = { allOf: [item] }+ end++ item = item.merge(documentation)+ item[:nullable] = true if field.nullable+ item+ end++ def item_schema(field)+ if field.schema+ return { '$ref': "#/components/schemas/#{field.schema.name}" } if shape?(field.schema)++ return field.schema.json_schema+ end+ return { type: :object, additionalProperties: true } if field.free_object?++ schema = KINDS.fetch(field.kind).dup+ schema[:enum] = field.enum if field.enum+ schema[:format] = field.format if field.format+ schema+ end+ end+ end+ end+enddiff --git a/spree/api/app/services/spree/api/v3/request_shapes.rb b/spree/api/app/services/spree/api/v3/request_shapes.rbnew file mode 100644index 0000000000..1fd1d6152a--- /dev/null+++ b/spree/api/app/services/spree/api/v3/request_shapes.rb@@ -0,0 +1,195 @@+module Spree+ module Api+ module V3+ # Request shapes several endpoints accept, published once per API so+ # each SDK has one type for them. See Spree::Api::V3::RequestSchema.+ module RequestShapes+ PRICE = RequestSchema.shape('PriceParams') do+ string :currency, required: true, example: 'USD'+ decimal :amount, required: true, example: '29.99',+ description: 'A canonical decimal string (`"1234.56"`: period decimal, no grouping). The API does not parse localized input.'+ decimal :compare_at_amount, nullable: true, example: '39.99'+ end++ VARIANT_OPTION = RequestSchema.shape('VariantOptionParams') do+ string :name, required: true, example: 'size'+ string :value, required: true, example: 'Small'+ end++ STOCK_LEVEL = RequestSchema.shape('StockLevelParams') do+ id :id+ id :stock_location_id, required: true, description: 'The location holding the stock (`sloc_...`).'+ integer :count_on_hand, required: true,+ description: 'Units physically at the location, not units available to sell: stock promised to placed orders counts until it ships. Sent as the count the shelf should end at; the API records the difference as an adjustment in the stock history.'+ boolean :backorderable, description: 'Whether this location sells the variant beyond what it holds.'+ end++ # A variant's own attributes, shared by the variant endpoints and the+ # variants nested in a product payload. Not published on its own: each+ # endpoint includes these fields into its own type.+ VARIANT_ATTRIBUTES = RequestSchema.new do+ string :sku, :barcode+ decimal :cost_price, nullable: true+ string :cost_currency+ number :weight, :height, :width, :depth, nullable: true+ string :weight_unit, enum: Spree::Variant::WEIGHT_UNITS+ string :dimensions_unit, enum: Spree::Variant::DIMENSION_UNITS+ string :hs_code, :country_of_origin, :customs_description+ integer :minimum_order_quantity, :order_multiple, nullable: true+ string :purchase_unit+ integer :units_per_carton, nullable: true, description: 'How many units fill one carton.'+ id :carton_package_type_id, nullable: true,+ description: 'The carton this variant is packed into: a package type of kind `carton`. Its dimensions are shared by every product packed the same way, so a corrected carton size fixes all of them at once.'+ number :carton_weight, nullable: true, description: "What one packed carton weighs, in the variant's weight unit."+ integer :cartons_per_pallet, nullable: true, description: 'How many cartons stack on one pallet.'+ id :seller_id+ id :delivery_profile_id, nullable: true+ boolean :track_inventory+ boolean :preorderable,+ description: "Sell this variant before it's in stock. Adds the pre-order label and ships-by promise; the cap comes from `backorder_limit`, an incoming stock count, or backorder."+ datetime :preorder_ships_at, nullable: true,+ description: 'The "ships by" date shown to customers while the variant is a pre-order. Once it passes, the variant is no longer a pre-order. Null clears it.'+ integer :backorder_limit, nullable: true,+ description: 'Maximum units sellable beyond available stock, capping backorders and pre-orders. Null is unlimited.'+ id :tax_category_id+ integer :position+ object :prices, array: true, shape: PRICE, description: 'Per-currency prices. Upserted by currency.'+ object :stock_levels, array: true, shape: STOCK_LEVEL,+ description: 'Stock per location. Upserted by location; omitted locations are removed.'+ end++ CUSTOM_FIELD_VALUE = RequestSchema.shape('CustomFieldValueParams') do+ id :id+ id :custom_field_definition_id+ any :value, description: 'A scalar for text, number and boolean fields; a list or a hash for JSON fields.'+ end++ PRICE_LIST_RULE = RequestSchema.shape('PriceListRuleParams') do+ id :id, nullable: true, description: 'Present for existing rules. Omit to create a new one.'+ string :type, required: true, example: 'volume_rule',+ description: 'Wire shorthand for the rule kind, from the price rule types endpoint.'+ object :preferences, description: "The rule kind's settings, keyed by preference name."+ end++ PRICE_ADJUSTMENT_TIER = RequestSchema.shape('PriceAdjustmentTierParams') do+ integer :min_quantity, required: true, example: 10,+ description: "Above 1; quantity 1 is the list's own `price_adjustment_percentage`."+ decimal :percentage, required: true, example: '-10.0', description: 'Signed: negative discounts, positive marks up.'+ end++ # The least a whole order must come to under a catalog, in one currency.+ CATALOG_ORDER_MINIMUM = RequestSchema.shape('CatalogOrderMinimumParams') do+ string :currency, example: 'USD', description: 'ISO 4217 code. Required on create; one minimum per currency.'+ decimal :amount, example: '500.00'+ end++ PRICE_LIST_PRICE =RequestSchema.shape('PriceListPriceOverrideParams') do+ id :id, description: 'Updates this price row. Without it, the row upserts on `(variant_id, currency, min_quantity)`.'+ id :variant_id, example: 'variant_xY9'+ string :currency, example: 'USD'+ integer :min_quantity, description: "The rung of the variant's ladder. Omit for the bottom rung."+ decimal :amount, :compare_at_amount, nullable: true, example: '19.99'+ end++ # The writable attributes of an address (Spree::Api::V3::AddressParams).+ # Not published on its own: each endpoint includes these fields into+ # its own type, beside what it adds (default flags, a label).+ ADDRESS_FIELDS = RequestSchema.new do+ string(*(AddressParams::ADDRESS_KEYS - %i[country_code state_code]))+ string :country_code, description: 'ISO 3166-1 alpha-2 code, such as `US`.'+ string :state_code, description: 'The state or province abbreviation, such as `NY`.'+ end++ # An address as a shopper writes it on the Store API: on a cart and in+ # their own address book. Not published on its own, like ADDRESS_FIELDS.+ STORE_ADDRESS_FIELDS = RequestSchema.new do+ string :first_name, :last_name, :company, :address1, :address2, :city, :postal_code, :phone+ string :country_code, example: 'US', description: 'ISO 3166-1 alpha-2 country code, such as `US` or `DE`.'+ string :state_code, example: 'NY', description: 'ISO 3166-2 subdivision code without the country prefix, such as `CA` or `NY`.'+ string :state_name, description: 'The state name, for countries without predefined states.'+ string :country_iso, description: 'Deprecated: use `country_code`. Accepted until 6.1.'+ string :state_abbr, description: 'Deprecated: use `state_code`. Accepted until 6.1.'+ end++ # A tax registration as a shopper writes it, on their profile or on a+ # cart. Each declares it as `TaxIdentifierParams` with only these fields.+ # Registry-driven, so a plain string: any kind is stored, and one with a+ # validator in Spree.tax_identifier_validators is checked by it.+ TAX_IDENTIFIER_KIND = 'The registration the number belongs to, such as `eu_vat` or `gb_vat`. ' \+ 'Any kind is accepted; one with a registered validator is checked by it. ' \+ 'Built-in: `eu_vat`. Extensions may register more.'.freeze++ TAX_IDENTIFIER_FIELDS = RequestSchema.new do+ string :kind, required: true, example: 'eu_vat', description: TAX_IDENTIFIER_KIND+ string :value, required: true, example: 'DE123456789'+ end++ # The keys of a promotion rule or action beyond `type`, shared by the+ # nested promotion rule and action endpoints and by the `rules` and+ # `actions` written with a promotion. Kind-specific keys are read+ # per kind from its `additional_permitted_attributes`, so they are+ # documented here and left out of the permit list.+ PROMOTION_RULE_FIELDS = RequestSchema.new do+ object :preferences, description: "Values for the rule kind's settings schema, from `GET /promotion_rules/types`."+ id :product_ids, array: true, permit: false, description: 'For the `product` rule.'+ id :category_ids, array: true, permit: false, description: 'For the `category` rule.'+ id :customer_ids, array: true, permit: false, description: 'For the `user` rule: the customers who qualify.'+ end++ PROMOTION_ACTION_CALCULATOR = RequestSchema.shape('PromotionActionCalculatorParams') do+ string :type, example: 'flat_percent_item_total',+ description: 'The calculator kind, from `GET /promotion_actions/calculators`. Changing it swaps the calculator.'+ object :preferences, description: "Values for the calculator's settings, such as `amount` or `flat_percent`."+ end++ PROMOTION_ACTION_LINE_ITEM = RequestSchema.shape('PromotionActionLineItemParams') do+ id :variant_id, required: true+ integer :quantity, required: true+ end++ PROMOTION_ACTION_FIELDS = RequestSchema.new do+ object :preferences, description: "Values for the action kind's settings schema, from `GET /promotion_actions/types`."+ object :calculator, shape: PROMOTION_ACTION_CALCULATOR, permit: false, description: 'For adjustment actions.'+ object :line_items, array: true, shape: PROMOTION_ACTION_LINE_ITEM, permit: false,+ description: 'For `create_line_items`: the variants to add and their quantities. Variants left out are removed.'+ end++ # The body of the shared bulk tag actions (Spree::Api::V3::BulkOperations).+ # Each controller declares it as `BulkTagsParams` with only these fields,+ # so the published component is the same wherever it is used.+ BULK_TAGS = RequestSchema.new do+ id :ids, array: true, required: true,+ description: 'The records to change. Records the caller cannot update are skipped; an empty list changes nothing.'+ string :tags, array: true, required: true, example: %w[vip wholesale]+ end++ # The language every email template endpoint takes. Read from the raw+ # params (Admin::EmailTemplateLookup), so never permitted. Not+ # published on its own.+ EMAIL_TEMPLATE_LANGUAGE = RequestSchema.new do+ string :language, permit: false, example: 'any',+ description: 'A language code, or `any` (the default) for the version every language uses.'+ end++ # What the email template preview and test email endpoints render.+ # Not published on its own: both declare it as `EmailTemplatePreviewParams`.+ EMAIL_TEMPLATE_PREVIEW = RequestSchema.new do+ include_fields EMAIL_TEMPLATE_LANGUAGE+ string :subject, nullable: true, example: 'Your order {{ order.number }} is confirmed',+ description: 'An unsaved subject, in place of the current one.'+ string :body, example: '<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name }}!</mj-text></mj-column></mj-section>',+ description: 'An unsaved body, in place of the current one.'+ id :record_id, example: 'or_m3Rp9wXz',+ description: "The record to build sample data from; the store's latest matching record otherwise."+ string :email_key, permit: false, example: 'spree.order_mailer.confirm_email',+ description: 'For the layout or a partial, the email to show it in.'+ object :branding, permit: false,+ description: "Unsaved colors and font to preview, named like the store's `email_*` settings." do+ string(*Spree::Emails::Branding::COLORS, nullable: true)+ string :font, nullable: true, enum: Spree::Emails::Branding::FONTS.keys+ end+ end+ end+ end+ end+enddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/products/media_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/products/media_controller_spec.rbindex 21eb745072..d603596d7a 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/products/media_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/products/media_controller_spec.rb@@ -308,6 +308,7 @@ RSpec.describe Spree::Api::V3::Admin::MediaController, type: :controller doexpect(response).to have_http_status(:ok)expect(image.reload.focal_point).to eq({ x: 0.25, y: 0.75 })+ expect(json_response.values_at('focal_point_x', 'focal_point_y')).to eq([0.25, 0.75])endendenddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/store_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/store_controller_spec.rbindex ecc4d5862d..ee019951f1 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/store_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/store_controller_spec.rb@@ -214,6 +214,23 @@ RSpec.describe Spree::Api::V3::Admin::StoreController, type: :controller doendend+ context 'with the digital download limits' do+ let(:params) do+ { limit_digital_download_count: false, digital_asset_authorized_clicks: 9,+ limit_digital_download_days: false, digital_asset_authorized_days: 30 }+ end++ it 'saves them' do+ subject+ expect(response).to have_http_status(:ok)+ store.reload+ expect(store.preferred_limit_digital_download_count).to be(false)+ expect(store.preferred_digital_asset_authorized_clicks).to eq(9)+ expect(store.preferred_limit_digital_download_days).to be(false)+ expect(store.preferred_digital_asset_authorized_days).to eq(30)+ end+ end+context 'with invalid params' dolet(:params) { { name: '' } }diff --git a/spree/api/spec/integration/spree/api/v3/admin/admin_users_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/admin_users_spec.rbindex 7c64603919..342a473e5b 100644--- a/spree/api/spec/integration/spree/api/v3/admin/admin_users_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/admin_users_spec.rb@@ -85,14 +85,7 @@ RSpec.describe 'Admin Staff API', type: :request, swagger_doc: 'api-reference/adparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'Ada' },- last_name: { type: :string, example: 'Lovelace' },- role_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'staff member updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/allowed_origins_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/allowed_origins_spec.rbindex 596ef7a8de..f91223cd4b 100644--- a/spree/api/spec/integration/spree/api/v3/admin/allowed_origins_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/allowed_origins_spec.rb@@ -74,13 +74,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-reparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- origin: { type: :string, example: 'https://admin.example.com' }- },- required: %w[origin]- }+ request_body_forresponse '201', 'allowed origin created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -158,12 +152,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-reparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- origin: { type: :string }- }- }+ request_body_forresponse '200', 'allowed origin updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/api_keys_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/api_keys_spec.rbindex 7d8672de25..2b4f5cb34f 100644--- a/spree/api/spec/integration/spree/api/v3/admin/api_keys_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/api_keys_spec.rb@@ -56,15 +56,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name key_type],- properties: {- name: { type: :string, example: 'Backend integration' },- key_type: { type: :string, enum: %w[publishable secret] },- scopes: { type: :array, items: { type: :string }, example: %w[read_orders write_orders] }- }- }+ request_body_forresponse '201', 'secret key created — plaintext token returned once' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -128,12 +120,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Backend integration (renamed)' }- }- }+ request_body_forresponse '200', 'API key renamed' dolet(:id) { secret_key_record.prefixed_id }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 11d6e0a859..ceef54f76c 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@@ -44,20 +44,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'VIP Assortment' },- active: { type: :boolean, example: true },- price_list: { type: :object, nullable: true,- description: 'The price list this catalog owns, written inline. Omit for assortment-only (base prices); send null to remove the pricing, which deletes the list. A catalog with an empty assortment prices without restricting visibility; import or curate products to make it restrictive.',- properties: {- price_adjustment_percentage: { type: :string, nullable: true, example: '-15.0' },- adjust_compare_at: { type: :boolean, example: false }- } }- },- required: ['name']- }+ request_body_forlet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -91,15 +78,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- assignable_type: { type: :string, enum: %w[customer_group company],- example: 'company' },- assignable_id: { type: :string, example: 'comp_86Rf07xd4z' }- },- required: %w[assignable_type assignable_id]- }+ request_body_forlet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { catalog.prefixed_id }@@ -183,11 +162,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter 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]- }+ request_body_forresponse '201', 'products added' dolet!(:product) { create(:product, store: store) }@@ -212,11 +187,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter 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]- }+ request_body_forresponse '200', 'products removed' dolet!(:product) { create(:product, store: store) }@@ -269,14 +240,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :catalog_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '500.00' }- },- required: %w[currency amount]- }+ request_body_forlet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:catalog_id) { catalog.prefixed_id }@@ -310,10 +274,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :catalog_id, in: :path, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: { amount: { type: :string, example: '750.00' } }- }+ request_body_forresponse '200', 'order minimum updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -362,22 +323,7 @@ RSpec.describe 'Admin Catalogs API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :catalog_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- terms: {- type: :object,- additionalProperties: {- type: :object,- properties: {- minimum_order_quantity: { type: :integer, nullable: true, example: 48 },- order_multiple: { type: :integer, nullable: true, example: 24 }- }- }- }- },- required: ['terms']- }+ request_body_forresponse '204', 'quantity rules set' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --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 0ab317d388..1d8e1afbc0 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@@ -49,19 +49,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Shirts' },- parent_id: { type: :string, example: 'ctg_abc123', 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: %w[name]- }+ request_body_forresponse '201', 'category created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -135,18 +123,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true, description: 'Category ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Apparel' },- 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 }- }- }+ request_body_forresponse '200', 'category updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -195,14 +172,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true, description: 'Category ID'- parameter name: :body, in: :body, 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: %w[new_position]- }+ request_body_forresponse '200', 'category repositioned' dolet!(:other) { create(:category, name: 'Footwear', store: store) }@@ -254,11 +224,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter 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: :body, in: :body, schema: {- type: :object,- properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },- required: %w[product_ids]- }+ request_body_forresponse '201', 'products added' dolet!(:product) { create(:product, store: store) }@@ -285,11 +251,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referenparameter 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: :body, in: :body, schema: {- type: :object,- properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },- required: %w[product_ids]- }+ request_body_forresponse '200', 'products removed' dolet!(:product) { create(:product, store: store) }@@ -320,11 +282,7 @@ RSpec.describe 'Admin Categories API', type: :request, swagger_doc: 'api-referendescription: '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: { new_position: { type: :integer, description: '0-based index among the category\'s products' } },- required: %w[new_position]- }+ request_body_forresponse '204', 'product repositioned' dolet!(:product) { create(:product, store: store) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/channels_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/channels_spec.rbindex 6edc0d9f86..fe2c5e9321 100644--- a/spree/api/spec/integration/spree/api/v3/admin/channels_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/channels_spec.rb@@ -50,22 +50,7 @@ RSpec.describe 'Admin Channels API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Point of Sale' },- code: { type: :string, example: 'pos', description: 'Slug — auto-derived from `name` when blank.' },- active: { type: :boolean, default: true },- default: { type: :boolean, default: false },- order_routing_strategy: { type: :string, nullable: true,- description: 'Routing strategy shorthand (built-in: `rules`). `null` inherits the store setting.' },- storefront_access: { type: :string, nullable: true, enum: %w[public prices_hidden login_required],- description: 'Anonymous-visitor access posture. `null` inherits the store setting.' },- guest_checkout: { type: :boolean, nullable: true,- description: 'Whether guests can check out without an account. `null` inherits the store setting.' }- }- }+ request_body_forresponse '201', 'channel created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -113,21 +98,7 @@ RSpec.describe 'Admin Channels API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- code: { type: :string },- active: { type: :boolean },- default: { type: :boolean },- order_routing_strategy: { type: :string, nullable: true,- description: 'Routing strategy shorthand (built-in: `rules`). `null` inherits the store setting.' },- storefront_access: { type: :string, nullable: true, enum: %w[public prices_hidden login_required],- description: 'Anonymous-visitor access posture. `null` inherits the store setting.' },- guest_checkout: { type: :boolean, nullable: true,- description: 'Whether guests can check out without an account. `null` inherits the store setting.' }- }- }+ request_body_forresponse '200', 'channel updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -183,17 +154,7 @@ RSpec.describe 'Admin Channels API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[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.' }- }- }+ request_body_forresponse '200', 'products published' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -226,13 +187,7 @@ RSpec.describe 'Admin Channels API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[product_ids],- properties: {- product_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products unpublished' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/claim_reasons_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/claim_reasons_spec.rbindex 7c393f57aa..bcdcd6eb75 100644--- a/spree/api/spec/integration/spree/api/v3/admin/claim_reasons_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/claim_reasons_spec.rb@@ -65,14 +65,7 @@ RSpec.describe 'Admin Claim Reasons API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Arrived damaged' },- active: { type: :boolean, example: true, description: 'Inactive reasons are hidden from the pickers on new records.' }- }- }+ request_body_forresponse '201', 'claim reason created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -149,13 +142,7 @@ RSpec.describe 'Admin Claim Reasons API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- active: { type: :boolean }- }- }+ request_body_forresponse '200', 'claim reason updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/claims_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/claims_spec.rbindex 3cce0ecd2c..143dc02c03 100644--- a/spree/api/spec/integration/spree/api/v3/admin/claims_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/claims_spec.rb@@ -8,6 +8,8 @@ RSpec.describe 'Admin Claims API', type: :request, swagger_doc: 'api-reference/alet!(:record) { create(:claim, order: create(:shipped_order, store: store)) }let(:Authorization) { "Bearer #{admin_jwt_token}" }let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:order) { record.order }+ let(:order_id) { order.prefixed_id }path '/api/v3/admin/claims' doget 'List claims' do@@ -58,5 +60,164 @@ RSpec.describe 'Admin Claims API', type: :request, swagger_doc: 'api-reference/aendendend++ post 'Create a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Opens a damage or missing-item claim on a completed order. Each item says how it should be made right: money back, a replacement, or both.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ request_body_for++ response '201', 'claim opened' do+ let(:order) { create(:shipped_order, store: store) }+ let(:body) do+ {+ memo: 'Arrived cracked',+ items: [{ line_item_id: order.line_items.first.prefixed_id, quantity: 1, description: 'Cracked screen', refund_amount: '10.00' }]+ }+ end++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('open')+ expect(data['memo']).to eq('Arrived cracked')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/claims/{id}' do+ patch 'Update a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits the reason, memo or metadata of a claim. Its status moves only through the approve, resolve, deny and cancel actions.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Claim prefixed ID'+ request_body_for++ response '200', 'claim updated' do+ let(:id) { record.prefixed_id }+ let(:reason) { create(:claim_reason, store: store) }+ let(:body) { { memo: 'Customer sent photos', reason_id: reason.prefixed_id } }++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ expect(JSON.parse(response.body)['memo']).to eq('Customer sent photos')+ expect(record.reload.reason).to eq(reason)+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/claims/{id}/resolve' do+ patch 'Resolve a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Settles an approved claim with money back, a replacement shipment, or both.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Claim prefixed ID'+ request_body_for++ response '200', 'claim resolved' do+ let!(:record) { create(:approved_claim, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) { { resolution: 'refund', refund_method: 'store_credit' } }++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('resolved')+ expect(data['resolution']).to eq('refund')+ end+ end++ response '422', 'unknown resolution' do+ let!(:record) { create(:approved_claim, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) { { resolution: 'apologize' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/claims/{id}/deny' do+ patch 'Deny a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Turns down an open claim, recording why for the customer.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Claim prefixed ID'+ request_body_for(required: false)++ response '200', 'claim denied' do+ let(:id) { record.prefixed_id }+ let(:body) { { reason: 'Outside warranty' } }++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('denied')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/claims/{id}/cancel' do+ patch 'Cancel a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Withdraws a claim that has not been resolved.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Claim prefixed ID'+ request_body_for(required: false)++ response '200', 'claim canceled' do+ let(:id) { record.prefixed_id }+ let(:body) { { reason: 'Customer found the missing item' } }++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('canceled')+ end+ end+ endendenddiff --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 310c71e7a1..14cb8d2ea2 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@@ -48,34 +48,7 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'On Sale' },- automatic: { type: :boolean, example: true },- rules_match_policy: { type: :string, enum: %w[all any], example: 'all' },- sort_order: { type: :string, example: 'manual' },- 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, example: 'crule_abc123' },- type: { type: :string, example: 'tag' },- value: { type: :string, example: 'summer' },- match_policy: { type: :string, example: 'contains' }- }- }- }- },- required: %w[name]- }+ request_body_forresponse '201', 'collection created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -159,34 +132,7 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true, description: 'Collection ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Winter Sale' },- 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: %w[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 }- }- }- }- }- }+ request_body_forresponse '200', 'collection updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -259,11 +205,7 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereparameter 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: :body, in: :body, schema: {- type: :object,- properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },- required: %w[product_ids]- }+ request_body_forresponse '201', 'products added' dolet!(:product) { create(:product, store: store) }@@ -290,11 +232,7 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-refereparameter 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: :body, in: :body, schema: {- type: :object,- properties: { product_ids: { type: :array, items: { type: :string }, example: ['prod_abc123'] } },- required: %w[product_ids]- }+ request_body_forresponse '200', 'products removed' dolet!(:product) { create(:product, store: store) }@@ -325,11 +263,7 @@ RSpec.describe 'Admin Collections API', type: :request, swagger_doc: 'api-referedescription: '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: { new_position: { type: :integer, description: '0-based index among the collection\'s products' } },- required: %w[new_position]- }+ request_body_forresponse '204', 'product repositioned' dolet!(:product) { create(:product, store: store) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/commission_rates_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/commission_rates_spec.rbindex e2f28886ca..cd05f6675a 100644--- a/spree/api/spec/integration/spree/api/v3/admin/commission_rates_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/commission_rates_spec.rb@@ -90,66 +90,7 @@ RSpec.describe 'Admin Commission Rates API', type: :request, swagger_doc: 'api-rparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name kind value],- properties: {- name: { type: :string, example: 'Audio sellers' },- code: { type: :string, example: 'audio', nullable: true,- description: 'Your own identifier for this rate; unique per store.' },- enabled: { type: :boolean, example: true },- position: { type: :integer, example: 1,- 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: %w[percentage fixed], example: 'percentage' },- value: { type: :string, example: '12.5',- description: 'A percentage (10 = 10%) or a flat amount, per `kind`.' },- amounts: {- type: :object,- additionalProperties: { type: :string },- example: { USD: '2.50', EUR: '2.00' },- 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, example: false,- 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, example: false,- 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 }- }- },- example: { USD: { min_amount: '1.0', max_amount: '50.0' } },- 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, example: '0.21', 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, example: 'seller_rule',- description: 'A kind from /commission_rates/rule_types.' },- preferences: { type: :object, example: { seller_ids: ['sel_a1b2c3'] },- description: "Configuration for the kind, per its type's `schema`." },- product_ids: { type: :array, items: { type: :string },- description: 'For kinds that name products, which are kept outside preferences.' }- }- }- }- }- }+ request_body_forresponse '201', 'commission rate created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -270,27 +211,7 @@ RSpec.describe 'Admin Commission Rates API', type: :request, swagger_doc: 'api-rparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Standard' },- enabled: { type: :boolean, example: true },- position: { type: :integer, example: 1 },- value: { type: :string, example: '15.0' },- rules: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :string },- type: { type: :string, example: 'category_rule' },- preferences: { type: :object, example: { category_ids: ['ctg_a1b2c3'] } },- product_ids: { type: :array, items: { type: :string } }- }- }- }- }- }+ request_body_forresponse '200', 'commission rate updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/companies/addresses_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/companies/addresses_spec.rbindex c3898b7489..e67d1b1918 100644--- a/spree/api/spec/integration/spree/api/v3/admin/companies/addresses_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/companies/addresses_spec.rb@@ -35,5 +35,39 @@ RSpec.describe 'Admin Company Addresses API', type: :request, swagger_doc: 'api-endendend++ post 'Create a company address' do+ tags 'Companies'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Adds an address to the business. Pass `default_billing: true` or `default_shipping: true` to make it the default of that kind.'+ admin_scope :write, :customers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :company_id, in: :path, type: :string, required: true+ request_body_for++ response '201', 'address created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) do+ {+ company: 'Acme Wholesale', label: 'Warehouse',+ address1: '350 Fifth Avenue', city: 'New York', postal_code: '10118',+ country_code: address.country.iso, state_code: address.state.abbr, phone: '+12125551234',+ default_shipping: true+ }+ end++ schema '$ref' => '#/components/schemas/Address'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['label']).to eq('Warehouse')+ expect(company.reload.default_shipping_address&.prefixed_id).to eq(data['id'])+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/companies/memberships_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/companies/memberships_spec.rbindex 9927aaae61..c824794db0 100644--- a/spree/api/spec/integration/spree/api/v3/admin/companies/memberships_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/companies/memberships_spec.rb@@ -51,13 +51,7 @@ RSpec.describe 'Admin Company Memberships API', type: :request, swagger_doc: 'apadmin_sdk_example 'companies/memberships/create'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- customer_email: { type: :string, example: '[email protected]' }- },- required: ['customer_email']- }+ request_body_forresponse '201', 'member added' dolet!(:customer) { create(:customer, email: '[email protected]') }diff --git a/spree/api/spec/integration/spree/api/v3/admin/companies/tax_exemption_certificates_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/companies/tax_exemption_certificates_spec.rbindex 4db7124a76..a2e5c49142 100644--- a/spree/api/spec/integration/spree/api/v3/admin/companies/tax_exemption_certificates_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/companies/tax_exemption_certificates_spec.rb@@ -69,23 +69,7 @@ RSpec.describe 'Admin Tax Exemption Certificates API', type: :request, swagger_dadmin_sdk_example 'tax-exemption-certificates/create'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- certificate_number: { type: :string, example: 'DE-RESALE-7' },- reason_code: { type: :string, description: 'Becomes the tax provider\'s entity use code.', example: 'resale' },- country_code: { type: :string, nullable: true, example: 'DE' },- state_code: { type: :string, nullable: true, example: 'BE' },- expires_at: { type: :string, format: 'date-time', nullable: true },- issuing_authority: { type: :string, nullable: true, example: 'Finanzamt Berlin' },- document_signed_id: {- type: :string,- description: 'The `signed_id` returned by POST /api/v3/admin/files.',- example: 'eyJfcmFpbHMiOnsiZGF0YSI6MX0=--signed'- }- },- required: %w[certificate_number reason_code]- }+ request_body_forresponse '201', 'certificate created' dolet(:body) dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/companies/tax_identifiers_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/companies/tax_identifiers_spec.rbindex 976215e7d9..1055d33634 100644--- a/spree/api/spec/integration/spree/api/v3/admin/companies/tax_identifiers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/companies/tax_identifiers_spec.rb@@ -57,14 +57,7 @@ RSpec.describe 'Admin Company Tax Identifiers API', type: :request, swagger_doc:admin_sdk_example 'company-tax-identifiers/create'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- kind: { type: :string, description: 'The regime the number belongs to.', example: 'gb_vat' },- value: { type: :string, example: 'GB123456789' }- },- required: %w[kind value]- }+ request_body_forresponse '201', 'registration created' dolet(:body) { { kind: 'gb_vat', value: 'GB123456789' } }diff --git a/spree/api/spec/integration/spree/api/v3/admin/companies_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/companies_spec.rbindex 0ff3fc50ca..7566cacb6e 100644--- a/spree/api/spec/integration/spree/api/v3/admin/companies_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/companies_spec.rb@@ -47,33 +47,7 @@ RSpec.describe 'Admin Companies API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Globex Corporation' },- kind: { type: :string, enum: %w[company division],- description: 'company = legal entity (may hold tax registrations), division = organizational unit. Roots must be company.',- example: 'company' },- parent_id: { type: :string, nullable: true,- description: 'The parent node. Omit for a root.',- example: 'comp_86Rf07xd4z' },- 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, example: 'erp' },- external_id: { type: :string, example: 'GLBX-42' }- },- required: %w[system external_id]- }- }- },- required: ['name']- }+ request_body_forlet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/custom_field_definitions_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/custom_field_definitions_spec.rbindex 2e88baad33..f9ac4ed502 100644--- a/spree/api/spec/integration/spree/api/v3/admin/custom_field_definitions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/custom_field_definitions_spec.rb@@ -59,35 +59,7 @@ RSpec.describe 'Admin Custom Field Definitions API', type: :request, swagger_docparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[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 token (`short_text`, `long_text`, `rich_text`, `number`, …). An extension type that has no token is named by its registered class instead.'- },- resource_type: {- type: :string,- description: 'Shorthand of the owning resource, e.g. `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'- }- }- }+ request_body_forresponse '201', 'definition created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -155,15 +127,7 @@ RSpec.describe 'Admin Custom Field Definitions API', type: :request, swagger_docparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- label: { type: :string },- storefront_visible: { type: :boolean },- searchable: { type: :boolean },- sortable: { type: :boolean }- }- }+ request_body_forresponse '200', 'definition updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/customer_groups_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/customer_groups_spec.rbindex 5ffb9cb655..8ec9f218cb 100644--- a/spree/api/spec/integration/spree/api/v3/admin/customer_groups_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/customer_groups_spec.rb@@ -79,15 +79,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-reparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Wholesale' },- description: { type: :string, example: 'B2B accounts', nullable: true },- customer_ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ'] }- }- }+ request_body_forresponse '201', 'customer group created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -197,14 +189,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-reparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'VIP customers (Q1)' },- description: { type: :string, example: 'Updated description', nullable: true },- customer_ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ'] }- }- }+ request_body_forresponse '200', 'customer group updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/customer_privacy_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/customer_privacy_spec.rbindex a0b8ee80e3..15ff91aa19 100644--- a/spree/api/spec/integration/spree/api/v3/admin/customer_privacy_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/customer_privacy_spec.rb@@ -146,5 +146,34 @@ RSpec.describe 'Admin Customer Privacy API', type: :request, swagger_doc: 'api-rendendend++ post 'Record a data request' do+ tags 'Customers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Records a request a customer made to the merchant directly, to export+ or erase their personal data, and starts answering it. A request of the+ same kind already in progress for the customer is returned instead of a+ second one.+ DESC+ admin_scope :write, :customers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '202', 'data request recorded' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { customer_id: customer.prefixed_id, kind: 'access' } }++ schema '$ref' => '#/components/schemas/DataRequest'++ run_test! do |response|+ expect(JSON.parse(response.body)['kind']).to eq('access')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/customers/addresses_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/customers/addresses_spec.rbindex 86e7d57aaf..c6695b7212 100644--- a/spree/api/spec/integration/spree/api/v3/admin/customers/addresses_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/customers/addresses_spec.rb@@ -55,24 +55,7 @@ RSpec.describe 'Admin Customer Addresses API', type: :request, swagger_doc: 'apiparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :customer_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, 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 }- }- }+ request_body_forresponse '201', 'address created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -111,14 +94,7 @@ RSpec.describe 'Admin Customer Addresses API', type: :request, swagger_doc: 'apiparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :customer_id, in: :path, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- city: { type: :string },- is_default_billing: { type: :boolean },- is_default_shipping: { type: :boolean }- }- }+ request_body_forresponse '200', 'address updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/customers/store_credits_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/customers/store_credits_spec.rbindex 8d148d5a20..b4a2176fe7 100644--- a/spree/api/spec/integration/spree/api/v3/admin/customers/store_credits_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/customers/store_credits_spec.rb@@ -53,15 +53,7 @@ RSpec.describe 'Admin Customer Store Credits API', type: :request, swagger_doc:parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :customer_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[amount currency],- properties: {- amount: { type: :string, example: '50.00' },- currency: { type: :string, example: 'USD' },- memo: { type: :string }- }- }+ request_body_forresponse '201', 'store credit created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -94,13 +86,7 @@ RSpec.describe 'Admin Customer Store Credits API', type: :request, swagger_doc:parameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :customer_id, in: :path, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :string, example: '50.00' },- memo: { type: :string }- }- }+ request_body_forresponse '200', 'store credit updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/customers_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/customers_spec.rbindex 8a9ba0155c..75e0e9adc7 100644--- a/spree/api/spec/integration/spree/api/v3/admin/customers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/customers_spec.rb@@ -51,20 +51,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[email],- properties: {- email: { type: :string, example: '[email protected]' },- 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 }- }- }+ request_body_forresponse '201', 'customer created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -123,19 +110,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, 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 }- }- }+ request_body_forresponse '200', 'customer updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -186,14 +161,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids customer_group_ids],- properties: {- ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ', 'cus_QrLWXg9CAJ'] },- customer_group_ids: { type: :array, items: { type: :string }, example: ['cg_UkLWZg9DAJ'] }- }- }+ request_body_forresponse '200', 'customers added to groups' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -230,14 +198,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids customer_group_ids],- properties: {- ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ'] },- customer_group_ids: { type: :array, items: { type: :string }, example: ['cg_UkLWZg9DAJ'] }- }- }+ request_body_forresponse '200', 'customers removed from groups' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -276,14 +237,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids tags],- properties: {- ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ'] },- tags: { type: :array, items: { type: :string }, example: %w[vip newsletter] }- }- }+ request_body_forresponse '200', 'tags added' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -320,14 +274,7 @@ RSpec.describe 'Admin Customers API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids tags],- properties: {- ids: { type: :array, items: { type: :string }, example: ['cus_UkLWZg9DAJ'] },- tags: { type: :array, items: { type: :string }, example: ['vip'] }- }- }+ request_body_forresponse '200', 'tags removed' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rbindex 0684cdb409..f0337855c6 100644--- a/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rb@@ -44,16 +44,7 @@ RSpec.describe 'Admin Delivery Profiles API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Oversized' },- kind: { type: :string, example: 'shipping', description: 'Registered profile kind; defaults to shipping.' },- default: { type: :boolean },- stock_location_ids: { type: :array, items: { type: :string }, description: 'Empty means every store location.' }- },- required: %w[name]- }+ request_body_forresponse '201', 'delivery profile created' dolet(:body) { { name: "Oversized #{Time.current.to_f}" } }@@ -113,14 +104,7 @@ RSpec.describe 'Admin Delivery Profiles API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, nullable: true, example: 'EU warehouse' },- position: { type: :integer, nullable: true },- stock_location_ids: { type: :array, items: { type: :string }, description: 'Empty means every store location.' }- }- }+ request_body_forresponse '201', 'origin group created' dolet(:delivery_profile_id) { create(:delivery_profile, store: store, name: "Grouped #{Time.current.to_f}").prefixed_id }@@ -149,14 +133,7 @@ RSpec.describe 'Admin Delivery Profiles API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- default: { type: :boolean },- stock_location_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'delivery profile updated' dolet(:profile) { create(:delivery_profile, store: store, name: "Bulky #{Time.current.to_f}") }diff --git a/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rbindex bbf93e1cfb..45d12bb9d3 100644--- a/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb@@ -44,31 +44,7 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Express' },- admin_name: { type: :string, nullable: true },- code: { type: :string, nullable: true },- fulfillment_provider: { type: :string, nullable: true, example: 'manual' },- delivery_profile_id: { type: :string, nullable: true, example: 'fp_86Rf07xd4z' },- storefront_visible: { type: :boolean, example: true },- tracking_url: { type: :string, nullable: true },- estimated_transit_business_days_min: { type: :integer, nullable: true },- estimated_transit_business_days_max: { type: :integer, nullable: true },- tax_category_id: { type: :string, nullable: true },- calculator: {- type: :object,- description: 'How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per that type\'s `schema`.',- properties: {- type: { type: :string, example: 'flat_rate' },- preferences: { type: :object, example: { amount: '12.5' } }- }- },- delivery_zone_id: { type: :string, nullable: true }- },- required: %w[name]- }+ request_body_forresponse '201', 'delivery method created' dolet(:body) do@@ -148,29 +124,7 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-parameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :expand, in: :query, type: :string, required: false,description: 'Comma-separated associations to embed, e.g. `members`'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'US North-East' },- description: { type: :string, nullable: true },- members: {- type: :array,- items: {- type: :object,- properties: {- member_type: { type: :string, enum: %w[country state postal_code] },- country_code: { type: :string, nullable: true, example: 'US' },- 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: %w[member_type]- }- }- },- required: %w[name]- }+ request_body_forresponse '201', 'delivery zone created' dobefore { Spree::Country.by_iso('US') }@@ -223,5 +177,78 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-endendend++ post 'Create a delivery method rule' do+ tags 'Delivery'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Adds a condition to a delivery method. `type` is a rule kind from the+ delivery method rule types endpoint, and `preferences` takes the+ values its schema declares.+ DESC+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :delivery_method_id, in: :path, type: :string, required: true+ request_body_for++ response '201', 'rule created' do+ let(:body) { { type: 'item_total_rule', preferences: { minimum_amount: '50.00' } } }++ schema '$ref' => '#/components/schemas/DeliveryMethodRule'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['type']).to eq('item_total_rule')+ expect(data['active']).to be(true)+ end+ end++ response '422', 'unknown rule type' do+ let(:body) { { type: 'not_a_rule' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/delivery_methods/{delivery_method_id}/rules/{id}' do+ let(:delivery_method) { create(:delivery_method) }+ let(:delivery_method_id) { delivery_method.prefixed_id }+ let(:rule) do+ Spree::DeliveryMethodRules::ItemTotalRule.create!(delivery_method: delivery_method, preferred_minimum_amount: '25')+ end+ let(:id) { rule.prefixed_id }++ patch 'Update a delivery method rule' do+ tags 'Delivery'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description "Changes a rule's settings or turns it off. Its `type` is fixed once created."+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :delivery_method_id, in: :path, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true+ request_body_for++ response '200', 'rule updated' do+ let(:body) { { active: false, preferences: { minimum_amount: '40.00', maximum_amount: '500.00' } } }++ schema '$ref' => '#/components/schemas/DeliveryMethodRule'++ run_test! do |response|+ expect(JSON.parse(response.body)['active']).to be(false)+ expect(rule.reload.preferred_maximum_amount.to_d).to eq(BigDecimal('500'))+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/email_templates_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/email_templates_spec.rbindex 61271a9f0c..9e2deba336 100644--- a/spree/api/spec/integration/spree/api/v3/admin/email_templates_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/email_templates_spec.rb@@ -161,16 +161,7 @@ RSpec.describe 'Admin Email Templates API', type: :request, swagger_doc: 'api-readmin_sdk_example 'email-templates/save-draft'include_context 'with admin auth parameters'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- language: { type: :string, example: 'any' },- subject: { type: :string, example: 'Your order {{ order.number }} is confirmed' },- body: { type: :string, example: '<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name }}!</mj-text></mj-column></mj-section>' },- lock_version: { type: :integer, example: 0 },- rebase: { type: :boolean, description: "Marks the draft as based on Spree's current default, after reviewing what changed in it" }- }- }+ request_body_forresponse '200', 'draft saved' dolet(:body) { { subject: 'Your order {{ order.number }} is confirmed', body: body_mjml } }@@ -242,13 +233,7 @@ RSpec.describe 'Admin Email Templates API', type: :request, swagger_doc: 'api-readmin_sdk_example 'email-templates/publish'include_context 'with admin auth parameters'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- language: { type: :string, example: 'any' },- lock_version: { type: :integer, description: "The draft's `lock_version` as reviewed; a draft saved since is refused with 409" }- }- }+ request_body_for(required: false)response '201', 'draft published' dolet(:body) { {} }@@ -299,28 +284,7 @@ RSpec.describe 'Admin Email Templates API', type: :request, swagger_doc: 'api-readmin_sdk_example 'email-templates/preview'include_context 'with admin auth parameters'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- language: { type: :string, example: 'any' },- subject: { type: :string, example: 'Your order {{ order.number }} is confirmed' },- body: { type: :string, example: '<mj-section><mj-column><mj-text>Thanks, {{ order.customer_name }}!</mj-text></mj-column></mj-section>' },- record_id: { type: :string, example: 'or_m3Rp9wXz', description: 'The record to build sample data from' },- email_key: { type: :string, example: 'spree.order_mailer.confirm_email', description: 'For the layout or a partial, the email to show it in' },- branding: {- type: :object,- description: "Unsaved colors and font to preview, named like the store's `email_*` settings",- properties: {- accent_color: { type: :string, example: '#FF5500' },- background_color: { type: :string },- card_color: { type: :string },- text_color: { type: :string },- heading_color: { type: :string },- font: { type: :string, enum: Spree::Emails::Branding::FONTS.keys }- }- }- }- }+ request_body_forresponse '200', 'email template rendered' dolet(:body) { { body: body_mjml } }@@ -352,16 +316,7 @@ RSpec.describe 'Admin Email Templates API', type: :request, swagger_doc: 'api-readmin_sdk_example 'email-templates/send-test', signed_in: trueinclude_context 'with admin auth parameters'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- language: { type: :string, example: 'any' },- subject: { type: :string },- body: { type: :string },- record_id: { type: :string },- email_key: { type: :string }- }- }+ request_body_forresponse '202', 'test email queued' dolet(:body) { { body: body_mjml } }@@ -464,13 +419,7 @@ RSpec.describe 'Admin Email Templates API', type: :request, swagger_doc: 'api-readmin_sdk_example 'email-templates/revisions/restore'include_context 'with admin auth parameters'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- language: { type: :string, example: 'any' },- lock_version: { type: :integer }- }- }+ request_body_for(required: false)response '201', 'revision copied into the draft' dolet(:template) { create(:email_template, store: store, key: editable_key) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/exchanges_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/exchanges_spec.rbindex b6e14dab16..b4e4a65658 100644--- a/spree/api/spec/integration/spree/api/v3/admin/exchanges_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/exchanges_spec.rb@@ -8,6 +8,8 @@ RSpec.describe 'Admin Exchanges API', type: :request, swagger_doc: 'api-referenclet!(:record) { create(:exchange, order: create(:shipped_order, store: store)) }let(:Authorization) { "Bearer #{admin_jwt_token}" }let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:order) { record.order }+ let(:order_id) { order.prefixed_id }path '/api/v3/admin/exchanges' doget 'List exchanges' do@@ -58,5 +60,161 @@ RSpec.describe 'Admin Exchanges API', type: :request, swagger_doc: 'api-referencendendend++ post 'Create an exchange' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Opens an exchange on a completed order: items coming back, and the variant that goes out in place of each.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ request_body_for++ response '201', 'exchange opened' do+ let(:order) { create(:shipped_order, store: store) }+ let(:fulfillment_item) { order.fulfillment_items.first }+ let(:replacement) { create(:variant, product: fulfillment_item.variant.product) }+ let(:body) do+ {+ memo: 'Wrong size',+ items: [{ fulfillment_item_id: fulfillment_item.prefixed_id, new_variant_id: replacement.prefixed_id, quantity: 1 }]+ }+ end++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('requested')+ expect(data['memo']).to eq('Wrong size')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/exchanges/{id}' do+ patch 'Update an exchange' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits the warehouse, reason, memo or metadata of an exchange. Its status moves only through the approve, receive, fulfill and cancel actions.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Exchange prefixed ID'+ request_body_for++ response '200', 'exchange updated' do+ let(:id) { record.prefixed_id }+ let(:reason) { create(:return_reason, store: store) }+ let(:body) { { memo: 'Customer wants a larger size', reason_id: reason.prefixed_id } }++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['memo']).to eq('Customer wants a larger size')+ expect(record.reload.reason).to eq(reason)+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/exchanges/{id}/receive' do+ patch 'Receive an exchange' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Records the goods that came back on an approved exchange. Omit `items` to receive everything as requested and resellable.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Exchange prefixed ID'+ request_body_for(required: false)++ response '200', 'exchange received' do+ let!(:record) { create(:approved_exchange, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) do+ { items: [{ exchange_line_item_id: record.exchange_line_items.first.prefixed_id, quantity: 1, resellable: false }] }+ end++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('received')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/exchanges/{id}/fulfill' do+ patch 'Fulfill an exchange' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Ships the replacements for a received exchange and settles any price difference.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Exchange prefixed ID'+ request_body_for(required: false)++ response '200', 'exchange fulfilled' do+ let!(:record) { create(:received_exchange, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) { { refund_method: 'store_credit' } }++ before do+ record.exchange_line_items.each { |line| line.new_variant.stock_levels.first&.set_count_on_hand(10) }+ end++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('fulfilled')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/exchanges/{id}/cancel' do+ patch 'Cancel an exchange' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Withdraws an exchange whose goods have not been received.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Exchange prefixed ID'+ request_body_for(required: false)++ response '200', 'exchange canceled' do+ let(:id) { record.prefixed_id }+ let(:body) { { reason: 'Customer kept the original' } }++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('canceled')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/exports_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/exports_spec.rbindex cf02580b89..b4f0902b7d 100644--- a/spree/api/spec/integration/spree/api/v3/admin/exports_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/exports_spec.rb@@ -56,48 +56,7 @@ RSpec.describe 'Admin Exports API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[type],- properties: {- type: {- type: :string,- enum: %w[- products- orders- customers- product_translations- gift_cards- coupon_codes- newsletter_subscribers- price_list_prices- purchase_orders- ],- example: 'products'- },- record_selection: {- type: :string,- enum: %w[filtered all],- description: 'Set to "all" to ignore search_params and export everything in scope.',- example: 'filtered'- },- search_params: {- type: :object,- description: 'Ransack query hash. Same predicates accepted by the list endpoint. ' \- 'A `price_list_prices` export requires `price_list_id_eq` naming a price list of the ' \- 'current store, and refuses `record_selection: "all"`.',- example: { name_cont: 'shirt' },- 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.',- example: 'https://admin.example.com/store_abc/exports'- }- }- }+ request_body_forresponse '201', 'export queued' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/files_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/files_spec.rbindex d40eb4cb82..2764a3cc22 100644--- a/spree/api/spec/integration/spree/api/v3/admin/files_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/files_spec.rb@@ -41,18 +41,7 @@ RSpec.describe 'Admin Files API', type: :request, swagger_doc: 'api-reference/adparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- filename: { type: :string, example: 'products.csv' },- content_type: { type: :string, example: 'text/csv' },- byte_size: { type: :integer, example: 48_213 },- checksum: { type: :string, description: 'Base64-encoded MD5 digest of the file', example: 'rL0Y20zC+Fzt72VPzMSk2A==' },- visibility: { type: :string, enum: %w[public private], default: 'public' },- file: { type: :string, format: :binary, description: 'The bytes, for a multipart upload' }- },- required: %w[filename content_type]- }+ request_body_forresponse '201', 'presigned upload target created' dolet(:body) dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/gift_card_batches_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/gift_card_batches_spec.rbindex a5f3635c89..3143966ea5 100644--- a/spree/api/spec/integration/spree/api/v3/admin/gift_card_batches_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/gift_card_batches_spec.rb@@ -62,17 +62,7 @@ RSpec.describe 'Admin Gift Card Batches API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[prefix amount codes_count],- properties: {- prefix: { type: :string, example: 'WELCOME', description: 'Lowercased and prepended to every generated code.' },- amount: { type: :string, example: '25.00', description: 'Decimal amount per card, greater than zero.' },- currency: { type: :string, example: 'USD', description: 'ISO 4217 currency code. Defaults to the store currency.' },- codes_count: { type: :integer, example: 100, description: 'Number of cards to generate. Capped at `gift_card_batch_limit`.' },- expires_at: { type: :string, example: '2030-12-31', nullable: true }- }- }+ request_body_forresponse '201', 'gift card batch created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/gift_cards_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/gift_cards_spec.rbindex 76656223ad..6e4b5346ff 100644--- a/spree/api/spec/integration/spree/api/v3/admin/gift_cards_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/gift_cards_spec.rb@@ -74,17 +74,7 @@ RSpec.describe 'Admin Gift Cards API', type: :request, swagger_doc: 'api-referenparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[amount],- properties: {- amount: { type: :string, example: '25.00', description: 'Decimal amount, greater than zero.' },- currency: { type: :string, example: 'USD', description: 'ISO 4217 currency code. Defaults to the store currency.' },- code: { type: :string, example: 'WELCOME50', description: 'Optional caller-supplied code. Auto-generated when omitted.' },- expires_at: { type: :string, example: '2030-12-31', description: 'ISO 8601 date.', nullable: true },- customer_id: { type: :string, example: 'cus_UkLWZg9DAJ', description: 'Optional customer prefixed ID.', nullable: true }- }- }+ request_body_forresponse '201', 'gift card created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -164,14 +154,7 @@ RSpec.describe 'Admin Gift Cards API', type: :request, swagger_doc: 'api-referenparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :string, example: '75.00' },- expires_at: { type: :string, example: '2031-12-31', nullable: true },- customer_id: { type: :string, example: 'cus_UkLWZg9DAJ', nullable: true }- }- }+ request_body_forresponse '200', 'gift card updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/imports_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/imports_spec.rbindex cf4e6ca289..73ab9a7154 100644--- a/spree/api/spec/integration/spree/api/v3/admin/imports_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/imports_spec.rb@@ -60,47 +60,7 @@ RSpec.describe 'Admin Imports API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[type attachment_signed_id],- properties: {- type: {- type: :string,- enum: %w[- products- customers- product_translations- price_list_prices- purchase_orders- ],- example: 'products'- },- price_list_id: {- type: :string,- description: 'For `price_list_prices` imports: the price list the rows are merged into. ' \- 'Must belong to the current store.',- example: 'pl_86Rf07xd4z'- },- attachment_signed_id: {- type: :string,- description: 'The `signed_id` returned by POST /api/v3/admin/files.',- example: 'eyJfcmFpbHMiOnsiZGF0YSI6MX0=--signed'- },- delimiter: {- type: :string,- enum: [',', ';', '|', "\t"],- description: 'CSV column separator. Defaults to a comma.',- example: ','- },- 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.',- example: 'https://admin.example.com/store_abc/settings/imports'- }- }- }+ request_body_forresponse '201', 'import created in mapping state' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -281,23 +241,7 @@ RSpec.describe 'Admin Imports API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- mappings: {- type: :array,- description: 'Column assignments to apply before starting. `file_column: null` unmaps a field.',- items: {- type: :object,- required: %w[schema_field],- properties: {- schema_field: { type: :string, example: 'slug' },- file_column: { type: :string, nullable: true, example: 'Product Handle' }- }- }- }- }- }+ request_body_for(required: false)response '200', 'mapping completed, processing queued' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/integrations_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/integrations_spec.rbindex f35f26aa14..0933ca7250 100644--- a/spree/api/spec/integration/spree/api/v3/admin/integrations_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/integrations_spec.rb@@ -66,15 +66,7 @@ RSpec.describe 'Admin Integrations API', type: :request, swagger_doc: 'api-referparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- type: { type: :string, example: 'carrier', description: 'Wire shorthand from GET /integrations/types' },- active: { type: :boolean, example: false },- preferences: { type: :object, example: { api_key: 'sk-secret', account_number: '42' } }- },- required: %w[type]- }+ request_body_forresponse '201', 'integration connected' dolet(:body) { { type: 'carrier', preferences: { api_key: 'sk-secret' } } }@@ -111,6 +103,35 @@ RSpec.describe 'Admin Integrations API', type: :request, swagger_doc: 'api-referendend+ path '/api/v3/admin/integrations/{id}' do+ patch 'Update integration' do+ tags 'Integrations'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Changes an integration\'s credentials or turns it on or off. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.'+ admin_scope :write, :integrations++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :id, in: :path, type: :string+ request_body_for++ response '200', 'integration updated' do+ let(:id) do+ SpreeCarrier::Integration.create!(store: store, preferences: { api_key: 'sk-secret' }).prefixed_id+ end+ let(:body) { { active: true, preferences: { account_number: 'demo-0001' } } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['active']).to be true+ expect(data['preferences']['account_number']).to eq('demo-0001')+ end+ end+ end+ end+path '/api/v3/admin/integrations/{id}/test' dopost 'Test integration connection' dotags 'Integrations'diff --git a/spree/api/spec/integration/spree/api/v3/admin/invitations_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/invitations_spec.rbindex 076cc80be1..f82c6893d1 100644--- a/spree/api/spec/integration/spree/api/v3/admin/invitations_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/invitations_spec.rb@@ -49,14 +49,7 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refereparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[email role_id],- properties: {- email: { type: :string, example: '[email protected]' },- role_id: { type: :string, example: 'role_xxx' }- }- }+ request_body_forresponse '201', 'invitation created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -147,4 +140,61 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refereendendend++ path '/api/v3/admin/auth/invitations/{id}/accept' do+ parameter name: :id, in: :path, type: :string, description: 'Invitation ID from the emailed link'++ let(:staff_invitation) do+ create(:invitation, resource: store, role: admin_role, inviter: admin_user, email: '[email protected]')+ end++ post 'Accept an invitation' do+ tags 'Authentication'+ consumes 'application/json'+ produces 'application/json'+ description <<~DESC+ Accepts a staff invitation and returns a signed-in admin session, so the+ new member lands in the dashboard rather than on a login form.++ Unauthenticated — the ID and token in the emailed link are the+ credential. The email is never taken from the request; it always comes+ from the invitation.++ `password` is required when no account exists for the invited address,+ in which case it sets one. When an account already exists, the same+ field is how the person proves the account is theirs.+ DESC++ parameter name: :token, in: :query, type: :string, required: true,+ description: 'The token from the emailed link'+ request_body_for++ response '200', 'invitation accepted, session issued' do+ let(:id) { staff_invitation.prefixed_id }+ let(:token) { staff_invitation.token }+ let(:body) do+ { password: 'password123', password_confirmation: 'password123', first_name: 'Robin', last_name: 'Ellis' }+ end++ schema '$ref' => '#/components/schemas/AuthResponse'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['token']).to be_present+ expect(data['user']['email']).to eq('[email protected]')+ expect(staff_invitation.reload.status).to eq('accepted')+ end+ end++ response '404', 'wrong token, or an invitation that can no longer be accepted' do+ let(:id) { staff_invitation.prefixed_id }+ let(:token) { 'not-the-token' }+ let(:body) { { password: 'password123', password_confirmation: 'password123' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rbindex 340918455a..f466152239 100644--- a/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb@@ -76,30 +76,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Europe' },- currency: { type: :string, example: 'EUR', description: 'ISO 4217 currency code.' },- default_locale: { type: :string, example: 'de', 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.',- example: %w[de en]- },- 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.',- example: %w[DE FR]- }- },- required: %w[name currency default_locale country_codes]- }+ request_body_forresponse '201', 'market created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -193,19 +170,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, 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 } }- }- }+ request_body_forresponse '200', 'market updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/me_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/me_spec.rbindex e25cc12938..e44c333016 100644--- a/spree/api/spec/integration/spree/api/v3/admin/me_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/me_spec.rb@@ -56,14 +56,7 @@ RSpec.describe 'Admin Me API', type: :request, swagger_doc: 'api-reference/adminparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- selected_locale: { type: :string, example: 'de' },- first_name: { type: :string, example: 'Ada' },- last_name: { type: :string, example: 'Lovelace' }- }- }+ request_body_forresponse '200', 'profile updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/media_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/media_spec.rbindex e59808bf2b..36c250a0ab 100644--- a/spree/api/spec/integration/spree/api/v3/admin/media_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/media_spec.rb@@ -57,15 +57,7 @@ RSpec.describe 'Admin Media Library API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- signed_id: { type: :string, description: 'The `signed_id` returned by POST /api/v3/admin/files.' },- alt: { type: :string, example: 'Folded on a table' },- media_type: { type: :string, enum: %w[image video external_video], example: 'image' },- external_video_url: { type: :string, description: 'YouTube or Vimeo link, for an external video.' }- }- }+ request_body_forresponse '201', 'file added' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -87,6 +79,36 @@ RSpec.describe 'Admin Media Library API', type: :request, swagger_doc: 'api-refeendend+ path '/api/v3/admin/media/{id}' do+ parameter name: :id, in: :path, type: :string, description: 'Media ID'++ patch 'Update a library file' do+ tags 'Media'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits a file in the library, such as its alt text.'+ admin_scope :write, :media++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'file updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { media.prefixed_id }+ let(:body) { { alt: 'Folded on a table' } }++ schema SwaggerSchemaHelpers.ref('Media')++ run_test! do |response|+ expect(JSON.parse(response.body)['alt']).to eq('Folded on a table')+ end+ end+ end+ end+path '/api/v3/admin/media/{id}/usage' doparameter name: :id, in: :path, type: :string, description: 'Media ID'@@ -185,15 +207,7 @@ RSpec.describe 'Admin Media Library API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- source_media_id: { type: :string, description: 'A media record already in the library.' },- alt: { type: :string, example: 'Front view' },- position: { type: :integer, example: 1 }- },- required: %w[source_media_id]- }+ request_body_forresponse '201', 'file placed' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -211,6 +225,42 @@ RSpec.describe 'Admin Media Library API', type: :request, swagger_doc: 'api-refeendend+ path '/api/v3/admin/products/{product_id}/media/{id}' do+ parameter name: :product_id, in: :path, type: :string, description: 'Product ID'+ parameter name: :id, in: :path, type: :string, description: 'Media ID'++ patch 'Update product media' do+ tags 'Media'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Edits a file placed on a product: its alt text, position and focal+ point, and which of the product's variants it shows for+ (`variant_ids`).+ DESC+ 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,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'media updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:product_id) { product.prefixed_id }+ let(:id) { media.prefixed_id }+ let(:body) { { alt: 'Side view', position: 1 } }++ schema SwaggerSchemaHelpers.ref('Media')++ run_test! do |response|+ expect(JSON.parse(response.body)['alt']).to eq('Side view')+ end+ end+ end+ end+path '/api/v3/admin/products/{product_id}/variants/{variant_id}/media' doparameter name: :product_id, in: :path, type: :string, description: 'Product ID'parameter name: :variant_id, in: :path, type: :string, description: 'Variant ID'diff --git a/spree/api/spec/integration/spree/api/v3/admin/option_types_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/option_types_spec.rbindex f18bab4bfd..8c9c3f2c5a 100644--- a/spree/api/spec/integration/spree/api/v3/admin/option_types_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/option_types_spec.rb@@ -68,27 +68,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-referparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'color' },- label: { type: :string, example: 'Color' },- position: { type: :integer, example: 1 },- filterable: { type: :boolean, example: true },- option_values: {- type: :array,- items: {- type: :object,- properties: {- name: { type: :string, example: 'red' },- label: { type: :string, example: 'Red' },- position: { type: :integer }- }- }- }- },- required: %w[name label]- }+ request_body_forresponse '201', 'option type created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -169,27 +149,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-referparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true, description: 'Option type ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'color' },- label: { type: :string, example: 'Color' },- position: { type: :integer, example: 1 },- filterable: { type: :boolean, example: true },- option_values: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :string, description: 'Existing option value ID to update' },- name: { type: :string, example: 'red' },- label: { type: :string, example: 'Red' },- position: { type: :integer }- }- }- }- }- }+ request_body_forresponse '200', 'option type updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/order_adjustment_lines_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/order_adjustment_lines_spec.rbindex ac99bde3cb..2c8f2933be 100644--- a/spree/api/spec/integration/spree/api/v3/admin/order_adjustment_lines_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/order_adjustment_lines_spec.rb@@ -75,16 +75,7 @@ RSpec.describe 'Admin Order Adjustment Lines API', type: :request, swagger_doc:parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- label: { type: :string, example: 'Customer appeasement' },- value: { type: :string, example: '10.00' },- value_type: { type: :string, enum: %w[flat percent], example: 'flat' },- line_item_id: { type: :string, nullable: true, example: 'item_abc123', description: 'Target line item; omit to distribute order-level' }- },- required: %w[label value]- }+ request_body_forresponse '201', 'discount created' dolet(:body) { { label: 'Appeasement', value: '3.00', value_type: 'flat', line_item_id: line_item.prefixed_id } }@@ -103,6 +94,35 @@ RSpec.describe 'Admin Order Adjustment Lines API', type: :request, swagger_doc:endend+ path '/api/v3/admin/orders/{order_id}/discounts/{id}' do+ patch 'Update manual discount' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits the label or amount of a manual discount and re-sums the order totals. Promotion-sourced rows are owned by recalculation and respond 422.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Discount prefixed ID'+ request_body_for++ response '200', 'discount updated' do+ let(:discount) { create(:discount, order: order, line_item: line_item, amount: -2, label: 'Loyalty', kind: 'manual') }+ let(:id) { discount.prefixed_id }+ let(:body) { { label: 'Loyalty reward', amount: '-5.00' } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['label']).to eq('Loyalty reward')+ expect(data['amount']).to eq('-5.00')+ end+ end+ end+ end+path '/api/v3/admin/orders/{order_id}/fees' doget 'List fees' dotags 'Orders'@@ -141,17 +161,7 @@ RSpec.describe 'Admin Order Adjustment Lines API', type: :request, swagger_doc:parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- label: { type: :string, example: 'Gift wrap' },- amount: { type: :string, example: '4.00' },- kind: { type: :string, enum: Spree::Fee::KINDS, example: 'gift_wrap', description: "Defaults to 'surcharge'" },- line_item_id: { type: :string, nullable: true },- fulfillment_id: { type: :string, nullable: true }- },- required: %w[label amount]- }+ request_body_forresponse '201', 'fee created' dolet(:body) { { label: 'Gift wrap', amount: '4.00', kind: 'gift_wrap' } }@@ -170,4 +180,33 @@ RSpec.describe 'Admin Order Adjustment Lines API', type: :request, swagger_doc:endendend++ path '/api/v3/admin/orders/{order_id}/fees/{id}' do+ patch 'Update fee' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits the label, amount or kind of a fee and re-sums the order totals. Works on completed orders.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Fee prefixed ID'+ request_body_for++ response '200', 'fee updated' do+ let(:fee) { create(:fee, order: order, label: 'Handling', kind: 'handling', amount: '5.00') }+ let(:id) { fee.prefixed_id }+ let(:body) { { amount: '8.00' } }++ schema '$ref' => '#/components/schemas/Fee'++ run_test! do |response|+ expect(JSON.parse(response.body)['amount']).to eq('8.00')+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/order_cancellation_reasons_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/order_cancellation_reasons_spec.rbindex e38a6873c2..9c20dfaa00 100644--- a/spree/api/spec/integration/spree/api/v3/admin/order_cancellation_reasons_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/order_cancellation_reasons_spec.rb@@ -65,14 +65,7 @@ RSpec.describe 'Admin Order Cancellation Reasons API', type: :request, swagger_dparameter 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: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Out of stock' },- active: { type: :boolean, example: true, description: 'Inactive reasons are hidden from the pickers on new records.' }- }- }+ request_body_forresponse '201', 'order cancellation reason created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -149,13 +142,7 @@ RSpec.describe 'Admin Order Cancellation Reasons API', type: :request, swagger_dparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- active: { type: :boolean }- }- }+ request_body_forresponse '200', 'order cancellation reason updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/order_routing_rules_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/order_routing_rules_spec.rbindex 9d4d2c970e..0f2fb9eb0a 100644--- a/spree/api/spec/integration/spree/api/v3/admin/order_routing_rules_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/order_routing_rules_spec.rb@@ -47,16 +47,7 @@ RSpec.describe 'Admin Order Routing Rules API', type: :request, swagger_doc: 'apparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- type: { type: :string, example: 'preferred_location' },- active: { type: :boolean },- position: { type: :integer },- preferences: { type: :object, additionalProperties: true }- },- required: ['type']- }+ request_body_forresponse '201', 'rule created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -101,14 +92,7 @@ RSpec.describe 'Admin Order Routing Rules API', type: :request, swagger_doc: 'apparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- active: { type: :boolean },- position: { type: :integer },- preferences: { type: :object, additionalProperties: true }- }- }+ request_body_forresponse '200', 'rule updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/deliveries_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/deliveries_spec.rbindex 5757cc81f2..413852aaef 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/deliveries_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/deliveries_spec.rb@@ -54,16 +54,7 @@ RSpec.describe 'Admin Deliveries API', type: :request, swagger_doc: 'api-referendescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order ID'parameter name: :fulfillment_id, in: :path, type: :string, required: true, description: 'Fulfillment ID'- parameter name: :body, in: :body, required: true, schema: {- type: :object,- required: %w[tracking_number],- properties: {- tracking_number: { type: :string, description: 'Carrier tracking number, freight PRO number, or a full tracking link' },- carrier: { type: :string, description: 'Free-text carrier; detected from the number when omitted' },- service: { type: :string, description: 'Carrier service' },- tracking_url: { type: :string, description: 'Tracking page for this consignment' }- }- }+ request_body_forresponse '201', 'delivery recorded' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -104,15 +95,7 @@ RSpec.describe 'Admin Deliveries API', type: :request, swagger_doc: 'api-referenparameter name: :order_id, in: :path, type: :string, required: true, description: 'Order ID'parameter name: :fulfillment_id, in: :path, type: :string, required: true, description: 'Fulfillment ID'parameter name: :id, in: :path, type: :string, required: true, description: 'Delivery ID'- parameter name: :body, in: :body, required: true, schema: {- type: :object,- properties: {- tracking_number: { type: :string },- carrier: { type: :string },- service: { type: :string },- tracking_url: { type: :string }- }- }+ request_body_forresponse '200', 'delivery updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -164,13 +147,7 @@ RSpec.describe 'Admin Deliveries API', type: :request, swagger_doc: 'api-referenparameter name: :order_id, in: :path, type: :string, required: true, description: 'Order ID'parameter name: :fulfillment_id, in: :path, type: :string, required: true, description: 'Fulfillment ID'parameter name: :id, in: :path, type: :string, required: true, description: 'Delivery ID'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- delivered_at: { type: :string, format: 'date-time', description: 'When it arrived. Defaults to now.' },- notify_customer: { type: :boolean, description: 'Whether the customer gets a delivery notification when the parcel completes.' }- }- }+ request_body_forresponse '200', 'delivery marked delivered' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/discount_codes_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/discount_codes_spec.rbnew file mode 100644index 0000000000..75ec9fa179--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/discount_codes_spec.rb@@ -0,0 +1,49 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Admin Order Discount Codes API', type: :request, swagger_doc: 'api-reference/admin.yaml' do+ include_context 'API v3 Admin'++ let!(:order) { create(:order_with_line_items, store: store, line_items_price: 50) }+ let!(:promotion) do+ create(:promotion_with_item_total_rule, :with_line_item_adjustment,+ code: 'save5', kind: :coupon_code, store: store,+ item_total_threshold_amount: 30, adjustment_rate: 5)+ end+ let(:Authorization) { "Bearer #{admin_jwt_token}" }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }++ path '/api/v3/admin/orders/{order_id}/discount_codes' do+ let(:order_id) { order.prefixed_id }++ post 'Apply a discount code' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Applies a discount code to a draft order and returns the order. A real code the order does not yet qualify for is kept and applies once it does. ' \+ 'Completed orders refuse codes; change their discounts through manual discounts instead.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ request_body_for++ response '201', 'discount code applied' do+ let(:body) { { code: 'SAVE5' } }++ run_test! do |response|+ expect(JSON.parse(response.body)['coupon_code']).to eq('save5')+ end+ end++ response '422', 'unknown discount code' do+ let(:body) { { code: 'bogus' } }++ run_test!+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/fulfillments_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/fulfillments_spec.rbindex d12bebc4be..50ab389ba6 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/fulfillments_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/fulfillments_spec.rb@@ -66,36 +66,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apidescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[stock_location_id],- properties: {- stock_location_id: { type: :string, description: 'Stock location the fulfillment ships from' },- source_fulfillment_id: { type: :string,- description: "The only fulfillment of this order to move units from, its exchange and claim replacements included. Omit to take the customer's bought units from every unshipped fulfillment" },- tracking: { type: :string, example: 'INPOST-12345',- 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, example: '7.42',- 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: %w[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: %w[item_id quantity],- properties: {- item_id: { type: :string, description: 'Line item ID' },- quantity: { type: :integer, example: 1 }- }- }- },- metadata: { type: :object, additionalProperties: true }- }- }+ request_body_forresponse '201', 'fulfillment created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -182,14 +153,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apidescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Fulfillment ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- tracking: { type: :string, example: '1Z999AA10123456784',- 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' }- }- }+ request_body_forresponse '200', 'shipment updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -206,6 +170,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apipath '/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill' dopatch 'Fulfill a fulfillment' dotags 'Fulfillments'+ consumes 'application/json'produces 'application/json'security [{ api_key: [], bearer_auth: [] }]description 'Marks a fulfillment as fulfilled.'@@ -220,11 +185,13 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apidescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Fulfillment ID'+ request_body_for(required: false)response '200', 'fulfillment fulfilled' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:order_id) { order.prefixed_id }let(:id) { shipment.prefixed_id }+ let(:body) { { tracking: '1Z999AA10123456784', notify_customer: false } }before doshipment.update!(status: 'unfulfilled')@@ -233,6 +200,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apirun_test! do |response|data = JSON.parse(response.body)expect(data['status']).to eq('fulfilled')+ expect(data['tracking']).to eq('1Z999AA10123456784')endendend@@ -256,20 +224,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apidescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Fulfillment ID'- parameter name: :body, in: :body, required: false, 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.'- }- }- }+ request_body_forresponse '200', 'fulfillment delivered' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -346,15 +301,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'apidescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Fulfillment ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[variant_id quantity],- properties: {- variant_id: { type: :string, description: 'Variant ID' },- quantity: { type: :integer, example: 1 },- stock_location_id: { type: :string, description: 'Target stock location ID' }- }- }+ request_body_forresponse '200', 'fulfillment split' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/gift_cards_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/gift_cards_spec.rbindex 6a3ca5a724..9114bbdd79 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/gift_cards_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/gift_cards_spec.rb@@ -28,13 +28,7 @@ RSpec.describe 'Admin Order Gift Cards API', type: :request, swagger_doc: 'api-rdescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[code],- properties: {- code: { type: :string, description: 'Gift card code', example: 'GIFT-XXXX-YYYY' }- }- }+ request_body_forresponse '201', 'gift card applied' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/items_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/items_spec.rbindex 13cead4b12..582610bb8c 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/items_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/items_spec.rb@@ -60,14 +60,7 @@ RSpec.describe 'Admin Order Line Items API', type: :request, swagger_doc: 'api-rdescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[variant_id],- properties: {- variant_id: { type: :string, description: 'Prefixed variant ID' },- quantity: { type: :integer, default: 1 }- }- }+ request_body_forresponse '201', 'item added' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -134,12 +127,7 @@ RSpec.describe 'Admin Order Line Items API', type: :request, swagger_doc: 'api-rdescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Item ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- quantity: { type: :integer }- }- }+ request_body_forresponse '200', 'item updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/labels_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/labels_spec.rbindex 4e57fdac24..3b267ec4ba 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/labels_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/labels_spec.rb@@ -63,19 +63,7 @@ RSpec.describe 'Admin Shipping Labels API', type: :request, swagger_doc: 'api-redescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order ID'parameter name: :fulfillment_id, in: :path, type: :string, required: true, description: 'Fulfillment ID'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- file: { type: :string, description: 'Signed blob id of an uploaded label file; its presence records rather than buys' },- tracking_number: { type: :string, description: 'Number printed on an uploaded label' },- carrier: { type: :string, description: 'Free-text carrier; detected from the number when omitted' },- service: { type: :string, description: 'Carrier service the label was bought at' },- cost: { type: :string, description: 'What the merchant paid the carrier' },- currency: { type: :string, description: 'Currency of the cost' },- file_format: { type: :string, enum: %w[pdf png zpl], description: 'Label file format; taken from the file when omitted' },- tracking_url: { type: :string, description: 'Tracking page for the consignment' }- }- }+ request_body_forresponse '201', 'label purchased' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/payments_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/payments_spec.rbindex 364cb17e1b..d03746b249 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/payments_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/payments_spec.rb@@ -58,15 +58,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-refdescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[payment_method_id],- properties: {- payment_method_id: { type: :string, description: 'Payment method ID' },- amount: { type: :string, example: '99.99' },- source_id: { type: :string, description: 'Payment source ID' }- }- }+ request_body_forresponse '201', 'payment created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -122,9 +114,10 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-refpath '/api/v3/admin/orders/{order_id}/payments/{id}/capture' dopatch 'Capture a payment' dotags 'Payments'+ consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Captures a pending payment.'+ description 'Captures a pending payment, in full or for part of the authorized amount.'admin_scope :write, :paymentsadmin_sdk_example 'order-payments/capture'@@ -136,11 +129,13 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-refdescription: 'Order ID'parameter name: :id, in: :path, type: :string, required: true,description: 'Payment ID'+ request_body_for(required: false)response '200', 'payment captured' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:order_id) { order.prefixed_id }let(:id) { payment.prefixed_id }+ let(:body) { { amount: Spree::Money::Rounding.format(payment.amount, payment.currency) } }before dopayment.update_column(:status, 'pending') if payment.status != 'pending'@@ -158,6 +153,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-reflet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:order_id) { order.prefixed_id }let(:id) { payment.prefixed_id }+ let(:body) { {} }before do# Bogus gateway forces a failure when the authorization doesn't start with `BGS-`.diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/refunds_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/refunds_spec.rbindex e2c79fa4d9..c3c65a8ef1 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/refunds_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/refunds_spec.rb@@ -58,15 +58,7 @@ RSpec.describe 'Admin Order Refunds API', type: :request, swagger_doc: 'api-refedescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[payment_id amount],- properties: {- payment_id: { type: :string, description: 'Payment ID' },- amount: { type: :string, example: '10.00' },- refund_reason_id: { type: :string, description: 'Refund reason ID' }- }- }+ request_body_forresponse '201', 'refund created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders/store_credits_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders/store_credits_spec.rbindex 82f828bb72..ddb641383b 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders/store_credits_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders/store_credits_spec.rb@@ -30,12 +30,7 @@ RSpec.describe 'Admin Order Store Credits API', type: :request, swagger_doc: 'apdescription: 'Bearer token for admin authentication'parameter name: :order_id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :string, description: 'Optional explicit amount; defaults to order outstanding balance' }- }- }+ request_body_forresponse '201', 'store credit applied' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/orders_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/orders_spec.rbindex 49d648188f..1b3a58ce41 100644--- a/spree/api/spec/integration/spree/api/v3/admin/orders_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/orders_spec.rb@@ -76,58 +76,7 @@ RSpec.describe 'Admin Orders API', type: :request, swagger_doc: 'api-reference/aparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, example: '[email protected]' },- customer_id: { type: :string, description: 'Customer ID.' },- 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, example: 'USD' },- 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, example: 'en-US' },- 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: %w[variant_id quantity],- properties: {- variant_id: { type: :string, description: 'Variant ID' },- quantity: { type: :integer, example: 1 },- metadata: { type: :object }- }- }- },- coupon_code: { type: :string, description: 'Optional. Applied non-fatally; invalid codes do not block creation.' }- }- }+ request_body_forresponse '201', 'order created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -213,57 +162,7 @@ RSpec.describe 'Admin Orders API', type: :request, swagger_doc: 'api-reference/adescription: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, 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: %w[variant_id],- properties: {- variant_id: { type: :string, description: 'Variant ID' },- quantity: { type: :integer, example: 1 },- metadata: { type: :object }- }- }- }- }- }+ request_body_forresponse '200', 'order updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -322,12 +221,7 @@ RSpec.describe 'Admin Orders API', type: :request, swagger_doc: 'api-reference/adescription: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- notify_customer: { type: :boolean, description: 'Send the order confirmation email after completion.' }- }- }+ request_body_forresponse '200', 'order completed' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -384,16 +278,7 @@ RSpec.describe 'Admin Orders API', type: :request, swagger_doc: 'api-reference/adescription: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true,description: 'Order ID'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- cancel_reason_id: { type: :string, description: "Why the order was canceled — the id of one of the store's cancellation reasons." },- cancel_note: { type: :string, description: 'Staff-facing note about the cancellation.' },- refund_payments: { type: :boolean, default: false, description: "Whether this order's share of a payment shared across a split checkout is handed back." },- refund_amount: { type: :string, description: "How much of that share to return. Defaults to all of it; refused on an order whose payment is not shared." },- notify_customer: { type: :boolean, default: false, description: 'Send the order cancellation email after canceling.' }- }- }+ request_body_forresponse '200', 'order canceled' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/package_types_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/package_types_spec.rbindex 561b8ec79f..42296f0471 100644--- a/spree/api/spec/integration/spree/api/v3/admin/package_types_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/package_types_spec.rb@@ -82,22 +82,7 @@ RSpec.describe 'Admin Package Types API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Euro pallet' },- kind: { type: :string, enum: Spree::PackageType::KINDS, example: 'pallet' },- length: { type: :number, example: 120 },- width: { type: :number, example: 80 },- height: { type: :number, example: 15 },- dimensions_unit: { type: :string, enum: Spree::Variant::DIMENSION_UNITS, example: 'cm' },- weight: { type: :number, example: 25 },- max_weight: { type: :number, example: 1500 },- weight_unit: { type: :string, enum: Spree::Variant::WEIGHT_UNITS, example: 'kg' },- default: { type: :boolean, example: false }- },- required: %w[name kind]- }+ request_body_forresponse '201', 'package type created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -176,21 +161,7 @@ RSpec.describe 'Admin Package Types API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Euro pallet' },- kind: { type: :string, enum: Spree::PackageType::KINDS, example: 'pallet' },- length: { type: :number, example: 120 },- width: { type: :number, example: 80 },- height: { type: :number, example: 15 },- dimensions_unit: { type: :string, enum: Spree::Variant::DIMENSION_UNITS, example: 'cm' },- weight: { type: :number, example: 25 },- max_weight: { type: :number, example: 1500 },- weight_unit: { type: :string, enum: Spree::Variant::WEIGHT_UNITS, example: 'kg' },- default: { type: :boolean, example: false }- }- }+ request_body_forresponse '200', 'package type updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/password_resets_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/password_resets_spec.rbindex 00256b4c1c..3c5dc9970e 100644--- a/spree/api/spec/integration/spree/api/v3/admin/password_resets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/password_resets_spec.rb@@ -29,18 +29,7 @@ RSpec.describe 'Admin Password Resets API', type: :request, swagger_doc: 'api-readmin_sdk_example 'auth/request-password-reset'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- redirect_url: {- type: :string,- example: 'https://admin.your-store.com/reset-password',- description: 'Honoured only on the dashboard origin, for an account that is staff of the store; ignored otherwise.'- }- },- required: %w[email]- }+ request_body_forresponse '202', 'reset requested' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -72,14 +61,7 @@ RSpec.describe 'Admin Password Resets API', type: :request, swagger_doc: 'api-reparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, description: 'The reset token from the emailed link'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- password: { type: :string, example: 'new-password-123' },- password_confirmation: { type: :string, example: 'new-password-123' }- },- required: %w[password password_confirmation]- }+ request_body_forresponse '200', 'password reset' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/payment_methods_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/payment_methods_spec.rbindex d3fd211903..6190864288 100644--- a/spree/api/spec/integration/spree/api/v3/admin/payment_methods_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/payment_methods_spec.rb@@ -35,6 +35,51 @@ RSpec.describe 'Admin Payment Methods API', type: :request, swagger_doc: 'api-reendendend+ post 'Create a payment method' do+ tags 'Payment Methods'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Adds a payment method to the store. `type` is a shorthand from the+ payment method types endpoint, and `preferences` takes the values its+ preference schema declares (gateway credentials among them).+ DESC+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '201', 'payment method created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) do+ {+ type: 'check',+ name: 'Bank transfer',+ description: 'Pay by bank transfer within 14 days.',+ active: true,+ storefront_visible: true,+ capture_method: 'manual'+ }+ end++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['type']).to eq('check')+ expect(data['name']).to eq('Bank transfer')+ end+ end++ response '422', 'unknown payment method type' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { type: 'not_a_provider', name: 'Mystery' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ endendpath '/api/v3/admin/payment_methods/types' do@@ -100,5 +145,29 @@ RSpec.describe 'Admin Payment Methods API', type: :request, swagger_doc: 'api-reendendend++ patch 'Update a payment method' do+ tags 'Payment Methods'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Updates a payment method. Its `type` is fixed once created.'+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true+ request_body_for++ response '200', 'payment method updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: 'Cheque', storefront_visible: false, position: 2 } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['name']).to eq('Cheque')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/policies_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/policies_spec.rbindex 46a3806212..f19f43a7a8 100644--- a/spree/api/spec/integration/spree/api/v3/admin/policies_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/policies_spec.rb@@ -79,15 +79,7 @@ RSpec.describe 'Admin Policies API', type: :request, swagger_doc: 'api-referenceparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Wholesale Policy' },- slug: { type: :string, example: 'wholesale-policy' },- body: { type: :string, example: '<p>Trade orders ship within five working days.</p>' }- },- required: %w[name]- }+ request_body_forresponse '201', 'policy created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -167,14 +159,7 @@ RSpec.describe 'Admin Policies API', type: :request, swagger_doc: 'api-referenceparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- slug: { type: :string },- body: { type: :string }- }- }+ request_body_forresponse '200', 'policy updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --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 9d6e6d704f..9d8603a711 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@@ -51,50 +51,7 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'EU wholesale' },- description: { type: :string, nullable: true },- starts_at: { type: :string, nullable: true, example: '2026-06-01T00:00:00Z' },- ends_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 },- 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: %w[type],- properties: {- type: { type: :string, example: 'volume_rule' },- 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: %w[variant_id currency],- properties: {- variant_id: { type: :string, example: 'variant_xY9' },- currency: { type: :string, example: 'USD' },- amount: { type: :string, nullable: true, example: '19.99' },- compare_at_amount: { type: :string, nullable: true, example: '24.99' }- }- }- }- }- }+ request_body_forresponse '201', 'price list created (one-shot — metadata, schedule, rules)' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -252,49 +209,7 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, 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: %w[all any] },- position: { type: :integer },- rules: {- type: :array,- items: {- type: :object,- required: %w[type],- properties: {- id: { type: :string, nullable: true },- type: { type: :string, example: 'volume_rule' },- 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: %w[id] },- { required: %w[variant_id currency] }- ],- properties: {- id: { type: :string, example: 'price_aBc123' },- variant_id: { type: :string, example: 'variant_xY9' },- currency: { type: :string, example: 'USD' },- amount: { type: :string, nullable: true, example: '12.50' },- compare_at_amount: { type: :string, nullable: true, example: '15.00' }- }- }- }- }- }+ request_body_forresponse '200', 'price list updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -508,11 +423,7 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter 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]- }+ request_body_forresponse '201', 'products added' dolet!(:product) { create(:product, store: store) }@@ -537,11 +448,7 @@ RSpec.describe 'Admin Price Lists API', type: :request, swagger_doc: 'api-refereparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter 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]- }+ request_body_forresponse '200', 'products removed' dolet!(:product) { create(:product, store: store) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/prices_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/prices_spec.rbindex 97d5ad5fbd..1f576a7c07 100644--- a/spree/api/spec/integration/spree/api/v3/admin/prices_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/prices_spec.rb@@ -69,17 +69,7 @@ RSpec.describe 'Admin Prices API', type: :request, swagger_doc: 'api-reference/aparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[variant_id currency],- properties: {- variant_id: { type: :string, example: 'variant_xY9' },- currency: { type: :string, example: 'USD' },- amount: { type: :string, nullable: true, example: '19.99' },- compare_at_amount: { type: :string, nullable: true, example: '24.99' },- price_list_id: { type: :string, nullable: true, example: 'pl_aBc123' }- }- }+ request_body_forresponse '201', 'price created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -150,13 +140,7 @@ RSpec.describe 'Admin Prices API', type: :request, swagger_doc: 'api-reference/aparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :string, nullable: true },- compare_at_amount: { type: :string, nullable: true }- }- }+ request_body_forresponse '200', 'price updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -217,27 +201,7 @@ RSpec.describe 'Admin Prices API', type: :request, swagger_doc: 'api-reference/aparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[prices],- properties: {- prices: {- type: :array,- items: {- type: :object,- required: %w[variant_id currency],- properties: {- id: { type: :string, nullable: true, example: 'price_aBc123' },- variant_id: { type: :string, example: 'variant_xY9' },- currency: { type: :string, example: 'USD' },- price_list_id: { type: :string, nullable: true, example: 'pl_aBc123' },- amount: { type: :string, nullable: true, example: '19.99' },- compare_at_amount: { type: :string, nullable: true, example: '24.99' }- }- }- }- }- }+ request_body_forresponse '200', 'prices upserted' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -297,13 +261,7 @@ RSpec.describe 'Admin Prices API', type: :request, swagger_doc: 'api-reference/aparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids],- properties: {- ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'prices deleted' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rbindex 5e557ff49d..742133fb1b 100644--- a/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb@@ -69,40 +69,7 @@ RSpec.describe 'Admin Product Types API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Hoodie' },- delivery_profile_id: {- type: :string,- nullable: true,- example: 'fp_86Rf07xd4z',- description: 'Fulfillment profile stamped onto products created with this type. Null leaves new products on the store default profile.'- },- option_type_ids: {- type: :array,- 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']- }+ request_body_forresponse '201', 'product type created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -180,26 +147,7 @@ RSpec.describe 'Admin Product Types API', type: :request, swagger_doc: 'api-refeparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Premium T-Shirt' },- 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 }- }- }- }- }- }+ request_body_forresponse '200', 'product type updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/products/custom_fields_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/products/custom_fields_spec.rbindex 86329a126e..24409d2180 100644--- a/spree/api/spec/integration/spree/api/v3/admin/products/custom_fields_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/products/custom_fields_spec.rb@@ -59,14 +59,7 @@ RSpec.describe 'Admin Product Custom Fields API', type: :request, swagger_doc: 'parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :product_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[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`' }- }- }+ request_body_forresponse '201', 'custom field created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -142,11 +135,7 @@ RSpec.describe 'Admin Product Custom Fields API', type: :request, swagger_doc: 'parameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :product_id, in: :path, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[value],- properties: { value: { description: 'New value' } }- }+ request_body_forresponse '200', 'custom field updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/products/digital_assets_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/products/digital_assets_spec.rbindex b470f310b8..ce9eadbf08 100644--- a/spree/api/spec/integration/spree/api/v3/admin/products/digital_assets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/products/digital_assets_spec.rb@@ -38,5 +38,85 @@ RSpec.describe 'Admin Product Digital Assets API', type: :request, swagger_doc:endendend++ post 'Create a product digital asset' do+ tags 'Products'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Attaches a downloadable file to one of the product's variants (the+ default variant when `variant_id` is omitted). Upload the file first+ through `POST /api/v3/admin/files` with `visibility: 'private'`, then+ send its `signed_id` here. A provider-backed asset sends+ `provider_type` and `provider_settings` instead of a file.+ DESC+ 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,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '201', 'digital asset created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:product_id) { product.prefixed_id }+ let(:blob) do+ ActiveStorage::Blob.create_and_upload!(+ io: File.open(Spree::Core::Engine.root.join('spec', 'fixtures', 'thinking-cat.jpg')),+ filename: 'manual.pdf',+ content_type: 'application/pdf',+ service_name: Spree.private_storage_service_name+ )+ end+ let(:body) { { signed_id: blob.signed_id, authorized_clicks: 5, authorized_days: 30 } }++ schema '$ref' => '#/components/schemas/DigitalAsset'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['authorized_clicks']).to eq(5)+ expect(data['authorized_days']).to eq(30)+ end+ end+ end+ end++ path '/api/v3/admin/products/{product_id}/digital_assets/{id}' do+ parameter name: :product_id, in: :path, type: :string, required: true, description: 'Product ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Digital asset ID'++ patch 'Update a product digital asset' do+ tags 'Products'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Changes an asset's download limits, or replaces its file with a new+ private `signed_id`. Links customers already received keep working and+ serve the new file.+ DESC+ 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,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'digital asset updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:product_id) { product.prefixed_id }+ let(:id) { digital_asset.prefixed_id }+ let(:body) { { authorized_clicks: 10, authorized_days: nil } }++ schema '$ref' => '#/components/schemas/DigitalAsset'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['authorized_clicks']).to eq(10)+ expect(data['authorized_days']).to be_nil+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/products_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/products_spec.rbindex 67ff28c9f6..a4e6071ee8 100644--- a/spree/api/spec/integration/spree/api/v3/admin/products_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/products_spec.rb@@ -71,80 +71,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Premium T-Shirt' },- description: { type: :string },- slug: { type: :string },- status: { type: :string, enum: %w[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 }, example: %w[eco sale] },- 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: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- 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: %w[name value],- properties: {- name: { type: :string, example: 'size' },- value: { type: :string, example: 'Small' }- }- }- },- prices: {- type: :array,- description: 'Per-currency prices. Upserted by currency.',- items: {- type: :object,- required: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- stock_levels: {- type: :array,- description: 'Per-stock-location inventory. Upserted by stock_location_id.',- items: {- type: :object,- required: %w[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, example: 50 },- backorderable: { type: :boolean }- }- }- }- }- }- }- },- required: %w[name]- }+ request_body_forresponse '201', 'product created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -224,79 +151,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :id, in: :path, type: :string, required: true, description: 'Product ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Premium T-Shirt' },- description: { type: :string },- slug: { type: :string },- status: { type: :string, enum: %w[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 }, example: %w[eco sale] },- 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: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- 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: %w[name value],- properties: {- name: { type: :string, example: 'size' },- value: { type: :string, example: 'Small' }- }- }- },- prices: {- type: :array,- description: 'Per-currency prices. Upserted by currency.',- items: {- type: :object,- required: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- stock_levels: {- type: :array,- description: 'Per-stock-location inventory. Upserted by stock_location_id.',- items: {- type: :object,- required: %w[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, example: 50 },- backorderable: { type: :boolean }- }- }- }- }- }- }- }- }+ request_body_forresponse '200', 'product updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -386,14 +241,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids status],- properties: {- ids: { type: :array, items: { type: :string }, example: ['prod_UkLWZg9DAJ'] },- status: { type: :string, enum: %w[draft active archived], example: 'archived' }- }- }+ request_body_forresponse '200', 'products updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -450,14 +298,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids category_ids],- properties: {- ids: { type: :array, items: { type: :string } },- category_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products added to categories' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -491,14 +332,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids category_ids],- properties: {- ids: { type: :array, items: { type: :string } },- category_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products removed from categories' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -530,14 +364,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids collection_ids],- properties: {- ids: { type: :array, items: { type: :string } },- collection_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products added to collections' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -569,14 +396,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids collection_ids],- properties: {- ids: { type: :array, items: { type: :string } },- collection_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products removed from collections' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -611,14 +431,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids channel_ids],- properties: {- ids: { type: :array, items: { type: :string } },- channel_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products published on channels' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -652,14 +465,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids channel_ids],- properties: {- ids: { type: :array, items: { type: :string } },- channel_ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products unpublished from channels' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -696,14 +502,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids tags],- properties: {- ids: { type: :array, items: { type: :string } },- tags: { type: :array, items: { type: :string }, example: %w[summer sale] }- }- }+ request_body_forresponse '200', 'tags added' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -736,14 +535,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids tags],- properties: {- ids: { type: :array, items: { type: :string } },- tags: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'tags removed' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -773,13 +565,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[ids],- properties: {- ids: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'products deleted' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -797,4 +583,38 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-referenceendendend++ path '/api/v3/admin/products/{id}/reject' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Product ID'++ patch 'Reject a submitted product' do+ tags 'Products'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Turns down a product a seller submitted for review. The `reason` is+ sent back to the seller, who can fix the product and submit it again.+ DESC+ 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+ request_body_for++ response '200', 'product rejected' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:submitted) { create(:product, store: store, status: 'proposed') }+ let(:id) { submitted.prefixed_id }+ let(:body) { { reason: 'Photos are too dark' } }++ schema '$ref' => '#/components/schemas/Product'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('rejected')+ expect(submitted.reload.rejection_reason).to eq('Photos are too dark')+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/promotion_actions_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/promotion_actions_spec.rbindex 567d1dd31d..35e2018681 100644--- a/spree/api/spec/integration/spree/api/v3/admin/promotion_actions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/promotion_actions_spec.rb@@ -52,14 +52,7 @@ RSpec.describe 'Admin Promotion Actions API', type: :request, swagger_doc: 'api-parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- type: { type: :string, example: 'free_shipping' },- preferences: { type: :object, additionalProperties: true }- },- required: ['type']- }+ request_body_forresponse '201', 'action created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -90,6 +83,40 @@ RSpec.describe 'Admin Promotion Actions API', type: :request, swagger_doc: 'api-let(:action) { Spree::Promotion::Actions::FreeShipping.create!(promotion: promotion) }let(:id) { action.prefixed_id }+ patch 'Update an action on a promotion' do+ tags 'Promotions'+ produces 'application/json'+ consumes 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Changes an action's settings. For adjustment actions, `calculator`+ sets the calculator and its preferences; sending a different+ calculator `type` swaps it. The action's own `type` is fixed once+ created.+ DESC+ admin_scope :write, :promotions++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '200', 'action updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:action) do+ Spree::Promotion::Actions::CreateItemAdjustments.create!(+ promotion: promotion, calculator: Spree::Calculator::FlatRate.new(preferred_amount: 10)+ )+ end+ let(:body) { { calculator: { type: 'percent_on_line_item', preferences: { percent: '15' } } } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['type']).to eq('create_item_adjustments')+ expect(action.reload.calculator).to be_a(Spree::Calculator::PercentOnLineItem)+ end+ end+ end+delete 'Delete an action from a promotion' dotags 'Promotions'security [api_key: [], bearer_auth: []]diff --git a/spree/api/spec/integration/spree/api/v3/admin/promotion_rules_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/promotion_rules_spec.rbindex 3a0c6a492a..7a492aa6f4 100644--- a/spree/api/spec/integration/spree/api/v3/admin/promotion_rules_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/promotion_rules_spec.rb@@ -52,14 +52,7 @@ RSpec.describe 'Admin Promotion Rules API', type: :request, swagger_doc: 'api-reparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- type: { type: :string, example: 'currency' },- preferences: { type: :object, additionalProperties: true }- },- required: ['type']- }+ request_body_forresponse '201', 'rule created with preferences' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -101,10 +94,7 @@ RSpec.describe 'Admin Promotion Rules API', type: :request, swagger_doc: 'api-reparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: { preferences: { type: :object, additionalProperties: true } }- }+ request_body_forresponse '200', 'rule updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/promotions_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/promotions_spec.rbindex af4f844e1b..bfdd90b016 100644--- a/spree/api/spec/integration/spree/api/v3/admin/promotions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/promotions_spec.rb@@ -52,56 +52,7 @@ RSpec.describe 'Admin Promotions API', type: :request, swagger_doc: 'api-referenparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, 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: %w[all any] },- kind: { type: :string, enum: %w[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, example: 'currency' },- 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, example: 'free_shipping' },- preferences: { type: :object, additionalProperties: true },- calculator: {- type: :object,- properties: {- type: { type: :string, example: 'flat_percent_item_total' },- preferences: { type: :object, additionalProperties: true }- }- }- },- required: ['type']- }- }- },- required: ['name']- }+ request_body_forresponse '201', 'promotion created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -224,54 +175,7 @@ RSpec.describe 'Admin Promotions API', type: :request, swagger_doc: 'api-referenparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, 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: %w[all any] },- kind: { type: :string, enum: %w[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, example: 'currency' },- 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, example: 'free_shipping' },- preferences: { type: :object, additionalProperties: true },- calculator: {- type: :object,- properties: {- type: { type: :string, example: 'flat_percent_item_total' },- preferences: { type: :object, additionalProperties: true }- }- }- },- required: ['type']- }- }- }- }+ request_body_forresponse '200', 'promotion updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/purchase_orders_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/purchase_orders_spec.rbindex 006931356b..bb56389253 100644--- a/spree/api/spec/integration/spree/api/v3/admin/purchase_orders_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/purchase_orders_spec.rb@@ -96,35 +96,11 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reparameter 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: :purchase_order, in: :body, required: true, schema: {- type: :object,- properties: {- supplier_id: { type: :string, example: 'sup_1234567890' },- destination_location_id: { type: :string, example: 'sloc_1234567890' },- currency: { type: :string, nullable: true, example: 'USD' },- expected_at: { type: :string, format: :date, nullable: true, example: '2026-10-01' },- reference: { type: :string, nullable: true, description: "The supplier's own order number" },- notes: { type: :string, nullable: true },- items: {- type: :array,- items: {- type: :object,- properties: {- variant_id: { type: :string, example: 'variant_1234567890' },- quantity_ordered: { type: :integer, example: 100 },- unit_cost: { type: :string, example: '12.50' }- },- required: %w[variant_id quantity_ordered]- }- },- metadata: { type: :object, nullable: true }- },- required: %w[supplier_id destination_location_id]- }+ request_body_forresponse '201', 'purchase order created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:purchase_order) do+ let(:body) do{supplier_id: supplier.prefixed_id,destination_location_id: destination.prefixed_id,@@ -146,7 +122,7 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reresponse '404', 'supplier belongs to another store' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:purchase_order) do+ let(:body) do{supplier_id: create(:supplier, store: create(:store)).prefixed_id,destination_location_id: destination.prefixed_id,@@ -199,6 +175,44 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-rerun_test!endend++ patch 'Update a purchase order' do+ tags 'Purchase Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Edits a draft: its supplier, destination, dates, reference, notes and+ lines. Sending `items` replaces every line the order holds. Status+ moves through the order's own actions, never through this endpoint.+ DESC+ admin_scope :write, :purchasing++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'purchase order updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { order_record.prefixed_id }+ let(:body) do+ {+ reference: 'ACME-4471',+ expected_at: '2026-10-15',+ items: [{ variant_id: variant.prefixed_id, quantity_ordered: 120, unit_cost: '11.75' }]+ }+ end++ schema '$ref' => '#/components/schemas/PurchaseOrder'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['reference']).to eq('ACME-4471')+ expect(order_record.reload.items.sum(:quantity_ordered)).to eq(120)+ end+ end+ endendpath '/api/v3/admin/purchase_orders/{id}/mark_ordered' do@@ -299,33 +313,12 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reparameter 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: :receipt, in: :body, required: false, schema: {- type: :object,- properties: {- reference: { type: :string, nullable: true, example: 'DN-4471', description: "The supplier's delivery note or packing slip" },- received_at: { type: :string, format: 'date-time', nullable: true, description: 'Defaults to now' },- notes: { type: :string, nullable: true },- items: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :string, example: 'poi_1234567890' },- quantity_accepted: { type: :integer, example: 58 },- quantity_rejected: { type: :integer, example: 2 },- rejection_reason: { type: :string, nullable: true, example: 'damaged' },- notes: { type: :string, nullable: true }- },- required: %w[id]- }- }- }- }+ request_body_forresponse '201', 'delivery booked in' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:purchase_order_id) { order_record.prefixed_id }- let(:receipt) do+ let(:body) do{ reference: 'DN-4471',items: [{ id: order_record.items.first.prefixed_id, quantity_accepted: 58, quantity_rejected: 2,rejection_reason: 'damaged' }] }@@ -348,7 +341,7 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reresponse '422', 'order has not been placed yet' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:purchase_order_id) { order_record.prefixed_id }- let(:receipt) { {} }+ let(:body) { {} }schema '$ref' => '#/components/schemas/ErrorResponse'@@ -411,15 +404,12 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reparameter 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: :closure, in: :body, required: false, schema: {- type: :object,- properties: { reason: { type: :string, nullable: true, example: 'Supplier out of stock' } }- }+ request_body_forresponse '200', 'order closed short' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { order_record.prefixed_id }- let(:closure) { { reason: 'Supplier out of stock' } }+ let(:body) { { reason: 'Supplier out of stock' } }before doSpree::PurchaseOrders::MarkOrdered.call(purchase_order: order_record)@@ -459,15 +449,12 @@ RSpec.describe 'Admin Purchase Orders API', type: :request, swagger_doc: 'api-reparameter 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: :cancellation, in: :body, required: false, schema: {- type: :object,- properties: { reason: { type: :string, example: 'Supplier went under' } }- }+ request_body_forresponse '200', 'purchase order cancelled' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { order_record.prefixed_id }- let(:cancellation) { { reason: 'Supplier went under' } }+ let(:body) { { reason: 'Supplier went under' } }schema '$ref' => '#/components/schemas/PurchaseOrder'diff --git a/spree/api/spec/integration/spree/api/v3/admin/refund_reasons_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/refund_reasons_spec.rbindex b5b4ff7b9c..518d3c7982 100644--- a/spree/api/spec/integration/spree/api/v3/admin/refund_reasons_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/refund_reasons_spec.rb@@ -65,14 +65,7 @@ RSpec.describe 'Admin Refund Reasons API', type: :request, swagger_doc: 'api-refparameter 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: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Goodwill gesture' },- active: { type: :boolean, example: true, description: 'Inactive reasons are hidden from the pickers on new records.' }- }- }+ request_body_forresponse '201', 'refund reason created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -149,13 +142,7 @@ RSpec.describe 'Admin Refund Reasons API', type: :request, swagger_doc: 'api-refparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- active: { type: :boolean }- }- }+ request_body_forresponse '200', 'refund reason updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/reporting/saved_reports_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/reporting/saved_reports_spec.rbindex 5573b6a8ac..519562a91b 100644--- a/spree/api/spec/integration/spree/api/v3/admin/reporting/saved_reports_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/reporting/saved_reports_spec.rb@@ -31,5 +31,64 @@ RSpec.describe 'Admin Saved Reports API', type: :request, swagger_doc: 'api-refeendendend++ post 'Create a saved report' do+ tags 'Reports'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Saves a reporting query under a name so staff can run it again. The query is validated against the reporting registry.'+ admin_scope :write, :reports++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '201', 'saved report created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) do+ {+ name: 'Orders by channel',+ description: 'Weekly review',+ query: { metrics: %w[total_sales orders], dimensions: %w[channel] }+ }+ end++ schema '$ref' => '#/components/schemas/SavedReport'++ run_test! do |response|+ expect(JSON.parse(response.body)['name']).to eq('Orders by channel')+ end+ end+ end+ end++ path '/api/v3/admin/reporting/saved_reports/{id}' do+ parameter name: :id, in: :path, type: :string, description: 'Saved report ID'++ let(:id) { saved_report.prefixed_id }++ patch 'Update a saved report' do+ tags 'Reports'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ admin_scope :write, :reports++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '200', 'saved report updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: 'Sales by channel (monthly)', description: 'For the board pack' } }++ schema '$ref' => '#/components/schemas/SavedReport'++ run_test! do |response|+ expect(JSON.parse(response.body)['name']).to eq('Sales by channel (monthly)')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/reporting_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/reporting_spec.rbnew file mode 100644index 0000000000..238f711695--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/admin/reporting_spec.rb@@ -0,0 +1,47 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Admin Reporting API', type: :request, swagger_doc: 'api-reference/admin.yaml' do+ include_context 'API v3 Admin'++ let(:Authorization) { "Bearer #{admin_jwt_token}" }++ path '/api/v3/admin/reporting/query' do+ post 'Run a reporting query' do+ tags 'Reports'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Runs a query against the store's registered metrics and dimensions, in+ the store's time zone. A metric or dimension the registry does not know+ is refused with the names that are valid, and an API key needs the read+ scope of every resource the query touches.+ DESC+ admin_scope :read, :reports++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '200', 'query results' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) do+ {+ metrics: %w[total_sales orders],+ dimensions: [{ name: 'completed_at', grain: 'day' }],+ time_range: { preset: 'last_7_days' },+ compare: 'previous_period'+ }+ end++ before { create(:completed_order_with_totals, store: store, completed_at: 2.days.ago) }++ run_test! do |response|+ expect(JSON.parse(response.body)).to have_key('rows')+ end+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/admin/return_reasons_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/return_reasons_spec.rbindex 73a90b1e4c..b791a38e07 100644--- a/spree/api/spec/integration/spree/api/v3/admin/return_reasons_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/return_reasons_spec.rb@@ -65,14 +65,7 @@ RSpec.describe 'Admin Return Reasons API', type: :request, swagger_doc: 'api-refparameter 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: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Damaged in transit' },- active: { type: :boolean, example: true, description: 'Inactive reasons are hidden from the pickers on new records.' }- }- }+ request_body_forresponse '201', 'return reason created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -149,13 +142,7 @@ RSpec.describe 'Admin Return Reasons API', type: :request, swagger_doc: 'api-refparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- active: { type: :boolean }- }- }+ request_body_forresponse '200', 'return reason updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/returns_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/returns_spec.rbindex 16a761df9c..1cfd30c89c 100644--- a/spree/api/spec/integration/spree/api/v3/admin/returns_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/returns_spec.rb@@ -8,6 +8,8 @@ RSpec.describe 'Admin Returns API', type: :request, swagger_doc: 'api-reference/let!(:record) { create(:return, order: create(:shipped_order, store: store)) }let(:Authorization) { "Bearer #{admin_jwt_token}" }let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:order) { record.order }+ let(:order_id) { order.prefixed_id }path '/api/v3/admin/returns' doget 'List returns' do@@ -58,6 +60,162 @@ RSpec.describe 'Admin Returns API', type: :request, swagger_doc: 'api-reference/endendend++ post 'Create a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Opens a return on a completed order for fulfilled units the customer is sending back.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ request_body_for++ response '201', 'return opened' do+ let(:order) { create(:shipped_order, store: store) }+ let(:body) do+ { memo: 'Too small', items: [{ fulfillment_item_id: order.fulfillment_items.first.prefixed_id, quantity: 1 }] }+ end++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('requested')+ expect(data['memo']).to eq('Too small')+ end+ end++ response '422', 'more returned than was fulfilled' do+ let(:order) { create(:shipped_order, store: store) }+ let(:body) { { items: [{ fulfillment_item_id: order.fulfillment_items.first.prefixed_id, quantity: 99 }] } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/returns/{id}' do+ patch 'Update a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Edits the warehouse, reason, memo or metadata of a return. Its status moves only through the approve, receive, refund and cancel actions.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Return prefixed ID'+ request_body_for++ response '200', 'return updated' do+ let(:id) { record.prefixed_id }+ let(:reason) { create(:return_reason, store: store) }+ let(:body) { { memo: 'Customer shipped it back with a tracking number', reason_id: reason.prefixed_id } }++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ expect(JSON.parse(response.body)['memo']).to eq('Customer shipped it back with a tracking number')+ expect(record.reload.reason).to eq(reason)+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/returns/{id}/receive' do+ patch 'Receive a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Records what arrived on an approved return. Omit `items` to receive everything as requested and resellable; send rows for a partial or damaged receipt.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Return prefixed ID'+ request_body_for(required: false)++ response '200', 'return received' do+ let!(:record) { create(:approved_return, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) do+ { items: [{ return_line_item_id: record.return_line_items.first.prefixed_id, quantity: 1, resellable: false }] }+ end++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('received')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/returns/{id}/refund' do+ patch 'Refund a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Pays the customer back for a received return, to store credit or through the original payment.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Return prefixed ID'+ request_body_for(required: false)++ response '200', 'return refunded' do+ let!(:record) { create(:received_return, order: create(:shipped_order, store: store)) }+ let(:id) { record.prefixed_id }+ let(:body) { { refund_method: 'store_credit' } }++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('refunded')+ end+ end+ end+ end++ path '/api/v3/admin/orders/{order_id}/returns/{id}/cancel' do+ patch 'Cancel a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Withdraws a return whose goods have not been received.'+ admin_scope :write, :orders++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :order_id, in: :path, type: :string, required: true, description: 'Order prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Return prefixed ID'+ request_body_for(required: false)++ response '200', 'return canceled' do+ let(:id) { record.prefixed_id }+ let(:body) { { reason: 'Customer changed their mind' } }++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('canceled')+ end+ end+ endendpath '/api/v3/admin/orders/{order_id}/returns/{return_id}/labels' dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rbindex 9157165ddb..a9ae721a04 100644--- a/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rb@@ -47,19 +47,11 @@ RSpec.describe 'Admin Roles API', type: :request, swagger_doc: 'api-reference/adparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :role, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'order_manager' },- description: { type: :string, nullable: true, example: 'Handles daily orders' },- permissions: { type: :array, items: { type: :string }, example: %w[write_orders read_customers] }- },- required: %w[name]- }+ request_body_forresponse '201', 'role created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:role) { { name: 'order_manager', description: 'Handles daily orders', permissions: %w[write_orders read_customers] } }+ let(:body) { { name: 'order_manager', description: 'Handles daily orders', permissions: %w[write_orders read_customers] } }run_test! do |response|data = JSON.parse(response.body)@@ -70,7 +62,7 @@ RSpec.describe 'Admin Roles API', type: :request, swagger_doc: 'api-reference/adresponse '422', 'invalid request' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:role) { { name: 'broken', permissions: %w[write_bogus] } }+ let(:body) { { name: 'broken', permissions: %w[write_bogus] } }run_test!end@@ -93,20 +85,13 @@ RSpec.describe 'Admin Roles API', type: :request, swagger_doc: 'api-reference/adparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :role, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- description: { type: :string, nullable: true },- permissions: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'role updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:existing_role) { create(:role, name: 'support', permissions: %w[read_orders]) }let(:id) { existing_role.prefixed_id }- let(:role) { { permissions: %w[read_orders read_customers] } }+ let(:body) { { permissions: %w[read_orders read_customers] } }run_test! do |response|data = JSON.parse(response.body)diff --git a/spree/api/spec/integration/spree/api/v3/admin/seller_requirements_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/seller_requirements_spec.rbindex 8ca43c7d0b..53446f8d94 100644--- a/spree/api/spec/integration/spree/api/v3/admin/seller_requirements_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/seller_requirements_spec.rb@@ -72,26 +72,7 @@ RSpec.describe 'Admin Seller Requirements API', type: :request, swagger_doc: 'apparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[type],- properties: {- type: { type: :string, example: 'document',- description: 'The kind, from `GET /seller_requirements/types`.' },- name: { type: :string, example: 'Business registration',- 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, example: 'A copy of your certificate of incorporation.',- description: 'Instructions shown to the seller.' },- required: { type: :boolean, example: true,- description: 'Whether this blocks approval. Off means recommended.' },- active: { type: :boolean, example: true },- position: { type: :integer, example: 1, description: 'Place in the checklist.' },- preferences: { type: :object, example: { accepted_content_types: ['application/pdf'] },- description: 'Configuration for this kind, per its type\'s `schema`.' }- }- }+ request_body_forresponse '201', 'seller requirement created' dolet(:body) { { type: 'document', name: 'Business registration', required: true } }@@ -185,17 +166,7 @@ RSpec.describe 'Admin Seller Requirements API', type: :request, swagger_doc: 'apparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Proof of business registration' },- description: { type: :string, example: 'A copy of your certificate of incorporation.' },- required: { type: :boolean, example: false },- active: { type: :boolean, example: true },- position: { type: :integer, example: 2 },- preferences: { type: :object, example: { minimum_count: 3 } }- }- }+ request_body_forresponse '200', 'seller requirement updated' dolet(:requirement) { create(:minimum_products_requirement, store: store) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/sellers_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/sellers_spec.rbindex 6dc1449519..d791a03964 100644--- a/spree/api/spec/integration/spree/api/v3/admin/sellers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/sellers_spec.rb@@ -2,30 +2,6 @@require 'swagger_helper'-# Both seller addresses accept the same keys, so they document the same shape —-# a bare `type: :object` on one of them would leave SDK consumers without any-# property types for it.-SELLER_ADDRESS_SCHEMA = {- 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, example: 'Ada' },- last_name: { type: :string, example: 'Lovelace' },- company: { type: :string, example: 'Sparks Audio Ltd' },- address1: { type: :string, example: '1 Seller Way' },- address2: { type: :string, example: 'Unit 4' },- city: { type: :string, example: 'London' },- postal_code: { type: :string, example: 'EC1A 1BB' },- phone: { type: :string, example: '+44 20 7946 0000' },- country_code: { type: :string, example: 'GB' },- state_code: { type: :string, example: 'NY' },- state_name: { type: :string, example: 'New York' },- label: { type: :string, example: 'Head office' }- }-}.freeze-RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/admin.yaml' doinclude_context 'API v3 Admin'@@ -98,23 +74,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[name],- properties: {- name: { type: :string, example: 'Northwind Books' },- slug: { type: :string, example: 'northwind-books',- description: 'Derived from the name when omitted.' },- contact_email: { type: :string, example: '[email protected]', nullable: true },- billing_email: { type: :string, example: '[email protected]', nullable: true },- about: { type: :string, example: '<p>Independent bookshop.</p>', nullable: true },- tax_remittance: { type: :string, enum: %w[seller platform], example: 'seller' },- payouts_schedule_interval: {- type: :string, enum: %w[daily weekly biweekly monthly manual], nullable: true- },- minimum_payout_amount: { type: :string, example: '25.0', nullable: true }- }- }+ request_body_forresponse '201', 'seller created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -195,28 +155,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Sparks Audio Ltd' },- billing_email: { type: :string, example: '[email protected]', nullable: true },- payouts_schedule_interval: {- type: :string, enum: %w[daily weekly biweekly monthly manual], nullable: true- },- minimum_payout_amount: { type: :string, example: '25.0', nullable: true },- holiday_mode_until: { type: :string, format: 'date-time', nullable: true },- logo_signed_id: {- type: :string, nullable: true,- description: 'The `signed_id` returned by POST /api/v3/admin/files. Send `null` ' \- 'to remove the image, or omit the key to leave it alone. ' \- 'Same for `square_logo_signed_id` and `cover_photo_signed_id`.'- },- square_logo_signed_id: { type: :string, nullable: true },- cover_photo_signed_id: { type: :string, nullable: true },- billing_address: SELLER_ADDRESS_SCHEMA,- returns_address: SELLER_ADDRESS_SCHEMA- }- }+ request_body_forresponse '200', 'seller updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -310,14 +249,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[email],- properties: {- email: { type: :string, example: '[email protected]' },- role_id: { type: :string, example: 'role_UkLWZg9DAJ', nullable: true }- }- }+ request_body_forresponse '201', 'invitation sent' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -338,6 +270,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/patch 'Approve a seller' dotags 'Sellers'+ consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]description <<~DESC@@ -351,6 +284,9 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ let(:body) { {} }response '200', 'seller approved' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -380,6 +316,40 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/endend+ path '/api/v3/admin/sellers/{id}/reopen_onboarding' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Seller prefixed ID'++ patch 'Send a seller back to onboarding' do+ tags 'Sellers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Returns a seller waiting for review to onboarding, with a `note`+ saying what they have to fix. Unlike `reject`, this expects them back.+ DESC+ admin_scope :write, :sellers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '200', 'onboarding reopened' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { seller.prefixed_id }+ let(:body) { { note: 'Returns address is a PO box' } }++ before { seller.update!(status: 'ready_for_review') }++ schema '$ref' => '#/components/schemas/Seller'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('onboarding')+ end+ end+ end+ end+path '/api/v3/admin/sellers/{id}/suspend' doparameter name: :id, in: :path, type: :string, required: true, description: 'Seller prefixed ID'@@ -400,12 +370,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- reason: { type: :string, example: 'Counterfeit goods' }- }- }+ request_body_forresponse '200', 'seller suspended' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -443,12 +408,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- reason: { type: :string, example: 'Incomplete paperwork' }- }- }+ request_body_forresponse '200', 'seller rejected' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -607,6 +567,111 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/endendend++ post 'Waive a requirement for a seller' do+ tags 'Sellers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Excuses this one seller from a requirement the marketplace asks of+ everyone, recorded as a `waived` submission. The operator never+ submits on the seller's behalf: this endpoint only waives.+ DESC+ admin_scope :write, :sellers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for++ response '201', 'requirement waived' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:seller_id) { seller.prefixed_id }+ let(:requirement) { create(:operator_review_requirement, store: store, name: 'VAT number check') }+ let(:body) { { requirement_id: requirement.prefixed_id, review_note: 'Verified offline' } }++ schema '$ref' => '#/components/schemas/SellerRequirementSubmission'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('waived')+ end+ end+ end+ end++ path '/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/accept' do+ parameter name: :seller_id, in: :path, type: :string, required: true, description: 'Seller prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Requirement submission ID'++ let(:seller_id) { seller.prefixed_id }+ let(:submission) do+ create(:seller_requirement_submission, seller: seller,+ requirement: create(:operator_review_requirement, store: store, name: 'VAT number check'))+ end+ let(:id) { submission.prefixed_id }++ patch "Accept a seller's submission" do+ tags 'Sellers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Marks what the seller submitted as meeting the requirement.'+ admin_scope :write, :sellers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'submission accepted' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { review_note: 'VAT number verified' } }++ schema '$ref' => '#/components/schemas/SellerRequirementSubmission'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('accepted')+ end+ end+ end+ end++ path '/api/v3/admin/sellers/{seller_id}/requirement_submissions/{id}/reject' do+ parameter name: :seller_id, in: :path, type: :string, required: true, description: 'Seller prefixed ID'+ parameter name: :id, in: :path, type: :string, required: true, description: 'Requirement submission ID'++ let(:seller_id) { seller.prefixed_id }+ let(:submission) do+ create(:seller_requirement_submission, seller: seller,+ requirement: create(:operator_review_requirement, store: store, name: 'VAT number check'))+ end+ let(:id) { submission.prefixed_id }++ patch "Reject a seller's submission" do+ tags 'Sellers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Turns down what the seller submitted. `review_note` is the reason sent+ back to the seller, who can then submit again.+ DESC+ admin_scope :write, :sellers++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'submission rejected' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { review_note: 'The VAT number does not match the company name' } }++ schema '$ref' => '#/components/schemas/SellerRequirementSubmission'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('rejected')+ end+ end+ endendpath '/api/v3/admin/seller_transfers' do@@ -699,16 +764,7 @@ RSpec.describe 'Admin Sellers API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- reference: {- type: :string,- description: "The provider's own id for the settlement, when one made it",- example: 'TRF-8842'- }- }- }+ request_body_forresponse '200', 'payout completed' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/setup_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/setup_spec.rbindex e200bfa9e6..2a599e0692 100644--- a/spree/api/spec/integration/spree/api/v3/admin/setup_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/setup_spec.rb@@ -33,42 +33,7 @@ RSpec.describe 'Admin Setup API', type: :request, swagger_doc: 'api-reference/aduser exists — the flow is closed permanently after setup.DESC- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[setup_token email password country_code],- properties: {- setup_token: { type: :string, description: 'One-time token from the install output.' },- email: { type: :string, format: 'email', example: '[email protected]' },- password: { type: :string, example: 'Secret123!' },- password_confirmation: { type: :string, example: 'Secret123!' },- first_name: { type: :string, example: 'Olivia' },- last_name: { type: :string, example: 'Owner' },- store_name: { type: :string, example: 'My Store' },- 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.',- example: 'US'- },- locale: {- type: :string,- description: "Storefront locale. Defaults to the country's own language.",- example: 'en'- },- currency: {- type: :string,- description: "ISO 4217 currency. Defaults to the country's own currency — " \- 'pass one only when the store prices in something else.',- example: 'USD'- },- sample_data: {- type: :boolean,- description: 'Load the demo catalog, customers and orders in the background ' \- 'once the admin account exists.',- example: false- }- }- }+ request_body_forresponse '200', 'setup completed' dolet(:body) dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/stock_levels_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/stock_levels_spec.rbindex 1bcbab8498..9f36d71b99 100644--- a/spree/api/spec/integration/spree/api/v3/admin/stock_levels_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/stock_levels_spec.rb@@ -82,26 +82,7 @@ RSpec.describe 'Admin Stock Levels API', type: :request, swagger_doc: 'api-referparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[stock_levels],- properties: {- stock_levels: {- type: :array,- items: {- type: :object,- required: %w[variant_id stock_location_id],- properties: {- variant_id: { type: :string, example: 'variant_xY9' },- stock_location_id: { type: :string, example: 'sloc_aBc' },- count_on_hand: { type: :integer, nullable: true, example: 42 },- adjustment: { type: :integer, nullable: true, example: -3 },- backorderable: { type: :boolean, nullable: true }- }- }- }- }- }+ request_body_forresponse '200', 'stock levels updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -132,4 +113,44 @@ RSpec.describe 'Admin Stock Levels API', type: :request, swagger_doc: 'api-referendendend++ path '/api/v3/admin/stock_levels/{id}' do+ let(:stock_level) do+ create(:stock_level, variant: variant, stock_location: stock_location, adjust_count_on_hand: false).tap do |level|+ level.update_columns(count_on_hand: 10)+ end+ end+ let(:id) { stock_level.prefixed_id }++ patch 'Update a stock level' do+ tags 'Stock'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Corrects one shelf. Send `count_on_hand` for the count the shelf should+ end at, or `adjustment` for a signed change; either is recorded as a+ stock movement labelled with `reason`.+ DESC+ admin_scope :write, :stock++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true, description: 'Stock level ID'+ request_body_for++ response '200', 'stock level updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { count_on_hand: 25, backorderable: false, reason: 'Cycle count' } }++ schema '$ref' => '#/components/schemas/StockLevel'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['count_on_hand']).to eq(25)+ expect(data['backorderable']).to be(false)+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/stock_locations_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/stock_locations_spec.rbindex 4e6766316d..ecbd5ffb3e 100644--- a/spree/api/spec/integration/spree/api/v3/admin/stock_locations_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/stock_locations_spec.rb@@ -80,41 +80,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-reparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Brooklyn warehouse' },- admin_name: { type: :string, nullable: true, description: 'Internal name shown only in the admin' },- active: { type: :boolean, example: true },- default: { type: :boolean, description: 'Setting to true demotes the previous default.' },- kind: {- type: :string,- enum: Spree::StockLocation::KINDS,- description: 'Categorizes the location.',- example: 'warehouse'- },- 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: Spree::StockLocation::PICKUP_STOCK_POLICIES,- 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: %w[name]- }+ request_body_forresponse '201', 'stock location created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -207,31 +173,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-reparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- admin_name: { type: :string, nullable: true },- active: { type: :boolean },- default: { type: :boolean },- kind: { type: :string, enum: Spree::StockLocation::KINDS },- 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: Spree::StockLocation::PICKUP_STOCK_POLICIES },- pickup_ready_in_minutes: { type: :number, nullable: true, minimum: 0 },- pickup_instructions: { type: :string, nullable: true }- }- }+ request_body_forresponse '200', 'stock location updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/stock_transfers_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/stock_transfers_spec.rbindex 5cfdff9fad..88778863e9 100644--- a/spree/api/spec/integration/spree/api/v3/admin/stock_transfers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/stock_transfers_spec.rb@@ -96,32 +96,11 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reparameter 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: :stock_transfer, in: :body, required: true, schema: {- type: :object,- properties: {- source_location_id: { type: :string, example: 'sloc_1234567890' },- destination_location_id: { type: :string, example: 'sloc_0987654321' },- reference: { type: :string, nullable: true, description: "The merchant's own label for the trip" },- notes: { type: :string, nullable: true },- items: {- type: :array,- items: {- type: :object,- properties: {- variant_id: { type: :string, example: 'variant_1234567890' },- quantity_shipped: { type: :integer, example: 10 }- },- required: %w[variant_id quantity_shipped]- }- },- metadata: { type: :object, nullable: true }- },- required: %w[source_location_id destination_location_id]- }+ request_body_forresponse '201', 'stock transfer created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:stock_transfer) do+ let(:body) do{source_location_id: source.prefixed_id,destination_location_id: destination.prefixed_id,@@ -142,7 +121,7 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reresponse '404', 'warehouse belongs to another store' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:stock_transfer) do+ let(:body) do{source_location_id: source.prefixed_id,destination_location_id: create(:stock_location, store: create(:store)).prefixed_id,@@ -196,6 +175,43 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reendend+ patch 'Update a stock transfer' do+ tags 'Stock Transfers'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Edits a draft: its reference, notes, either end, and its lines.+ Sending `items` replaces every line the draft holds. Status moves+ through the transfer's own actions, never through this endpoint.+ DESC+ admin_scope :write, :stock++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'stock transfer updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:id) { transfer_record.prefixed_id }+ let(:body) do+ {+ reference: 'Weekend restock',+ notes: 'Two cartons, fragile',+ items: [{ variant_id: variant.prefixed_id, quantity_shipped: 12 }]+ }+ end++ schema '$ref' => '#/components/schemas/StockTransfer'++ run_test! do |response|+ expect(JSON.parse(response.body)['reference']).to eq('Weekend restock')+ expect(transfer_record.reload.items.sum(:quantity_shipped)).to eq(12)+ end+ end+ end+delete 'Delete a stock transfer' dotags 'Stock Transfers'security [api_key: [], bearer_auth: []]@@ -272,20 +288,12 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reparameter 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: :departure, in: :body, required: false, schema: {- type: :object,- properties: {- force: {- type: :boolean,- description: 'Ship even if it drives the source below zero'- }- }- }+ request_body_forresponse '200', 'transfer is in transit' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { transfer_record.prefixed_id }- let(:departure) { {} }+ let(:body) { {} }schema '$ref' => '#/components/schemas/StockTransfer'@@ -362,33 +370,12 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reparameter 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: :receipt, in: :body, required: false, schema: {- type: :object,- properties: {- reference: { type: :string, nullable: true, example: 'Van 3, morning run' },- received_at: { type: :string, format: 'date-time', nullable: true, description: 'Defaults to now' },- notes: { type: :string, nullable: true },- items: {- type: :array,- items: {- type: :object,- properties: {- id: { type: :string, example: 'sti_1234567890' },- quantity_accepted: { type: :integer, example: 8 },- quantity_rejected: { type: :integer, example: 2 },- rejection_reason: { type: :string, nullable: true, example: 'damaged' },- notes: { type: :string, nullable: true }- },- required: %w[id]- }- }- }- }+ request_body_forresponse '201', 'delivery counted in' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:stock_transfer_id) { transfer_record.prefixed_id }- let(:receipt) do+ let(:body) do{ items: [{ id: transfer_record.items.first.prefixed_id, quantity_accepted: 8, quantity_rejected: 2,rejection_reason: 'damaged' }] }end@@ -409,7 +396,7 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reresponse '422', 'transfer has not shipped yet' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:stock_transfer_id) { transfer_record.prefixed_id }- let(:receipt) { {} }+ let(:body) { {} }schema '$ref' => '#/components/schemas/ErrorResponse'@@ -470,15 +457,12 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reparameter 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: :closure, in: :body, required: false, schema: {- type: :object,- properties: { reason: { type: :string, nullable: true, example: 'Two fell off the van' } }- }+ request_body_forresponse '200', 'transfer closed short' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { transfer_record.prefixed_id }- let(:closure) { { reason: 'Two fell off the van' } }+ let(:body) { { reason: 'Two fell off the van' } }before doSpree::StockTransfers::MarkInTransit.call(stock_transfer: transfer_record)@@ -521,22 +505,12 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reparameter 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: :cancellation, in: :body, required: false, schema: {- type: :object,- properties: {- on_in_transit: {- type: :string,- enum: %w[restock write_off],- description: 'Required once the units have left the source'- },- reason: { type: :string, nullable: true, description: 'Recorded against the written-off lines' }- }- }+ request_body_forresponse '200', 'transfer cancelled' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { transfer_record.prefixed_id }- let(:cancellation) { { on_in_transit: 'restock' } }+ let(:body) { { on_in_transit: 'restock' } }before { Spree::StockTransfers::MarkInTransit.call(stock_transfer: transfer_record) }@@ -551,7 +525,7 @@ RSpec.describe 'Admin Stock Transfers API', type: :request, swagger_doc: 'api-reresponse '422', 'in-transit cancellation needs a decision' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { transfer_record.prefixed_id }- let(:cancellation) { {} }+ let(:body) { {} }before { Spree::StockTransfers::MarkInTransit.call(stock_transfer: transfer_record) }diff --git a/spree/api/spec/integration/spree/api/v3/admin/store_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/store_spec.rbindex 3cc1843888..7432b46eca 100644--- a/spree/api/spec/integration/spree/api/v3/admin/store_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/store_spec.rb@@ -71,16 +71,7 @@ RSpec.describe 'Admin Store API', type: :request, swagger_doc: 'api-reference/adparameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'My Store' },- admin_locale: { type: :string, example: 'en' },- timezone: { type: :string, example: 'UTC' },- weight_unit: { type: :string, example: 'kg' },- unit_system: { type: :string, example: 'metric' }- }- }+ request_body_forresponse '200', 'store updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/suppliers_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/suppliers_spec.rbindex 8a6294fa72..90e99fe881 100644--- a/spree/api/spec/integration/spree/api/v3/admin/suppliers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/suppliers_spec.rb@@ -73,29 +73,11 @@ RSpec.describe 'Admin Suppliers API', type: :request, swagger_doc: 'api-referencparameter 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: :supplier, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Northwind Trading' },- contact_name: { type: :string, nullable: true, example: 'Dana Okafor' },- email: { type: :string, nullable: true, example: '[email protected]' },- phone: { type: :string, nullable: true, example: '555-0100' },- notes: { type: :string, nullable: true },- address1: { type: :string, nullable: true, example: '1 Warehouse Way' },- address2: { type: :string, nullable: true },- city: { type: :string, nullable: true, example: 'Brooklyn' },- state_code: { type: :string, nullable: true, example: 'NY' },- state_name: { type: :string, nullable: true },- country_code: { type: :string, nullable: true, example: 'US' },- postal_code: { type: :string, nullable: true, example: '11201' },- metadata: { type: :object, nullable: true }- },- required: %w[name]- }+ request_body_forresponse '201', 'supplier created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:supplier) do+ let(:body) do{name: 'Northwind Trading',contact_name: 'Dana Okafor',@@ -116,7 +98,7 @@ RSpec.describe 'Admin Suppliers API', type: :request, swagger_doc: 'api-referencresponse '422', 'validation error' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:supplier) { { name: '' } }+ let(:body) { { name: '' } }schema '$ref' => '#/components/schemas/ErrorResponse'@@ -167,20 +149,12 @@ RSpec.describe 'Admin Suppliers API', type: :request, swagger_doc: 'api-referencparameter 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: :supplier, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string },- contact_name: { type: :string, nullable: true },- email: { type: :string, nullable: true },- phone: { type: :string, nullable: true }- }- }+ request_body_forresponse '200', 'supplier updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }let(:id) { supplier_record.prefixed_id }- let(:supplier) { { contact_name: 'Sam Reyes' } }+ let(:body) { { contact_name: 'Sam Reyes' } }schema '$ref' => '#/components/schemas/Supplier'diff --git a/spree/api/spec/integration/spree/api/v3/admin/tax_categories_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/tax_categories_spec.rbindex 40aa0f92e5..b3b55cdd09 100644--- a/spree/api/spec/integration/spree/api/v3/admin/tax_categories_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/tax_categories_spec.rb@@ -34,5 +34,73 @@ RSpec.describe 'Admin Tax Categories API', type: :request, swagger_doc: 'api-refendendend++ post 'Create a tax category' do+ tags 'Settings'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Creates a tax category. `tax_code` is the code a tax provider uses to classify the goods in it.'+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '201', 'tax category created' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: 'Food', tax_code: 'PF050000', description: 'Groceries and prepared food' } }++ schema '$ref' => '#/components/schemas/TaxCategory'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['name']).to eq('Food')+ expect(data['tax_code']).to eq('PF050000')+ end+ end++ response '422', 'validation failed' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: '' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'++ run_test!+ end+ end+ end++ path '/api/v3/admin/tax_categories/{id}' do+ parameter name: :id, in: :path, type: :string, description: 'Tax category ID'++ let(:id) { tax_category.prefixed_id }++ patch 'Update a tax category' do+ tags 'Settings'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ admin_scope :write, :settings++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true,+ description: 'Bearer token for admin authentication'+ request_body_for++ response '200', 'tax category updated' do+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:body) { { name: 'Apparel', is_default: true } }++ schema '$ref' => '#/components/schemas/TaxCategory'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['name']).to eq('Apparel')+ expect(data['is_default']).to be(true)+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/admin/tax_rates_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/tax_rates_spec.rbindex 14ef6519ed..1cf2e50736 100644--- a/spree/api/spec/integration/spree/api/v3/admin/tax_rates_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/tax_rates_spec.rb@@ -77,20 +77,7 @@ RSpec.describe 'Admin Tax Rates API', type: :request, swagger_doc: 'api-referencparameter 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: :body, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string, description: 'Customer-facing rate name, e.g. "VAT"' },- rate: { type: :string, description: 'Rate as a decimal string, e.g. "0.19"' },- rate_percent: { type: :string, description: 'Rate as a percentage string, 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: %w[name tax_category_id]- }+ request_body_forresponse '201', 'tax rate created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -153,19 +140,7 @@ RSpec.describe 'Admin Tax Rates API', type: :request, swagger_doc: 'api-referencparameter 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: :body, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string },- rate: { type: :string },- rate_percent: { type: :string },- included_in_price: { type: :boolean },- show_rate_in_label: { type: :boolean },- tax_category_id: { type: :string },- country_code: { type: :string },- state_code: { type: :string }- }- }+ request_body_forresponse '200', 'tax rate updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/translations/batch_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/translations/batch_spec.rbindex b91fe6babb..3d3a11eade 100644--- a/spree/api/spec/integration/spree/api/v3/admin/translations/batch_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/translations/batch_spec.rb@@ -23,28 +23,7 @@ RSpec.describe 'Admin Translations Batch API', type: :request, swagger_doc: 'apiparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :Authorization, in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- required: %w[translations],- properties: {- translations: {- type: :array,- items: {- type: :object,- required: %w[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 }- }- }- }- }- }- }+ request_body_forresponse '200', 'translations upserted' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/variants_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/variants_spec.rbindex 7f8f0fe2dc..b2c27dbe89 100644--- a/spree/api/spec/integration/spree/api/v3/admin/variants_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/variants_spec.rb@@ -61,62 +61,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-referenceparameter name: :Authorization, in: :header, type: :string, required: true,description: 'Bearer token for admin authentication'parameter name: :product_id, in: :path, type: :string, required: true, description: 'Product ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- sku: { type: :string, example: 'SKU-001' },- cost_price: { type: :string, example: '10.00' },- cost_currency: { type: :string, example: 'USD' },- 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: %w[name value],- properties: {- name: { type: :string, example: 'size' },- value: { type: :string, example: 'Small' }- }- }- },- position: { type: :integer },- barcode: { type: :string },- prices: {- type: :array,- description: 'Per-currency prices. Upserted by currency.',- items: {- type: :object,- required: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- stock_levels: {- type: :array,- description: 'Per-stock-location inventory. Upserted by stock_location_id.',- items: {- type: :object,- required: %w[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, example: 50 },- backorderable: { type: :boolean }- }- }- }- }- }+ request_body_forresponse '201', 'variant created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -199,62 +144,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-referencedescription: 'Bearer token for admin authentication'parameter name: :product_id, in: :path, type: :string, required: true, description: 'Product ID'parameter name: :id, in: :path, type: :string, required: true, description: 'Variant ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- sku: { type: :string, example: 'SKU-001' },- cost_price: { type: :string, example: '10.00' },- cost_currency: { type: :string, example: 'USD' },- 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: %w[name value],- properties: {- name: { type: :string, example: 'size' },- value: { type: :string, example: 'Small' }- }- }- },- position: { type: :integer },- barcode: { type: :string },- prices: {- type: :array,- description: 'Per-currency prices. Upserted by currency.',- items: {- type: :object,- required: %w[currency amount],- properties: {- currency: { type: :string, example: 'USD' },- amount: { type: :string, example: '29.99' },- compare_at_amount: { type: :string, nullable: true, example: '39.99' }- }- }- },- stock_levels: {- type: :array,- description: 'Per-stock-location inventory. Upserted by stock_location_id.',- items: {- type: :object,- required: %w[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, example: 50 },- backorderable: { type: :boolean }- }- }- }- }- }+ request_body_forresponse '200', 'variant updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/admin/webhook_endpoints_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/webhook_endpoints_spec.rbindex 108cb2b47d..38c6e929b2 100644--- a/spree/api/spec/integration/spree/api/v3/admin/webhook_endpoints_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/webhook_endpoints_spec.rb@@ -87,20 +87,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-parameter 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: :body, in: :body, schema: {- type: :object,- required: %w[url],- properties: {- name: { type: :string, example: 'Order pipeline' },- url: { type: :string, example: 'https://example.com/webhooks/orders' },- active: { type: :boolean, example: true },- subscriptions: {- type: :array,- items: { type: :string },- example: %w[order.placed order.canceled]- }- }- }+ request_body_forresponse '201', 'webhook endpoint created — secret_key returned once' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -194,15 +181,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-parameter 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: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- url: { type: :string },- active: { type: :boolean },- subscriptions: { type: :array, items: { type: :string } }- }- }+ request_body_forresponse '200', 'webhook endpoint updated' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }@@ -336,12 +315,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-parameter 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: :body, in: :body, schema: {- type: :object,- properties: {- reason: { type: :string, example: 'Investigating elevated 5xx rate' }- }- }+ request_body_forresponse '200', 'webhook endpoint disabled' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }diff --git a/spree/api/spec/integration/spree/api/v3/seller/auth_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/auth_spec.rbindex 9b2dcad834..6d9d77b34f 100644--- a/spree/api/spec/integration/spree/api/v3/seller/auth_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/auth_spec.rb@@ -35,15 +35,7 @@ RSpec.describe 'Seller Authentication API', type: :request, swagger_doc: 'api-rewhile still letting sellers sign in with a password.DESC- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- provider: { type: :string, enum: ['email'], default: 'email' },- email: { type: :string, format: 'email', example: '[email protected]' },- password: { type: :string, example: 'password123' }- },- required: %w[email password]- }+ request_body_forresponse '200', 'login successful' dolet(:body) { { email: existing_seller_user.email, password: 'password123' } }diff --git a/spree/api/spec/integration/spree/api/v3/seller/claims_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/claims_spec.rbindex 29e9394c70..6188b9ff89 100644--- a/spree/api/spec/integration/spree/api/v3/seller/claims_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/claims_spec.rb@@ -59,29 +59,7 @@ RSpec.describe 'Seller Claims API', type: :request, swagger_doc: 'api-reference/DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- items: {- type: :array,- items: {- type: :object,- properties: {- line_item_id: { type: :string },- quantity: { type: :integer },- description: { type: :string, nullable: true },- send_replacement: { type: :boolean },- replacement_variant_id: { type: :string, nullable: true },- refund_amount: { type: :string, nullable: true }- },- required: %w[line_item_id quantity]- }- },- reason_id: { type: :string, nullable: true },- memo: { type: :string, nullable: true }- },- required: %w[items]- }+ request_body_forresponse '201', 'claim opened' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -144,16 +122,7 @@ RSpec.describe 'Seller Claims API', type: :request, swagger_doc: 'api-reference/DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- resolution: { type: :string, enum: %w[refund replacement refund_and_replacement] },- refund_method: { type: :string, enum: %w[original_payment store_credit] },- amount: { type: :string, nullable: true },- replacement_line_item_ids: { type: :array, items: { type: :string } }- },- required: %w[resolution]- }+ request_body_forresponse '200', 'claim resolved' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -177,17 +146,20 @@ RSpec.describe 'Seller Claims API', type: :request, swagger_doc: 'api-reference/patch 'Deny a claim' dotags 'Claims'+ consumes 'application/json'produces 'application/json'security [bearer_auth: []]description 'Turns the claim down.'parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)response '200', 'claim denied' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }let(:'X-Spree-Seller-Id') { seller.prefixed_id }let(:order_id) { order.prefixed_id }let(:id) { claim.prefixed_id }+ let(:body) { { reason: 'Reported after the claim window closed' } }schema '$ref' => '#/components/schemas/Claim'@@ -196,6 +168,36 @@ RSpec.describe 'Seller Claims API', type: :request, swagger_doc: 'api-reference/endend+ path '/api/v3/seller/orders/{order_id}/claims/{id}/cancel' do+ parameter name: :order_id, in: :path, type: :string+ parameter name: :id, in: :path, type: :string++ patch 'Cancel a claim' do+ tags 'Claims'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description 'Withdraws a claim that is no longer needed.'++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'claim canceled' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:id) { claim.prefixed_id }+ let(:body) { { reason: 'Customer found the missing item' } }++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('canceled')+ end+ end+ end+ end+path '/api/v3/seller/claim_reasons' doget 'List claim reasons' dotags 'Claims'diff --git a/spree/api/spec/integration/spree/api/v3/seller/delivery_methods_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/delivery_methods_spec.rbindex 5939a7384a..44f0aebaab 100644--- a/spree/api/spec/integration/spree/api/v3/seller/delivery_methods_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/delivery_methods_spec.rb@@ -65,40 +65,7 @@ RSpec.describe 'Seller Delivery Methods API', type: :request, swagger_doc: 'api-DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- admin_name: { type: :string, nullable: true },- code: { type: :string, nullable: true },- delivery_profile_id: { type: :string, description: "One of the marketplace's delivery profiles" },- delivery_zone_id: { type: :string, nullable: true, description: 'Narrows where the method ships' },- 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 },-calculator: {- type: :object,- description: 'How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per that type\'s `schema`.',- properties: {- type: { type: :string, example: 'flat_rate' },- preferences: { type: :object, example: { amount: '12.5' } }- }- },- rules: {- type: :array,- description: 'Conditions on the method, from `/delivery_methods/rule_types`',- items: {- type: :object,- properties: {- type: { type: :string },- preferences: { type: :object }- }- }- }- },- required: %w[name]- }+ request_body_forresponse '201', 'delivery method created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -157,40 +124,7 @@ calculator: {security [bearer_auth: []]description "Only the seller's own methods can be changed — a marketplace method shared with sellers is read-only."- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- admin_name: { type: :string, nullable: true },- code: { type: :string, nullable: true },- delivery_profile_id: { type: :string, description: "One of the marketplace's delivery profiles" },- delivery_zone_id: { type: :string, nullable: true, description: 'Narrows where the method ships' },- 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 },-calculator: {- type: :object,- description: 'How the method is priced: a type from `/delivery_methods/calculators` and its preferences, per that type\'s `schema`.',- properties: {- type: { type: :string, example: 'flat_rate' },- preferences: { type: :object, example: { amount: '12.5' } }- }- },- rules: {- type: :array,- description: 'Replaces the whole set — a rule dropped here is deleted, so re-send surviving rules with their `id`.',- items: {- type: :object,- properties: {- id: { type: :string },- type: { type: :string },- preferences: { type: :object }- }- }- }- }- }+ request_body_forresponse '200', 'delivery method updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/exchanges_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/exchanges_spec.rbindex cb567bc26a..5cb88622a7 100644--- a/spree/api/spec/integration/spree/api/v3/seller/exchanges_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/exchanges_spec.rb@@ -63,27 +63,7 @@ RSpec.describe 'Seller Exchanges API', type: :request, swagger_doc: 'api-referenDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- items: {- type: :array,- items: {- type: :object,- properties: {- fulfillment_item_id: { type: :string },- new_variant_id: { type: :string },- quantity: { type: :integer }- },- required: %w[fulfillment_item_id new_variant_id quantity]- }- },- reason_id: { type: :string, nullable: true },- stock_location_id: { type: :string, nullable: true },- memo: { type: :string, nullable: true }- },- required: %w[items]- }+ request_body_forresponse '201', 'exchange opened' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -106,6 +86,47 @@ RSpec.describe 'Seller Exchanges API', type: :request, swagger_doc: 'api-referenendend+ path '/api/v3/seller/orders/{order_id}/exchanges/{id}/receive' do+ parameter name: :order_id, in: :path, type: :string+ parameter name: :id, in: :path, type: :string++ patch 'Receive an exchange' do+ tags 'Exchanges'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Records the goods coming back. Send the rows that actually arrived for+ a partial or damaged receipt; omit them to receive everything.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'exchange received' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:id) { exchange.prefixed_id }+ let(:body) do+ {+ items: [+ { exchange_line_item_id: exchange.exchange_line_items.first.prefixed_id, quantity: 1, resellable: true }+ ]+ }+ end++ before { Spree::Exchanges::Approve.call(exchange: exchange) }++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('received')+ end+ end+ end+ end+path '/api/v3/seller/orders/{order_id}/exchanges/{id}/fulfill' doparameter name: :order_id, in: :path, type: :stringparameter name: :id, in: :path, type: :string@@ -121,12 +142,7 @@ RSpec.describe 'Seller Exchanges API', type: :request, swagger_doc: 'api-referenDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- refund_method: { type: :string, enum: %w[original_payment store_credit] }- }- }+ request_body_for(required: false)response '200', 'replacement sent' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -146,4 +162,34 @@ RSpec.describe 'Seller Exchanges API', type: :request, swagger_doc: 'api-referenendendend++ path '/api/v3/seller/orders/{order_id}/exchanges/{id}/cancel' do+ parameter name: :order_id, in: :path, type: :string+ parameter name: :id, in: :path, type: :string++ patch 'Cancel an exchange' do+ tags 'Exchanges'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description 'Withdraws an exchange before the goods come back.'++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'exchange canceled' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:id) { exchange.prefixed_id }+ let(:body) { { reason: 'Customer kept the original' } }++ schema '$ref' => '#/components/schemas/Exchange'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('canceled')+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/seller/exports_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/exports_spec.rbindex 04ea72357a..168ba3ea09 100644--- a/spree/api/spec/integration/spree/api/v3/seller/exports_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/exports_spec.rb@@ -32,31 +32,7 @@ RSpec.describe 'Seller Exports API', type: :request, swagger_doc: 'api-referenceDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- type: {- type: :string,- enum: %w[orders products],- description: 'Which dataset to export.'- },- record_selection: {- type: :string,- enum: %w[filtered all],- description: '`filtered` (default) honours `search_params`; `all` exports everything this seller owns.'- },- search_params: {- type: :object,- description: 'Ransack predicates, the same shape the list endpoints take. Ignored when `record_selection` is `all`.',- additionalProperties: true- },- results_url: {- type: :string,- description: 'Panel URL the export-done email links back to. Honoured only when it matches one of the store\'s allowed origins.'- }- },- required: %w[type]- }+ request_body_forresponse '201', 'export queued' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/files_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/files_spec.rbindex 100f60a119..6e8eb5a7e4 100644--- a/spree/api/spec/integration/spree/api/v3/seller/files_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/files_spec.rb@@ -35,18 +35,7 @@ RSpec.describe 'Seller Files API', type: :request, swagger_doc: 'api-reference/sDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- filename: { type: :string, example: 'registration.pdf' },- content_type: { type: :string, example: 'application/pdf' },- byte_size: { type: :integer, example: 51_234 },- checksum: { type: :string, description: 'Base64-encoded MD5 digest of the file', example: 'rL0Y20zC+Fzt72VPzMSk2A==' },- visibility: { type: :string, enum: %w[public private], default: 'public' },- file: { type: :string, format: :binary, description: 'The bytes, for a multipart upload' }- },- required: %w[filename content_type]- }+ request_body_forresponse '201', 'upload target created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/fulfillments_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/fulfillments_spec.rbindex 54e578d411..d51c9d197c 100644--- a/spree/api/spec/integration/spree/api/v3/seller/fulfillments_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/fulfillments_spec.rb@@ -72,26 +72,7 @@ RSpec.describe 'Seller Fulfillments API', type: :request, swagger_doc: 'api-refeDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- tracking: { type: :string, description: 'Carrier tracking number' },- tracking_carrier: { type: :string, description: 'Carrier name' },- notify_customer: { type: :boolean, description: 'Send the dispatch email (default true)' },- items: {- type: :array,- description: 'Ship only these lines; the rest split onto a new fulfillment',- items: {- type: :object,- properties: {- item_id: { type: :string, description: 'Prefixed line item ID' },- quantity: { type: :integer }- },- required: %w[item_id quantity]- }- }- }- }+ request_body_for(required: false)response '200', 'parcel shipped' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -120,21 +101,13 @@ RSpec.describe 'Seller Fulfillments API', type: :request, swagger_doc: 'api-refeproduces 'application/json'security [bearer_auth: []]description <<~DESC- Adds or corrects the tracking number and its carrier.-- Deliberately narrow: where a parcel ships from and which service- carries it are the marketplace's arrangements, so they are not- editable here.+ Adds or corrects the tracking number and its carrier. Can also move the+ parcel to another of the seller's own stock locations, which quotes its+ rates again from there, or pick a different one of its quoted rates.DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- tracking: { type: :string, nullable: true },- tracking_carrier: { type: :string, nullable: true }- }- }+ request_body_forresponse '200', 'tracking recorded' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -182,6 +155,39 @@ RSpec.describe 'Seller Fulfillments API', type: :request, swagger_doc: 'api-refeendend+ path '/api/v3/seller/orders/{order_id}/fulfillments/{id}/split' do+ parameter name: :order_id, in: :path, type: :string+ parameter name: :id, in: :path, type: :string++ patch 'Split a parcel' do+ tags 'Fulfillments'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Moves part of what this parcel holds onto a new one, for goods leaving+ separately. Answers with every fulfillment on the order, since+ splitting rewrites more than one.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '200', 'parcel split' do+ let!(:order) { create(:order_ready_to_ship, store: store, seller: seller, line_items_count: 2) }+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:id) { fulfillment.prefixed_id }+ let(:body) { { variant_id: fulfillment.fulfillment_items.first.variant.prefixed_id, quantity: 1 } }++ run_test! do |response|+ expect(JSON.parse(response.body)['data'].size).to eq(2)+ end+ end+ end+ end+path '/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries' doparameter name: :order_id, in: :path, type: :string, description: 'Prefixed order ID'parameter name: :fulfillment_id, in: :path, type: :string, description: 'Prefixed fulfillment ID'@@ -212,6 +218,63 @@ RSpec.describe 'Seller Fulfillments API', type: :request, swagger_doc: 'api-refeendendend++ post 'Add a delivery' do+ tags 'Fulfillments'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description 'Adds a tracked consignment to the parcel: a second box, or a freight number covering several pallets.'++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '201', 'delivery added' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:fulfillment_id) { fulfillment.prefixed_id }+ let(:body) { { tracking_number: '1Z879E930346834440', carrier: 'ups' } }++ schema '$ref' => '#/components/schemas/Delivery'++ run_test! do |response|+ expect(JSON.parse(response.body)['tracking_number']).to eq('1Z879E930346834440')+ end+ end+ end+ end++ path '/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/deliveries/{id}' do+ parameter name: :order_id, in: :path, type: :string, description: 'Prefixed order ID'+ parameter name: :fulfillment_id, in: :path, type: :string, description: 'Prefixed fulfillment ID'+ parameter name: :id, in: :path, type: :string, description: 'Prefixed delivery ID'++ patch 'Correct a delivery' do+ tags 'Fulfillments'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description 'Corrects the tracking number, carrier or link. A corrected number starts the carrier journey over.'++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '200', 'delivery updated' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:fulfillment_id) { fulfillment.prefixed_id }+ let(:id) { fulfillment.deliveries.first.prefixed_id }+ let(:body) { { tracking_number: 'CORRECTED-1' } }++ schema '$ref' => '#/components/schemas/Delivery'++ run_test! do |response|+ expect(JSON.parse(response.body)['tracking_number']).to eq('CORRECTED-1')+ end+ end+ endendpath '/api/v3/seller/orders/{order_id}/fulfillments/{fulfillment_id}/labels' do@@ -244,6 +307,44 @@ RSpec.describe 'Seller Fulfillments API', type: :request, swagger_doc: 'api-refeendendend++ post 'Upload a shipping label' do+ tags 'Fulfillments'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Records a label the seller bought elsewhere. Upload the file with+ `POST /files` first and send its `signed_id` as `file_signed_id`.+ Buying a label needs the marketplace's carrier account, so a request+ without a file is refused.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '201', 'label recorded' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:order_id) { order.prefixed_id }+ let(:fulfillment_id) { fulfillment.prefixed_id }+ let(:signed_file) do+ ActiveStorage::Blob.create_and_upload!(+ io: StringIO.new("%PDF-1.4\n%label\n"), filename: 'label.pdf', content_type: 'application/pdf',+ service_name: Spree.private_storage_service_name+ ).signed_id+ end+ let(:body) { { file_signed_id: signed_file, tracking_number: 'SELLER-LBL-1', cost: '4.20', currency: 'USD' } }++ before { fulfillment.deliveries.destroy_all }++ schema '$ref' => '#/components/schemas/ShippingLabel'++ run_test! do |response|+ expect(JSON.parse(response.body)['source']).to eq('uploaded')+ end+ end+ endendpath '/api/v3/seller/tracking_carriers' dodiff --git a/spree/api/spec/integration/spree/api/v3/seller/imports_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/imports_spec.rbindex 0e0d4f6bbb..428295b659 100644--- a/spree/api/spec/integration/spree/api/v3/seller/imports_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/imports_spec.rb@@ -7,6 +7,14 @@ RSpec.describe 'Seller Imports API', type: :request, swagger_doc: 'api-referencelet!(:product_import) { create(:product_import, store: store, seller: seller, user: seller_user) }+ def csv_blob(content)+ ActiveStorage::Blob.create_and_upload!(+ io: StringIO.new(content),+ filename: 'import.csv',+ content_type: 'text/csv'+ )+ end+path '/api/v3/seller/imports' doget 'List imports' dotags 'Imports'@@ -33,6 +41,42 @@ RSpec.describe 'Seller Imports API', type: :request, swagger_doc: 'api-referenceendendend++ post 'Create an import' do+ tags 'Imports'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Starts a product CSV import for this seller. Upload the CSV with `POST /files`+ (`visibility: 'private'`) and pass the returned `signed_id` as+ `attachment_signed_id`. On success the import is in the `mapping` state, carrying+ the auto-assigned column `mappings`; confirm them with+ `PATCH /imports/{id}/complete_mapping`. Imported products are created as drafts.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '201', 'import created in mapping state' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:body) do+ {+ type: 'products',+ attachment_signed_id: csv_blob("slug,sku,name,price\nwidget,W-1,Widget,10.00\n").signed_id+ }+ end++ schema SwaggerSchemaHelpers.ref('Import')++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('mapping')+ expect(Spree::Import.find_by_prefix_id(data['id']).seller).to eq(seller)+ end+ end+ endendpath '/api/v3/seller/imports/{import_id}/rows' do@@ -64,4 +108,38 @@ RSpec.describe 'Seller Imports API', type: :request, swagger_doc: 'api-referenceendendend++ path '/api/v3/seller/imports/{id}/complete_mapping' do+ parameter name: :id, in: :path, type: :string, required: true, description: 'Import prefixed ID'++ patch 'Complete mapping and start processing' do+ tags 'Imports'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Applies the submitted column mappings, then starts row processing. Omit `mappings`+ to accept the auto-assigned ones from the create response. Returns 422 when a+ required field is left unmapped (`details.missing_required_fields`).+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)++ response '200', 'mapping completed, processing queued' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:id) do+ product_import.tap { |import| Spree.import_start_mapping_workflow.call(import: import) }.prefixed_id+ end+ let(:body) { { mappings: [{ schema_field: 'name', file_column: 'name' }] } }++ schema SwaggerSchemaHelpers.ref('Import')++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('completed_mapping')+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/seller/invitation_acceptances_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/invitation_acceptances_spec.rbindex 1b683de4b1..5aa0ec4830 100644--- a/spree/api/spec/integration/spree/api/v3/seller/invitation_acceptances_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/invitation_acceptances_spec.rb@@ -76,15 +76,7 @@ RSpec.describe 'Seller Invitation Acceptance API', type: :request, swagger_doc:parameter name: :token, in: :query, type: :string, required: true,description: 'The token from the emailed link'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- password: { type: :string, example: 'password123' },- password_confirmation: { type: :string, example: 'password123' },- first_name: { type: :string, example: 'Robin' },- last_name: { type: :string, example: 'Ellis' }- }- }+ request_body_forresponse '200', 'invitation accepted, session issued' dolet(:id) { invitation.prefixed_id }diff --git a/spree/api/spec/integration/spree/api/v3/seller/me_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/me_spec.rbindex 138a56e0e4..06c5a39a76 100644--- a/spree/api/spec/integration/spree/api/v3/seller/me_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/me_spec.rb@@ -67,15 +67,7 @@ RSpec.describe 'Seller Account API', type: :request, swagger_doc: 'api-reference`email` is identity-bound and cannot be changed here.DESC- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'Ada' },- last_name: { type: :string, example: 'Lovelace' },- selected_locale: { type: :string, example: 'de', description: 'Panel display language, as a code the panel ships.' },- avatar_signed_id: { type: :string, nullable: true, description: 'The `signed_id` returned by POST /files, or `null` to remove the photo.' }- }- }+ request_body_forresponse '200', 'account updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/onboarding_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/onboarding_spec.rbindex b4708c819b..6b5b23c32e 100644--- a/spree/api/spec/integration/spree/api/v3/seller/onboarding_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/onboarding_spec.rb@@ -104,4 +104,33 @@ RSpec.describe 'Seller Onboarding API', type: :request, swagger_doc: 'api-refereendendend++ path '/api/v3/seller/onboarding/payout_account' do+ post 'Get a payout account link' do+ tags 'Onboarding'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ A fresh link to wherever the marketplace's payout provider collects+ what it needs before it will pay this seller. Ask for it when the+ seller acts: these links are short-lived and single-use. Answers+ `{ "url": null }` when the provider hosts no onboarding.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '200', 'payout account link' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:panel) { Spree::Sellers::PanelUrl.call(store: store) }+ let(:body) { { refresh_url: "#{panel}/onboarding", return_url: "#{panel}/onboarding?done=1" } }++ run_test! do |response|+ expect(JSON.parse(response.body)).to have_key('url')+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/seller/orders_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/orders_spec.rbindex 1959f8a5bf..ab74b91582 100644--- a/spree/api/spec/integration/spree/api/v3/seller/orders_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/orders_spec.rb@@ -122,22 +122,7 @@ RSpec.describe 'Seller Orders API', type: :request, swagger_doc: 'api-reference/DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- cancel_reason_id: {- type: :string,- nullable: true,- description: 'A reason from GET /order_cancellation_reasons'- },- cancel_note: { type: :string, nullable: true, description: 'Free text beside the reason' },- refund_payments: {- type: :boolean,- description: "Hand back what the buyer paid for this order's goods"- },- notify_customer: { type: :boolean, description: 'Email the customer about the cancellation' }- }- }+ request_body_for(required: false)response '200', 'order canceled' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -173,33 +158,8 @@ RSpec.describe 'Seller Orders API', type: :request, swagger_doc: 'api-reference/nothing else about it, its totals included, is the seller's to change.DESC- address_correction = {- type: :object,- description: 'Only the lines that change; the rest is carried over',- properties: {- first_name: { type: :string },- last_name: { type: :string },- company: { type: :string, nullable: true },- address1: { type: :string },- address2: { type: :string, nullable: true },- city: { type: :string },- postal_code: { type: :string },- country_code: { type: :string },- state_code: { type: :string, nullable: true },- state_name: { type: :string, nullable: true },- phone: { type: :string, nullable: true },- label: { type: :string, nullable: true }- }- }-parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: true, schema: {- type: :object,- properties: {- shipping_address: address_correction,- billing_address: address_correction- }- }+ request_body_forresponse '200', 'address corrected' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -267,21 +227,7 @@ RSpec.describe 'Seller Orders API', type: :request, swagger_doc: 'api-reference/DESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: true, schema: {- type: :object,- properties: {- customer_note: {- type: :string,- nullable: true,- description: "What the buyer asked for"- },- internal_note: {- type: :string,- nullable: true,- description: "The seller's own working note, as HTML"- }- }- }+ request_body_forresponse '200', 'notes updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/package_types_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/package_types_spec.rbindex 989fdcc845..ab17a3e086 100644--- a/spree/api/spec/integration/spree/api/v3/seller/package_types_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/package_types_spec.rb@@ -72,23 +72,7 @@ RSpec.describe 'Seller Package Types API', type: :request, swagger_doc: 'api-refDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string },- kind: { type: :string, enum: Spree::PackageType::KINDS },- length: { type: :number, nullable: true },- width: { type: :number, nullable: true },- height: { type: :number, nullable: true },- dimensions_unit: { type: :string, nullable: true },- weight: { type: :number, nullable: true, description: "The empty package's own weight, added to every quote" },- max_weight: { type: :number, nullable: true },- weight_unit: { type: :string, nullable: true },- default: { type: :boolean },- metadata: { type: :object, nullable: true }- },- required: %w[name kind]- }+ request_body_forresponse '201', 'package type created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -167,22 +151,7 @@ RSpec.describe 'Seller Package Types API', type: :request, swagger_doc: 'api-refDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: true, schema: {- type: :object,- properties: {- name: { type: :string },- kind: { type: :string, enum: Spree::PackageType::KINDS },- length: { type: :number, nullable: true },- width: { type: :number, nullable: true },- height: { type: :number, nullable: true },- dimensions_unit: { type: :string, nullable: true },- weight: { type: :number, nullable: true },- max_weight: { type: :number, nullable: true },- weight_unit: { type: :string, nullable: true },- default: { type: :boolean },- metadata: { type: :object, nullable: true }- }- }+ request_body_forresponse '200', 'package type updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/password_resets_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/password_resets_spec.rbindex 772dc0c38b..47391ff208 100644--- a/spree/api/spec/integration/spree/api/v3/seller/password_resets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/password_resets_spec.rb@@ -27,18 +27,7 @@ RSpec.describe 'Seller Password Resets API', type: :request, swagger_doc: 'api-rto webhook endpoints.DESC- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- redirect_url: {- type: :string,- example: 'https://sellers.your-store.com/reset-password',- description: 'Must match an allowed origin of the store; ignored otherwise.'- }- },- required: %w[email]- }+ request_body_forresponse '202', 'reset requested' dolet(:body) { { email: seller_user.email } }@@ -67,14 +56,7 @@ RSpec.describe 'Seller Password Resets API', type: :request, swagger_doc: 'api-rDESCparameter name: :id, in: :path, type: :string, description: 'The reset token from the emailed link'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- password: { type: :string, example: 'new-password-123' },- password_confirmation: { type: :string, example: 'new-password-123' }- },- required: %w[password password_confirmation]- }+ request_body_forresponse '200', 'password reset' dolet(:id) { seller_user.generate_token_for(:password_reset) }diff --git a/spree/api/spec/integration/spree/api/v3/seller/policies_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/policies_spec.rbindex 44f9c0b171..d91bc76924 100644--- a/spree/api/spec/integration/spree/api/v3/seller/policies_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/policies_spec.rb@@ -65,15 +65,7 @@ RSpec.describe 'Seller Policies API', type: :request, swagger_doc: 'api-referencDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Shipping Policy' },- slug: { type: :string, example: 'shipping-policy' },- body: { type: :string, example: '<p>Orders leave the workshop within two working days.</p>' }- },- required: %w[name]- }+ request_body_forresponse '201', 'policy created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -135,14 +127,7 @@ RSpec.describe 'Seller Policies API', type: :request, swagger_doc: 'api-referencdescription 'Rewrites one of this seller\'s policies.'parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string },- slug: { type: :string },- body: { type: :string }- }- }+ request_body_forresponse '200', 'policy updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/products_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/products_spec.rbindex 73591cd5de..cff06e0b6a 100644--- a/spree/api/spec/integration/spree/api/v3/seller/products_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/products_spec.rb@@ -61,34 +61,7 @@ RSpec.describe 'Seller Products API', type: :request, swagger_doc: 'api-referencDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Hand-thrown mug' },- description: { type: :string },- slug: { type: :string, example: 'hand-thrown-mug' },- status: { type: :string, example: 'draft' },- meta_title: { type: :string },- meta_description: { type: :string },- meta_keywords: { type: :string },- product_type_id: { type: :string, example: 'ptype_abc123' },- tags: { type: :array, items: { type: :string }, example: %w[ceramics handmade] },- category_ids: { type: :array, items: { type: :string }, example: ['cat_abc123'] },- metadata: { type: :object, additionalProperties: true },- prices: {- type: :array,- items: {- type: :object,- properties: {- amount: { type: :string, example: '24.00' },- compare_at_amount: { type: :string, example: '30.00' },- currency: { type: :string, example: 'USD' }- }- }- }- },- required: %w[name]- }+ request_body_forresponse '201', 'product created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -160,18 +133,7 @@ RSpec.describe 'Seller Products API', type: :request, swagger_doc: 'api-referencdescription 'Edits a product the acting seller owns.'parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Hand-thrown mug, large' },- description: { type: :string },- slug: { type: :string },- status: { type: :string, example: 'active' },- tags: { type: :array, items: { type: :string } },- category_ids: { type: :array, items: { type: :string } },- metadata: { type: :object, additionalProperties: true }- }- }+ request_body_forresponse '200', 'product updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -204,4 +166,59 @@ RSpec.describe 'Seller Products API', type: :request, swagger_doc: 'api-referencendendend++ path '/api/v3/seller/products/bulk_submit' do+ post 'Submit products for review' do+ tags 'Products'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Submits a selection for the marketplace to review. Only drafts and+ rejected listings can be submitted, so a mixed selection moves what it+ can: `product_count` is what was submitted, and `skipped_count`, present+ only when something was skipped, is the rest.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '200', 'products submitted' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let!(:draft) { create(:product, store: store, seller: seller, status: 'draft') }+ let(:body) { { ids: [draft.prefixed_id] } }++ run_test! do |response|+ expect(JSON.parse(response.body)['product_count']).to eq(1)+ end+ end+ end+ end++ path '/api/v3/seller/products/bulk_status_update' do+ post 'Change the status of products' do+ tags 'Products'+ consumes 'application/json'+ produces 'application/json'+ security [bearer_auth: []]+ description <<~DESC+ Moves a selection to `draft` or `archived`. There is no bulk route onto+ `active`: a listing goes on sale when the marketplace approves it.+ DESC++ parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for++ response '200', 'statuses changed' do+ let(:Authorization) { "Bearer #{seller_jwt_token}" }+ let(:'X-Spree-Seller-Id') { seller.prefixed_id }+ let(:body) { { ids: [product.prefixed_id], status: 'archived' } }++ run_test! do |response|+ expect(JSON.parse(response.body)['product_count']).to eq(1)+ end+ end+ end+ endenddiff --git a/spree/api/spec/integration/spree/api/v3/seller/profile_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/profile_spec.rbindex 84b509840a..c4a722e6ba 100644--- a/spree/api/spec/integration/spree/api/v3/seller/profile_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/profile_spec.rb@@ -70,32 +70,7 @@ RSpec.describe 'Seller Profile API', type: :request, swagger_doc: 'api-referenceDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Acme Supplies' },- contact_email: { type: :string, format: 'email', nullable: true, example: '[email protected]' },- billing_email: { type: :string, format: 'email', nullable: true, example: '[email protected]' },- about: { type: :string, nullable: true, description: 'Sanitized HTML — the seller\'s public description' },- legal_name: { type: :string, nullable: true, description: 'The business a commission invoice is made out to' },- registration_number: { type: :string, nullable: true },- logo_signed_id: { type: :string, nullable: true, description: 'The `signed_id` returned by POST /files; `null` removes the image' },- square_logo_signed_id: { type: :string, nullable: true },- cover_photo_signed_id: { type: :string, nullable: true },- accept_terms: { type: :boolean, description: 'Stamps acceptance of the marketplace terms' },- billing_address: { type: :object, additionalProperties: true },- custom_fields: {- type: :array,- items: {- type: :object,- properties: {- custom_field_definition_id: { type: :string, example: 'cfd_abc123' },- value: { description: 'Any JSON value the definition accepts' }- }- }- }- }- }+ request_body_forresponse '200', 'profile updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/requirement_submissions_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/requirement_submissions_spec.rbindex 40fee4cad5..397ec9d6e1 100644--- a/spree/api/spec/integration/spree/api/v3/seller/requirement_submissions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/requirement_submissions_spec.rb@@ -39,14 +39,7 @@ RSpec.describe 'Seller Requirement Submissions API', type: :request, swagger_docDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- note: { type: :string, description: 'Anything the seller wants to say alongside the submission' },- reference: { type: :string, description: 'A reference number or external identifier, for requirements that ask for one' },- file_signed_id: { type: :string, description: 'The `signed_id` returned by POST /files, for requirements that ask for a document' }- }- }+ request_body_forresponse '201', 'submission recorded' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/returns_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/returns_spec.rbindex 382986a514..cff9c80e9e 100644--- a/spree/api/spec/integration/spree/api/v3/seller/returns_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/returns_spec.rb@@ -71,26 +71,7 @@ RSpec.describe 'Seller Returns API', type: :request, swagger_doc: 'api-referenceDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- items: {- type: :array,- items: {- type: :object,- properties: {- fulfillment_item_id: { type: :string },- quantity: { type: :integer }- },- required: %w[fulfillment_item_id quantity]- }- },- reason_id: { type: :string, nullable: true },- stock_location_id: { type: :string, nullable: true },- memo: { type: :string, nullable: true }- },- required: %w[items]- }+ request_body_forresponse '201', 'return opened' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -159,23 +140,7 @@ RSpec.describe 'Seller Returns API', type: :request, swagger_doc: 'api-referenceDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- items: {- type: :array,- items: {- type: :object,- properties: {- return_line_item_id: { type: :string },- quantity: { type: :integer },- resellable: { type: :boolean }- },- required: %w[return_line_item_id quantity]- }- }- }- }+ request_body_for(required: false)response '200', 'return received' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -212,13 +177,7 @@ RSpec.describe 'Seller Returns API', type: :request, swagger_doc: 'api-referenceDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- amount: { type: :string, nullable: true },- refund_method: { type: :string, enum: %w[original_payment store_credit] }- }- }+ request_body_for(required: false)response '200', 'return refunded' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -260,17 +219,20 @@ RSpec.describe 'Seller Returns API', type: :request, swagger_doc: 'api-referencepatch 'Cancel a return' dotags 'Returns'+ consumes 'application/json'produces 'application/json'security [bearer_auth: []]description 'Calls the return off.'parameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true+ request_body_for(required: false)response '200', 'return canceled' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }let(:'X-Spree-Seller-Id') { seller.prefixed_id }let(:order_id) { order.prefixed_id }let(:id) { return_record.prefixed_id }+ let(:body) { { reason: 'Customer decided to keep the goods' } }schema '$ref' => '#/components/schemas/Return'diff --git a/spree/api/spec/integration/spree/api/v3/seller/stock_locations_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/stock_locations_spec.rbindex cebfff2caf..5f1064e608 100644--- a/spree/api/spec/integration/spree/api/v3/seller/stock_locations_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/stock_locations_spec.rb@@ -62,25 +62,7 @@ RSpec.describe 'Seller Stock Locations API', type: :request, swagger_doc: 'api-rDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Main warehouse' },- company: { type: :string, nullable: true },- address1: { type: :string, nullable: true, example: '1 Kiln Lane' },- address2: { type: :string, nullable: true },- city: { type: :string, nullable: true, example: 'Portland' },- zipcode: { type: :string, nullable: true, example: '97205' },- country_code: { type: :string, nullable: true, example: 'US' },- state_code: { type: :string, nullable: true, example: 'OR' },- state_name: { type: :string, nullable: true },- phone: { type: :string, nullable: true },- active: { type: :boolean, description: 'Set `false` to retire a location — there is no delete' },- default: { type: :boolean },- kind: { type: :string, example: 'warehouse' }- },- required: %w[name]- }+ request_body_forresponse '201', 'stock location created' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -156,20 +138,7 @@ RSpec.describe 'Seller Stock Locations API', type: :request, swagger_doc: 'api-rDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Main warehouse' },- address1: { type: :string, nullable: true },- city: { type: :string, nullable: true },- zipcode: { type: :string, nullable: true },- country_code: { type: :string, nullable: true },- state_code: { type: :string, nullable: true },- phone: { type: :string, nullable: true },- active: { type: :boolean },- default: { type: :boolean }- }- }+ request_body_forresponse '200', 'stock location updated' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/tax_identifiers_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/tax_identifiers_spec.rbindex 61c6ccdd84..4ee9b3f64d 100644--- a/spree/api/spec/integration/spree/api/v3/seller/tax_identifiers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/tax_identifiers_spec.rb@@ -56,14 +56,7 @@ RSpec.describe 'Seller Tax Identifiers API', type: :request, swagger_doc: 'api-rDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- kind: { type: :string, example: 'eu_vat' },- value: { type: :string, example: 'DE100000008' }- },- required: %w[kind value]- }+ request_body_forresponse '201', 'registration recorded' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }@@ -97,13 +90,7 @@ RSpec.describe 'Seller Tax Identifiers API', type: :request, swagger_doc: 'api-rDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- kind: { type: :string, example: 'eu_vat' },- value: { type: :string, example: 'DE100000016' }- }- }+ request_body_forresponse '200', 'registration corrected' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/seller/team_spec.rb b/spree/api/spec/integration/spree/api/v3/seller/team_spec.rbindex cd32f2e016..bfdead1d37 100644--- a/spree/api/spec/integration/spree/api/v3/seller/team_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/seller/team_spec.rb@@ -60,13 +60,7 @@ RSpec.describe 'Seller Team API', type: :request, swagger_doc: 'api-reference/seDESCparameter name: 'X-Spree-Seller-Id', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' }- },- required: %w[email]- }+ request_body_forresponse '201', 'invitation sent' dolet(:Authorization) { "Bearer #{seller_jwt_token}" }diff --git a/spree/api/spec/integration/spree/api/v3/store/addresses_spec.rb b/spree/api/spec/integration/spree/api/v3/store/addresses_spec.rbindex 718febf338..d3dc155872 100644--- a/spree/api/spec/integration/spree/api/v3/store/addresses_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/addresses_spec.rb@@ -63,25 +63,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'John' },- last_name: { type: :string, example: 'Doe' },- address1: { type: :string, example: '123 Main St' },- address2: { type: :string, example: 'Apt 4B' },- city: { type: :string, example: 'New York' },- postal_code: { type: :string, example: '10001' },- phone: { type: :string, example: '+1 555 123 4567' },- company: { type: :string, example: 'Acme Inc' },- country_code: { type: :string, example: 'US', description: 'ISO 3166-1 alpha-2 country code (e.g., "US", "DE")' },- state_code: { type: :string, example: 'NY', description: 'ISO 3166-2 subdivision code without country prefix (e.g., "CA", "NY")' },- state_name: { type: :string, example: 'New York', description: 'State name - for countries without predefined states' },- is_default_billing: { type: :boolean, example: true, description: 'Set as default billing address' },- is_default_shipping: { type: :boolean, example: true, description: 'Set as default shipping address' }- },- required: %w[first_name last_name address1 city postal_code country_code]- }+ request_body_forresponse '201', 'address created' dolet(:'x-spree-api-key') { api_key.token }@@ -168,17 +150,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'John' },- last_name: { type: :string, example: 'Doe' },- address1: { type: :string, example: '456 Oak Ave' },- city: { type: :string, example: 'Los Angeles' },- is_default_billing: { type: :boolean, example: true, description: 'Set as default billing address' },- is_default_shipping: { type: :boolean, example: true, description: 'Set as default shipping address' }- }- }+ request_body_forresponse '200', 'address updated' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/auth_spec.rb b/spree/api/spec/integration/spree/api/v3/store/auth_spec.rbindex 794b15011f..1667940d8f 100644--- a/spree/api/spec/integration/spree/api/v3/store/auth_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/auth_spec.rb@@ -121,13 +121,7 @@ RSpec.describe 'Authentication API', type: :request, swagger_doc: 'api-referencesdk_example 'auth/refresh'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- refresh_token: { type: :string, description: 'Refresh token from login response' }- },- required: %w[refresh_token]- }+ request_body_forresponse '200', 'token refreshed' dolet(:'x-spree-api-key') { api_key.token }@@ -166,12 +160,7 @@ RSpec.describe 'Authentication API', type: :request, swagger_doc: 'api-referencesdk_example 'auth/logout'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- refresh_token: { type: :string, description: 'Refresh token to revoke' }- }- }+ request_body_forresponse '204', 'logout successful' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/cart_po_document_spec.rb b/spree/api/spec/integration/spree/api/v3/store/cart_po_document_spec.rbnew file mode 100644index 0000000000..7f13e77bc0--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/store/cart_po_document_spec.rb@@ -0,0 +1,55 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Cart Purchase Order Document API', type: :request, swagger_doc: 'api-reference/store.yaml' do+ include_context 'API v3 Store'++ let(:cart) { create(:cart_with_line_items, store: store, customer: user) }++ path '/api/v3/store/carts/{cart_id}/po_document' do+ parameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'++ post 'Upload a purchase order document' do+ tags 'Carts'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Prepares an upload for the buyer's signed purchase order document. Send the+ file's metadata, then `PUT` the bytes to `upload.url` with exactly+ `upload.headers`, and attach the file by sending the returned `signed_id` as+ `po_document_signed_id` on a cart update. Files are stored privately.+ `checksum` is the file's MD5 digest, base64-encoded. Returns 422 when the+ declared size or type is not accepted for a purchase order.+ DESC++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: false+ parameter name: 'x-spree-token', in: :header, type: :string, required: false+ request_body_for++ response '201', 'upload target created' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:cart_id) { cart.prefixed_id }+ let(:body) do+ {+ filename: 'purchase-order.pdf',+ content_type: 'application/pdf',+ byte_size: 48_210,+ checksum: Digest::MD5.base64digest('purchase order')+ }+ end++ schema SwaggerSchemaHelpers.ref('FileUpload')++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['signed_id']).to be_present+ expect(data['visibility']).to eq('private')+ end+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/store/cart_tax_identifier_spec.rb b/spree/api/spec/integration/spree/api/v3/store/cart_tax_identifier_spec.rbnew file mode 100644index 0000000000..a5de334a6b--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/store/cart_tax_identifier_spec.rb@@ -0,0 +1,45 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Cart Tax Identifier API', type: :request, swagger_doc: 'api-reference/store.yaml' do+ include_context 'API v3 Store'++ let(:cart) { create(:cart_with_line_items, store: store, customer: user) }++ path '/api/v3/store/carts/{cart_id}/tax_identifier' do+ parameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'++ patch 'Set the cart tax identifier' do+ tags 'Carts'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description <<~DESC+ Sets the tax registration this cart is taxed against, overriding the one on the+ customer's profile — for a buyer paying through a different company than the one+ on their account. Send both `kind` and `value` every time. The cart's totals are+ recalculated. Returns 201 when the cart had no override yet, 200 when it replaced one.+ DESC++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: false+ parameter name: 'x-spree-token', in: :header, type: :string, required: false+ request_body_for++ response '201', 'tax identifier set' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:cart_id) { cart.prefixed_id }+ let(:body) { { kind: 'eu_vat', value: TaxIdentifierValidatorHelpers.eu_vat_number(0) } }++ schema '$ref' => '#/components/schemas/TaxIdentifier'++ run_test! do |response|+ expect(JSON.parse(response.body)['kind']).to eq('eu_vat')+ expect(cart.reload.tax_identifier).to be_present+ end+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/store/carts_spec.rb b/spree/api/spec/integration/spree/api/v3/store/carts_spec.rbindex 29723ddd51..1d31055bff 100644--- a/spree/api/spec/integration/spree/api/v3/store/carts_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/carts_spec.rb@@ -70,25 +70,7 @@ RSpec.describe 'Carts API', type: :request, swagger_doc: 'api-reference/store.yaparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: false,description: 'Bearer JWT token (optional - for authenticated customers)'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- metadata: { type: :object, description: 'Write-only key-value metadata (Stripe-style).' },- items: {- type: :array,- description: 'Items to add to the cart on creation',- items: {- type: :object,- properties: {- variant_id: { type: :string, example: 'variant_abc123', description: 'Prefixed variant ID' },- quantity: { type: :integer, example: 2, description: 'Quantity (defaults to 1)' },- metadata: { type: :object, additionalProperties: true }- },- required: %w[variant_id]- }- }- }- }+ request_body_for(required: false)parameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'@@ -200,36 +182,7 @@ RSpec.describe 'Carts API', type: :request, swagger_doc: 'api-reference/store.yaparameter name: 'x-spree-token', in: :header, type: :string, required: falseparameter name: 'Idempotency-Key', in: :header, type: :string, required: falseparameter name: :id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- customer_note: { type: :string, example: 'Leave at door' },- metadata: { type: :object, additionalProperties: true },- shipping_address_id: { type: :string, description: 'Existing address ID to use as shipping address', example: 'addr_abc123' },- billing_address_id: { type: :string, description: 'Existing address ID to use as billing address', example: 'addr_def456' },- billing_address: {- type: :object,- properties: {- first_name: { type: :string }, last_name: { type: :string },- address1: { type: :string }, address2: { type: :string },- city: { type: :string }, postal_code: { type: :string },- phone: { type: :string }, company: { type: :string },- country_code: { type: :string }, state_code: { type: :string }- }- },- shipping_address: {- type: :object,- properties: {- first_name: { type: :string }, last_name: { type: :string },- address1: { type: :string }, address2: { type: :string },- city: { type: :string }, postal_code: { type: :string },- phone: { type: :string }, company: { type: :string },- country_code: { type: :string }, state_code: { type: :string }- }- }- }- }+ request_body_forresponse '200', 'cart updated' dolet!(:order) { create(:cart_with_line_items, store: store, customer: user) }diff --git a/spree/api/spec/integration/spree/api/v3/store/claims_spec.rb b/spree/api/spec/integration/spree/api/v3/store/claims_spec.rbindex cf62b5be9e..33f9f7bbee 100644--- a/spree/api/spec/integration/spree/api/v3/store/claims_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/claims_spec.rb@@ -36,5 +36,41 @@ RSpec.describe 'Order Claims API', type: :request, swagger_doc: 'api-reference/sendendend++ post 'Open a claim' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Reports a damaged, missing or wrong item on one of the customer\'s orders. Approving, denying and resolving it are the merchant\'s. Accessible via JWT or the order token header for guests.'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: false,+ description: 'Bearer token for authenticated customers'+ parameter name: 'x-spree-token', in: :header, type: :string, required: false,+ description: 'Order token for guest access'+ request_body_for++ response '201', 'claim opened' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:claimable_order) { create(:shipped_order, store: store, customer: user) }+ let(:order_id) { claimable_order.prefixed_id }+ let(:claim_reason) { create(:claim_reason, store: store) }+ let(:body) do+ {+ items: [{ line_item_id: claimable_order.line_items.first.prefixed_id, quantity: 1, description: 'Arrived with a cracked screen' }],+ reason_id: claim_reason.prefixed_id,+ memo: 'Box was crushed in transit'+ }+ end++ schema '$ref' => '#/components/schemas/Claim'++ run_test! do |response|+ expect(JSON.parse(response.body)['id']).to start_with('claim_')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/store/companies_spec.rb b/spree/api/spec/integration/spree/api/v3/store/companies_spec.rbindex 6c4dd61c0a..6089cdbd1f 100644--- a/spree/api/spec/integration/spree/api/v3/store/companies_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/companies_spec.rb@@ -92,10 +92,7 @@ RSpec.describe 'Company Self-Service API', type: :request, swagger_doc: 'api-refparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: { name: { type: :string, example: 'Acme Industrial Group' } }- }+ request_body_forresponse '200', 'company updated' dolet!(:membership) { create(:company_membership, company: company, customer: user) }@@ -153,11 +150,7 @@ RSpec.describe 'Company Self-Service API', type: :request, swagger_doc: 'api-refparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: { customer_email: { type: :string, example: '[email protected]' } },- required: ['customer_email']- }+ request_body_forresponse '201', 'invitation sent' dolet!(:membership) { create(:company_membership, company: company, customer: user) }@@ -243,13 +236,7 @@ RSpec.describe 'Company Self-Service API', type: :request, swagger_doc: 'api-refparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- label: { type: :string, example: 'Northern Warehouse' },- default_shipping: { type: :boolean, example: true }- }- }+ request_body_forresponse '200', 'address book entry updated' dolet!(:membership) { create(:company_membership, company: company, customer: user) }@@ -396,15 +383,7 @@ RSpec.describe 'Company Self-Service API', type: :request, swagger_doc: 'api-refsdk_example 'company-invitations/accept'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'Ada' },- last_name: { type: :string, example: 'Lovelace' },- password: { type: :string, example: 'a-strong-password' },- password_confirmation: { type: :string, example: 'a-strong-password' }- }- }+ request_body_forresponse '201', 'membership created' dolet!(:invitation) { create(:company_invitation, company: company, email: '[email protected]') }diff --git a/spree/api/spec/integration/spree/api/v3/store/customer/password_resets_spec.rb b/spree/api/spec/integration/spree/api/v3/store/customer/password_resets_spec.rbindex 7634a9e7f1..09f88d41b8 100644--- a/spree/api/spec/integration/spree/api/v3/store/customer/password_resets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/customer/password_resets_spec.rb@@ -18,14 +18,7 @@ RSpec.describe 'Password Resets API', type: :request, swagger_doc: 'api-referencsdk_example 'customer-password-resets/create'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]', description: 'Email address of the account to reset' },- redirect_url: { type: :string, format: 'uri', example: 'https://myshop.com/reset-password', description: 'URL to redirect the user to after clicking the reset link. Validated against the store\'s allowed origins.' }- },- required: %w[email]- }+ request_body_forresponse '202', 'password reset requested' dolet(:'x-spree-api-key') { api_key.token }@@ -81,14 +74,7 @@ RSpec.describe 'Password Resets API', type: :request, swagger_doc: 'api-referencparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: :token, in: :path, type: :string, required: true,description: 'Password reset token from the email'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- password: { type: :string, minLength: 6, example: 'newsecurepassword' },- password_confirmation: { type: :string, example: 'newsecurepassword' }- },- required: %w[password password_confirmation]- }+ request_body_forresponse '200', 'password reset successful' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/customers_spec.rb b/spree/api/spec/integration/spree/api/v3/store/customers_spec.rbindex 22460a9863..25488605cd 100644--- a/spree/api/spec/integration/spree/api/v3/store/customers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/customers_spec.rb@@ -18,20 +18,7 @@ RSpec.describe 'Customers API', type: :request, swagger_doc: 'api-reference/storsdk_example 'customers/create'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- password: { type: :string, minLength: 6, example: 'password123' },- password_confirmation: { type: :string, example: 'password123' },- first_name: { type: :string, example: 'John' },- last_name: { type: :string, example: 'Doe' },- phone: { type: :string, example: '+1234567890' },- accepts_email_marketing: { type: :boolean, example: true },- metadata: { type: :object, example: { source: 'storefront' } }- },- required: %w[email password]- }+ request_body_forresponse '201', 'registration successful' dolet(:'x-spree-api-key') { api_key.token }@@ -140,19 +127,7 @@ RSpec.describe 'Customers API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- first_name: { type: :string, example: 'John' },- last_name: { type: :string, example: 'Doe' },- email: { type: :string, format: 'email', example: '[email protected]' },- password: { type: :string, example: 'newpassword123' },- password_confirmation: { type: :string, example: 'newpassword123' },- accepts_email_marketing: { type: :boolean, example: true },- phone: { type: :string, example: '+1 555 123 4567' },- metadata: { type: :object, example: { preferred_contact: 'email' } }- }- }+ request_body_forresponse '200', 'profile updated' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/data_requests_spec.rb b/spree/api/spec/integration/spree/api/v3/store/data_requests_spec.rbindex 473acff3c5..907257da37 100644--- a/spree/api/spec/integration/spree/api/v3/store/data_requests_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/data_requests_spec.rb@@ -52,13 +52,7 @@ RSpec.describe 'Data Requests API', type: :request, swagger_doc: 'api-reference/parameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- kind: { type: :string, enum: %w[access erasure], description: 'Defaults to access' },- current_password: { type: :string, description: 'Required for erasure' }- }- }+ request_body_for(required: false)response '202', 'request accepted' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/discount_codes_spec.rb b/spree/api/spec/integration/spree/api/v3/store/discount_codes_spec.rbindex fc1bd495b3..a012ca973e 100644--- a/spree/api/spec/integration/spree/api/v3/store/discount_codes_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/discount_codes_spec.rb@@ -30,13 +30,7 @@ RSpec.describe 'Cart Discount Codes API', type: :request, swagger_doc: 'api-refeparameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID (e.g., cart_abc123)'parameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- code: { type: :string, example: 'SAVE10', description: 'Promotion discount code to apply' }- },- required: %w[code]- }+ request_body_forresponse '201', 'discount code applied' dolet!(:promotion) { create(:promotion_with_item_adjustment, code: 'SAVE10') }diff --git a/spree/api/spec/integration/spree/api/v3/store/fulfillments_spec.rb b/spree/api/spec/integration/spree/api/v3/store/fulfillments_spec.rbindex e93c945016..72cfef0cd7 100644--- a/spree/api/spec/integration/spree/api/v3/store/fulfillments_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/fulfillments_spec.rb@@ -33,13 +33,7 @@ RSpec.describe 'Cart Fulfillments API', type: :request, swagger_doc: 'api-refereparameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'parameter name: :id, in: :path, type: :string, required: true, description: 'Fulfillment ID'parameter name: 'x-spree-token', in: :header, type: :string, required: false, description: 'Order token for guest access'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- selected_delivery_rate_id: { type: :string, example: 'dr_abc123', description: 'Delivery rate ID to select' }- },- required: %w[selected_delivery_rate_id]- }+ request_body_forresponse '200', 'delivery rate selected, returns updated cart' dolet(:delivery_rate) { fulfillment.delivery_rates.first }diff --git a/spree/api/spec/integration/spree/api/v3/store/gift_card_cart_spec.rb b/spree/api/spec/integration/spree/api/v3/store/gift_card_cart_spec.rbindex 05d464851a..2e9f69208f 100644--- a/spree/api/spec/integration/spree/api/v3/store/gift_card_cart_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/gift_card_cart_spec.rb@@ -31,13 +31,7 @@ RSpec.describe 'Cart Gift Card API', type: :request, swagger_doc: 'api-referenceparameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID (e.g., cart_abc123)'parameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- code: { type: :string, example: 'GC-ABCD-1234', description: 'Gift card code to apply' }- },- required: %w[code]- }+ request_body_forresponse '201', 'gift card applied' dolet!(:gift_card) { create(:gift_card, store: store, amount: 50, code: 'giftcode1') }diff --git a/spree/api/spec/integration/spree/api/v3/store/line_items_spec.rb b/spree/api/spec/integration/spree/api/v3/store/line_items_spec.rbindex a3108c5a23..da7b0ee829 100644--- a/spree/api/spec/integration/spree/api/v3/store/line_items_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/line_items_spec.rb@@ -29,15 +29,7 @@ RSpec.describe 'Cart Items API', type: :request, swagger_doc: 'api-reference/stoparameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID (e.g., cart_abc123)'parameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- variant_id: { type: :string, example: 'variant_abc123', description: 'Variant ID to add' },- quantity: { type: :integer, example: 2, description: 'Quantity to add (default: 1)' },- metadata: { type: :object, additionalProperties: true, description: 'Arbitrary key-value metadata', example: { gift_message: 'Happy Birthday!' } }- },- required: %w[variant_id]- }+ request_body_forresponse '201', 'item added, returns updated cart' dolet(:new_product) { create(:product) }@@ -128,13 +120,7 @@ RSpec.describe 'Cart Items API', type: :request, swagger_doc: 'api-reference/stoparameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'parameter name: :id, in: :path, type: :string, required: true, description: 'Line item ID'parameter name: 'x-spree-token', in: :header, type: :string, required: false- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- quantity: { type: :integer, minimum: 1, example: 5 },- metadata: { type: :object, additionalProperties: true, description: 'Arbitrary key-value metadata (merged with existing)', example: { engraving: 'J.D.' } }- }- }+ request_body_forresponse '200', 'quantity updated, returns updated cart' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/newsletter_subscribers_spec.rb b/spree/api/spec/integration/spree/api/v3/store/newsletter_subscribers_spec.rbindex 3a96008a29..a97f00daee 100644--- a/spree/api/spec/integration/spree/api/v3/store/newsletter_subscribers_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/newsletter_subscribers_spec.rb@@ -46,19 +46,7 @@ RSpec.describe 'Newsletter Subscribers API', type: :request, swagger_doc: 'api-rparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: false,description: 'Optional Bearer JWT — when present, links the subscription to that customer'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- redirect_url: {- type: :string,- format: 'uri',- example: 'https://your-store.com/newsletter/confirm',- description: 'Storefront URL the verification token should be appended to. Silently omitted from the webhook payload when the store has allowed origins configured and this URL does not match one of them, or when no allowed origins are configured at all.'- }- },- required: %w[email]- }+ request_body_forresponse '201', 'subscription created (or existing returned)' dolet(:'x-spree-api-key') { api_key.token }@@ -172,17 +160,7 @@ RSpec.describe 'Newsletter Subscribers API', type: :request, swagger_doc: 'api-rsdk_example 'newsletter-subscribers/verify'parameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- token: {- type: :string,- example: 'abc123def456',- description: 'Verification token from the confirmation email'- }- },- required: %w[token]- }+ request_body_forresponse '200', 'subscription verified' dolet(:'x-spree-api-key') { api_key.token }@@ -439,17 +417,7 @@ RSpec.describe 'Newsletter Subscribers API', type: :request, swagger_doc: 'api-rDESCparameter name: 'x-spree-api-key', in: :header, type: :string, required: true- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- email: { type: :string, format: 'email', example: '[email protected]' },- redirect_url: {- type: :string,- format: 'uri',- description: 'Storefront URL the unsubscribe token should be appended to in the resulting email. Silently dropped from the event payload if outside the store\'s allowed origins.'- }- }- }+ request_body_for(required: false)response '202', 'event published when the email matches a subscriber' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb b/spree/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rbindex 35e58a8865..b1bb84b7dc 100644--- a/spree/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb@@ -34,15 +34,7 @@ RSpec.describe 'Cart Payment Sessions API', type: :request, swagger_doc: 'api-redescription: 'Order token for guest access'parameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- payment_method_id: { type: :string, example: 'pm_abc123', description: 'Payment method ID' },- amount: { type: :string, example: '99.99', description: 'Payment amount (defaults to order total minus store credits)' },- external_data: { type: :object, description: 'Provider-specific data passed to the gateway' }- },- required: %w[payment_method_id]- }+ request_body_forresponse '201', 'payment session created' dolet(:'x-spree-api-key') { api_key.token }@@ -111,13 +103,7 @@ RSpec.describe 'Cart Payment Sessions API', type: :request, swagger_doc: 'api-resdk_example 'carts/payment-sessions-update'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :string, example: '50.00', description: 'Updated payment amount' },- external_data: { type: :object, description: 'Provider-specific data to update' }- }- }+ request_body_forresponse '200', 'payment session updated' dolet(:'x-spree-api-key') { api_key.token }@@ -154,13 +140,7 @@ RSpec.describe 'Cart Payment Sessions API', type: :request, swagger_doc: 'api-resdk_example 'carts/payment-sessions-complete'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- session_result: { type: :string, description: 'Provider-specific session result token' },- external_data: { type: :object, description: 'Provider-specific completion data' }- }- }+ request_body_forparameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'diff --git a/spree/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb b/spree/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rbindex 36024add94..b247ec74ff 100644--- a/spree/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb@@ -25,14 +25,7 @@ RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-rparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- payment_method_id: { type: :string, example: 'pm_abc123', description: 'Payment method ID' },- external_data: { type: :object, description: 'Provider-specific data passed to the gateway' }- },- required: %w[payment_method_id]- }+ request_body_forresponse '201', 'payment setup session created' dolet(:'x-spree-api-key') { api_key.token }@@ -123,12 +116,7 @@ RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-rsdk_example 'customer-payment-setup-sessions/complete'- parameter name: :body, in: :body, required: false, schema: {- type: :object,- properties: {- external_data: { type: :object, description: 'Provider-specific completion data' }- }- }+ request_body_for(required: false)response '200', 'payment setup session completed' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/payments_spec.rb b/spree/api/spec/integration/spree/api/v3/store/payments_spec.rbindex 868cfd40cb..bf5f29ed44 100644--- a/spree/api/spec/integration/spree/api/v3/store/payments_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/payments_spec.rb@@ -25,15 +25,7 @@ RSpec.describe 'Cart Payments API', type: :request, swagger_doc: 'api-reference/parameter name: :cart_id, in: :path, type: :string, required: true, description: 'Cart prefixed ID'parameter name: 'x-spree-token', in: :header, type: :string, required: false,description: 'Order token for guest access'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- payment_method_id: { type: :string, example: 'pm_abc123', description: 'Payment method ID (must be a non-session payment method)' },- amount: { type: :string, example: '99.99', description: 'Payment amount (defaults to order total minus store credits)' },- metadata: { type: :object, description: 'Arbitrary metadata to attach to the payment' }- },- required: %w[payment_method_id]- }+ request_body_forresponse '201', 'payment created' dolet(:'x-spree-api-key') { api_key.token }diff --git a/spree/api/spec/integration/spree/api/v3/store/returns_spec.rb b/spree/api/spec/integration/spree/api/v3/store/returns_spec.rbindex 5630eb8753..cde9d0f9e1 100644--- a/spree/api/spec/integration/spree/api/v3/store/returns_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/returns_spec.rb@@ -36,5 +36,41 @@ RSpec.describe 'Order Returns API', type: :request, swagger_doc: 'api-reference/endendend++ post 'Open a return' do+ tags 'Orders'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Opens a return for shipped units of one of the customer\'s orders. Approving, receiving and refunding it are the merchant\'s. Accessible via JWT or the order token header for guests.'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: false,+ description: 'Bearer token for authenticated customers'+ parameter name: 'x-spree-token', in: :header, type: :string, required: false,+ description: 'Order token for guest access'+ request_body_for++ response '201', 'return opened' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:returnable_order) { create(:shipped_order, store: store, customer: user) }+ let(:order_id) { returnable_order.prefixed_id }+ let(:return_reason) { create(:return_reason, store: store) }+ let(:body) do+ {+ items: [{ fulfillment_item_id: returnable_order.fulfillment_items.first.prefixed_id, quantity: 1 }],+ reason_id: return_reason.prefixed_id,+ memo: 'Wrong size'+ }+ end++ schema '$ref' => '#/components/schemas/Return'++ run_test! do |response|+ expect(JSON.parse(response.body)['status']).to eq('requested')+ end+ end+ endendenddiff --git a/spree/api/spec/integration/spree/api/v3/store/store_credits_spec.rb b/spree/api/spec/integration/spree/api/v3/store/store_credits_spec.rbindex ac81b619b5..218572719e 100644--- a/spree/api/spec/integration/spree/api/v3/store/store_credits_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/store_credits_spec.rb@@ -25,12 +25,7 @@ RSpec.describe 'Cart Store Credits API', type: :request, swagger_doc: 'api-referparameter name: 'x-spree-token', in: :header, type: :string, required: falseparameter name: 'Idempotency-Key', in: :header, type: :string, required: false,description: 'Unique key for request idempotency.'- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- amount: { type: :number, example: 10.0, description: 'Amount to apply (optional - defaults to max available)' }- }- }+ request_body_forresponse '200', 'store credit applied' dolet(:store_credit_payment_method) { create(:store_credit_payment_method) }diff --git a/spree/api/spec/integration/spree/api/v3/store/wishlists_spec.rb b/spree/api/spec/integration/spree/api/v3/store/wishlists_spec.rbindex 0d959b1e51..5735956ced 100644--- a/spree/api/spec/integration/spree/api/v3/store/wishlists_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/wishlists_spec.rb@@ -64,15 +64,7 @@ RSpec.describe 'Wishlists API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Birthday Ideas' },- is_private: { type: :boolean, example: true },- is_default: { type: :boolean, example: false }- },- required: %w[name]- }+ request_body_forresponse '201', 'wishlist created' dolet(:'x-spree-api-key') { api_key.token }@@ -148,14 +140,7 @@ RSpec.describe 'Wishlists API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: trueparameter name: :id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- name: { type: :string, example: 'Updated Name' },- is_private: { type: :boolean, example: true },- is_default: { type: :boolean, example: false }- }- }+ request_body_forresponse '200', 'wishlist updated' dolet(:'x-spree-api-key') { api_key.token }@@ -205,14 +190,7 @@ RSpec.describe 'Wishlists API', type: :request, swagger_doc: 'api-reference/storparameter name: 'x-spree-api-key', in: :header, type: :string, required: trueparameter name: 'Authorization', in: :header, type: :string, required: trueparameter name: :wishlist_id, in: :path, type: :string, required: true- parameter name: :body, in: :body, schema: {- type: :object,- properties: {- variant_id: { type: :string, example: 'variant_abc123' },- quantity: { type: :integer, example: 1 }- },- required: %w[variant_id]- }+ request_body_forresponse '201', 'item added' dolet(:new_product) { create(:product) }@@ -230,6 +208,34 @@ RSpec.describe 'Wishlists API', type: :request, swagger_doc: 'api-reference/storendpath '/api/v3/store/wishlists/{wishlist_id}/items/{id}' do+ patch 'Update a wishlist item' do+ tags 'Wishlists'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Changes the quantity of a wishlist item, or moves it to another variant'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: true+ parameter name: :wishlist_id, in: :path, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true+ request_body_for++ response '200', 'item updated' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:wishlist_id) { wishlist.to_param }+ let(:id) { wishlist_item.to_param }+ let(:body) { { quantity: 2 } }++ schema '$ref' => '#/components/schemas/WishlistItem'++ run_test! do |response|+ expect(JSON.parse(response.body)['quantity']).to eq(2)+ end+ end+ end+delete 'Remove item from wishlist' dotags 'Wishlists'security [api_key: [], bearer_auth: []]diff --git a/spree/api/spec/services/spree/api/v3/request_schema_spec.rb b/spree/api/spec/services/spree/api/v3/request_schema_spec.rbnew file mode 100644index 0000000000..3e56601d42--- /dev/null+++ b/spree/api/spec/services/spree/api/v3/request_schema_spec.rb@@ -0,0 +1,170 @@+require 'spec_helper'++RSpec.describe Spree::Api::V3::RequestSchema do+ let(:price) do+ described_class.shape('TestPriceParams') do+ string :currency, required: true+ decimal :amount, required: true+ end+ end++ let(:schema) do+ price_shape = price+ described_class.new(:widget) do+ string :name, required: :create, description: 'The name.'+ string :code, required: true+ string :kind, enum: %w[small large], only: :create+ string :tags, array: true+ id :tax_category_id, nullable: true+ object :metadata+ object :prices, array: true, shape: price_shape+ object :main_price, shape: price_shape, description: 'The main price.'+ object :options, array: true do+ string :name, :value, required: true+ end+ any :value+ object :external_references, permit: false+ end+ end++ describe '#permit_list' do+ it 'lists scalars first, then lists, hashes and nested shapes' do+ expect(schema.permit_list(:create)).to eq([+ :name, :code, :kind, :tax_category_id, :value,+ { tags: [] },+ { metadata: {} },+ { prices: [:currency, :amount] },+ { main_price: [:currency, :amount] },+ { options: [:name, :value] },+ { value: [] }, { value: {} }+ ])+ end++ it 'leaves out fields accepted on the other action only' do+ expect(schema.permit_list(:update)).not_to include(:kind)+ end++ it 'leaves out fields the controller reads itself' do+ expect(schema.permit_list(:create).flat_map { |entry| entry.is_a?(Hash) ? entry.keys : entry }).+ not_to include(:external_references)+ end++ it 'permits the declared keys from a request' do+ params = ActionController::Parameters.new(+ name: 'Widget', kind: 'small', tags: %w[a b], metadata: { 'any' => 'thing' },+ prices: [{ currency: 'USD', amount: '1.00', cost: '2' }], value: { 'nested' => [1] }, admin: true+ )++ expect(params.permit(*schema.permit_list(:create)).to_h).to eq(+ 'name' => 'Widget', 'kind' => 'small', 'tags' => %w[a b], 'metadata' => { 'any' => 'thing' },+ 'prices' => [{ 'currency' => 'USD', 'amount' => '1.00' }], 'value' => { 'nested' => [1] }+ )+ end+ end++ describe '#json_schema' do+ subject(:json) { schema.json_schema(:create) }++ it 'requires create-only and always-required fields when creating' do+ expect(json[:required]).to eq(%w[name code])+ expect(schema.json_schema(:update)[:required]).to eq(%w[code])+ end++ it 'describes each kind of value' do+ expect(json[:properties]).to include(+ name: { type: :string, description: 'The name.' },+ kind: { type: :string, enum: %w[small large] },+ tags: { type: :array, items: { type: :string } },+ tax_category_id: { type: :string, nullable: true },+ metadata: { type: :object, additionalProperties: true },+ value: {},+ external_references: { type: :object, additionalProperties: true }+ )+ end++ it 'references shapes, wrapping a described reference' do+ expect(json[:properties][:prices]).to eq(type: :array, items: { '$ref': '#/components/schemas/TestPriceParams' })+ expect(json[:properties][:main_price]).to eq(+ allOf: [{ '$ref': '#/components/schemas/TestPriceParams' }], description: 'The main price.'+ )+ end++ it 'inlines an anonymous nested object' do+ expect(json[:properties][:options]).to eq(+ type: :array,+ items: { type: :object, properties: { name: { type: :string }, value: { type: :string } }, required: %w[name value] }+ )+ end++ it 'sends decimals as canonical strings' do+ expect(price.json_schema[:properties][:amount]).to include(type: :string, format: :decimal)+ end+ end++ describe '#component_name' do+ it 'names a resource schema per action' do+ expect(schema.component_name(:create)).to eq('WidgetCreateParams')+ expect(schema.component_name(:update)).to eq('WidgetUpdateParams')+ end++ it 'keeps a name that already ends in Params' do+ expect(described_class.new('WidgetArchiveParams').component_name(:create)).to eq('WidgetArchiveParams')+ end+ end++ describe '#shapes' do+ it 'lists every named shape once' do+ expect(schema.shapes).to eq([price])+ end+ end++ it 'rejects a field declared twice' do+ expect { described_class.new { string :name, :name } }.to raise_error(ArgumentError, /declared twice/)+ end++ it 'rejects an array of any-key hashes, which Rails cannot permit' do+ expect { described_class.new { object :rows, array: true } }.to raise_error(ArgumentError, /needs a shape/)+ end++ describe 'controller declarations' do+ it 'permits every field a product write accepted before' do+ controller = Spree::Api::V3::Admin::ProductsController.new+ allow(controller).to receive(:action_name).and_return('create')++ expect(controller.send(:resource_permitted_attributes)).to include(+ :name, :status, :promotionable,+ { metadata: {} },+ { variants: a_collection_including(:sku, :preorder_ships_at, { stock_levels: [:id, :stock_location_id, :count_on_hand, :backorderable] }) }+ )+ end+ end++ # The SDK request types are generated from the API reference, so a declared+ # body that no integration spec documents never reaches them. One documented+ # endpoint per body is enough: a body shared by several routes (custom fields+ # under each parent) publishes one type.+ describe 'every declared body' do+ it 'is published in the API reference' do+ references = {}+ missing = Spree::Core::Engine.routes.routes.filter_map do |route|+ controller_path = route.defaults[:controller].to_s+ next unless route.verb.to_s.in?(%w[POST PATCH PUT DELETE]) && controller_path.start_with?('spree/api/v3/')++ controller = "#{controller_path}_controller".camelize.safe_constantize+ schema = controller.try(:request_params_schema, route.defaults[:action])+ next unless schema++ api = controller_path.split('/')[3]+ spec = references[api] ||= YAML.load_file(Rails.root.join("../../../../docs/api-reference/#{api}.yaml"))+ name = schema.component_name(route.defaults[:action])+ next if spec.dig('components', 'schemas', name)++ path = route.path.spec.to_s.delete_suffix('(.:format)')+ "#{api}: #{name} (#{route.verb} #{path} → #{controller.name}##{route.defaults[:action]})"+ end++ expect(missing.uniq(&:split)).to be_empty,+ "add `request_body_for` to an integration spec of:\n#{missing.uniq { |line| line.split(' (').first }.join("\n")}"+ end+ end+enddiff --git a/spree/api/spec/support/request_body_helper.rb b/spree/api/spec/support/request_body_helper.rbnew file mode 100644index 0000000000..cf95c36405--- /dev/null+++ b/spree/api/spec/support/request_body_helper.rb@@ -0,0 +1,57 @@+# Documents a write endpoint's request body from the controller's+# `request_params` declaration, so no integration spec describes a body by hand.+#+# path '/api/v3/admin/products' do+# post 'Create a product' do+# request_body_for+#+# The body references the `<Resource>CreateParams` / `<Resource>UpdateParams`+# component, registered with every shared shape it uses under the spec's+# `components.schemas`. The SDK request types are generated from those+# components.+module RequestBodyHelper+ # @param action [Symbol, nil] the controller action; read from the route+ # when omitted+ # @param controller [Class, nil] resolved from the path when omitted+ # @param required [Boolean] false for an endpoint that accepts no body+ def request_body_for(action = nil, controller: nil, required: true)+ route = request_body_route+ action ||= route[:action].to_sym+ controller ||= "#{route[:controller]}_controller".camelize.constantize+ schema = controller.request_params_schema(action)+ raise "#{controller.name} does not declare request_params for #{action}" unless schema++ name = schema.component_name(action)+ register_request_schema(name, schema.json_schema(action.in?(%i[create update]) ? action : nil))+ schema.shapes.each { |shape| register_request_schema(shape.name, shape.json_schema) }++ parameter name: :body, in: :body, required: required, schema: { '$ref': "#/components/schemas/#{name}" }+ end++ private++ def request_body_route+ path = metadata[:path_item][:template].gsub(/\{[^}]+\}/, 'x1')+ Rails.application.routes.recognize_path(path, method: metadata[:operation][:verb])+ end++ def register_request_schema(name, definition)+ spec = RSpec.configuration.openapi_specs.fetch(metadata[:openapi_spec] || metadata[:swagger_doc])+ schemas = (spec[:components] ||= {})[:schemas] ||= {}+ definition = definition.deep_stringify_keys++ if schemas.key?(name) && schemas[name].deep_stringify_keys != definition+ raise "Two request schemas are named #{name}; name one of the request_params declarations or shapes differently"+ end++ schemas[name] = definition+ # Request schemas follow the response ones, sorted, so the written spec+ # does not depend on the order specs ran in.+ request, response = schemas.partition { |key, _| key.to_s.end_with?('Params') }+ spec[:components][:schemas] = response.to_h.merge(request.sort_by { |key, _| key.to_s }.to_h)+ end+end++RSpec.configure do |config|+ config.extend RequestBodyHelper, type: :request+enddiff --git a/spree/core/app/models/spree/store.rb b/spree/core/app/models/spree/store.rbindex 900a8876cd..2b1d8bd253 100644--- a/spree/core/app/models/spree/store.rb+++ b/spree/core/app/models/spree/store.rb@@ -41,11 +41,13 @@ module Spree## Preferences#+ UNIT_SYSTEMS = %w[metric imperial].freeze+# general preferencespreference :admin_locale, :string, format: :localepreference :timezone, :string, format: :timezone, default: Time.zone.namepreference :weight_unit, :string, default: 'lb', choices: -> { Spree::Variant::WEIGHT_UNITS }- preference :unit_system, :string, default: 'imperial'+ preference :unit_system, :string, default: 'imperial', choices: -> { UNIT_SYSTEMS }# Anonymous identifier of this installation, kept on the default store# (see Spree.install_id). Written by Spree, never by the operator.preference :install_id, :string, internal: true, nullable: true@@ -360,6 +362,8 @@ module Spreevalidates :preferred_default_commission_tax_rate,numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1 }validates :preferred_storefront_access, inclusion: { in: Spree::Channel::Gating::STOREFRONT_ACCESS }+ validates :preferred_unit_system, inclusion: { in: UNIT_SYSTEMS }+ validates :preferred_weight_unit, inclusion: { in: Spree::Variant::WEIGHT_UNITS }validates :preferred_document_number_format,inclusion: { in: Spree::NumberGenerators::Registry::FORMATS.keys }validates :preferred_order_number_sequence_start,diff --git a/spree/core/spec/models/spree/store_spec.rb b/spree/core/spec/models/spree/store_spec.rbindex 77cb028bb8..3e7dc887b9 100644--- a/spree/core/spec/models/spree/store_spec.rb+++ b/spree/core/spec/models/spree/store_spec.rb@@ -918,6 +918,19 @@ describe Spree::Store, type: :model, without_global_store: true doendend+ describe 'units' do+ let(:store) { build(:store) }++ it 'rejects a unit system or weight unit outside its list' do+ store.preferred_unit_system = 'nautical'+ store.preferred_weight_unit = 'stone'++ expect(store).not_to be_valid+ expect(store.errors[:preferred_unit_system]).to be_present+ expect(store.errors[:preferred_weight_unit]).to be_present+ end+ end+describe 'capture method' dolet(:store) { create(:store) }