Skip to content

armgit / spree

Public Imported from GitHub
0

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

Restructure Admin API docs for more clarity (#14138)

Damian Legawiec6d2cad93d2f1
diff --git a/docs/api-reference/admin.yaml b/docs/api-reference/admin.yaml
index 8fe1dec3a9..b013a60a06 100644
--- a/docs/api-reference/admin.yaml
+++ b/docs/api-reference/admin.yaml
@@ -39,18 +39,28 @@ info:
```
version: v3
paths:
- "/api/v3/admin/admin_users":
- get:
- summary: List staff
+ "/api/v3/admin/auth/login":
+ post:
+ summary: Login
tags:
- - Configuration
+ - Authentication
security:
- api_key: []
- bearer_auth: []
- description: |-
- Returns admin users with at least one role assignment on the current store.
+ description: |
+ Authenticates an admin user and returns a short-lived JWT access token.
+ The rotatable refresh token is set in an HttpOnly cookie — it is not
+ included in the response body.
- **Required scope:** `read_settings` (for API-key authentication).
+ Dispatches by the `provider` field to a strategy registered in
+ `Spree.admin_authentication_strategies`. When `provider` is omitted it
+ defaults to `email`, which uses the built-in email/password strategy.
+
+ To plug in a third-party identity provider (Okta, Azure AD, Google
+ Workspace SSO, a custom JWT issuer, SAML, etc.), register a
+ `Spree::Authentication::Strategies::BaseStrategy` subclass under a
+ provider key, then send `{ "provider": "<your_key>", ... }` with the
+ fields your strategy requires. The endpoint returns the same Spree-issued
+ JWT regardless of which strategy authenticated the request.
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -62,54 +72,101 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: staff } = await client.adminUsers.list()
+ // The refresh token is set as an HttpOnly cookie; only `token` and `user` come back in the body.
+ const auth = await client.auth.login({
+ email: '[email protected]',
+ password: 'password123',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
responses:
'200':
- description: staff found
+ description: login successful
content:
application/json:
example:
- data:
- - id: admin_UkLWZg9DAJ
- first_name: Cristine
- last_name: Kutch
- full_name: Cristine Kutch
- created_at: '2026-06-05T13:11:36.683Z'
- updated_at: '2026-06-05T13:11:36.683Z'
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjRlZjA1MzY0LTY2ODctNDY3My1hNDI4LWNjZDI1ODc4YjVjZSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzgwOTE2NDk2fQ.4EH3Xu8aKDP0u0jtmqrcOOR9okXtEtJFZLw-YdP4sPM
+ user:
+ id: admin_UkLWZg9DAJ
+ first_name: Daina
+ last_name: Braun
+ full_name: Daina Braun
+ created_at: '2026-06-08T10:56:35.975Z'
+ updated_at: '2026-06-08T10:56:35.975Z'
roles:
- id: role_UkLWZg9DAJ
name: admin
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- "/api/v3/admin/admin_users/{id}":
- get:
- summary: Show a staff member
+ schema:
+ "$ref": "#/components/schemas/AuthResponse"
+ '401':
+ description: invalid credentials
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_failed
+ message: Invalid email or password
+ 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
+ example: password123
+ required:
+ - email
+ - password
+ - title: ProviderLogin
+ description: |
+ Provider-dispatched login. The `provider` key selects a registered
+ strategy class; the remaining fields are forwarded to the strategy's
+ `authenticate` method. Required fields depend on the registered strategy
+ — consult its documentation.
+ type: object
+ properties:
+ provider:
+ type: string
+ example: okta
+ 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:
- - Configuration
+ - Authentication
security:
- api_key: []
- bearer_auth: []
- description: "**Required scope:** `read_settings` (for API-key authentication)."
+ description: |
+ Exchanges the HttpOnly refresh-token cookie for a new access JWT and a
+ rotated refresh token cookie. No request body or Authorization header
+ is required — the cookie alone authenticates the call.
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -121,50 +178,53 @@ paths:
secretKey: 'sk_xxx',
})
- const staff = await client.adminUsers.get('admin_xxx')
+ // Driven entirely by the HttpOnly refresh-token cookie + CSRF header (set by the SDK).
+ const auth = await client.auth.refresh()
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
+ description: refresh successful
content:
application/json:
example:
- id: admin_UkLWZg9DAJ
- first_name: Ernie
- last_name: Hammes
- full_name: Ernie Hammes
- created_at: '2026-06-05T13:11:37.020Z'
- updated_at: '2026-06-05T13:11:37.020Z'
- roles:
- - id: role_UkLWZg9DAJ
- name: admin
- patch:
- summary: Update a staff member
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjBhNTEyYmI5LTlkNjAtNDdjYi04ZjlhLTFiYTM0MWY4MjIzZSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzgwOTE2NDk3fQ.eNWcAS3Rm1pAljK2jUjWhfYkqzjk6wraljD5m4DgKvM
+ user:
+ id: admin_UkLWZg9DAJ
+ first_name: Roman
+ last_name: Cruickshank
+ full_name: Roman Cruickshank
+ created_at: '2026-06-08T10:56:37.206Z'
+ updated_at: '2026-06-08T10:56:37.206Z'
+ roles:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ schema:
+ "$ref": "#/components/schemas/AuthResponse"
+ '401':
+ description: missing or invalid refresh-token cookie
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_refresh_token
+ message: Refresh token cookie missing
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/admin/auth/logout":
+ post:
+ summary: Logout
tags:
- - Configuration
+ - Authentication
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.
-
- **Required scope:** `write_settings` (for API-key authentication).
+ description: Revokes the refresh-token cookie, effectively logging the admin
+ out.
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -176,69 +236,26 @@ paths:
secretKey: 'sk_xxx',
})
- const staff = await client.adminUsers.update('admin_xxx', {
- first_name: 'Ada',
- role_ids: ['role_xxx']
- })
+ await client.auth.logout()
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:
- example:
- id: admin_UkLWZg9DAJ
- first_name: Renamed
- last_name: Bruen
- full_name: Renamed Bruen
- created_at: '2026-06-05T13:11:37.300Z'
- updated_at: '2026-06-05T13:11:37.317Z'
- roles:
- - id: role_UkLWZg9DAJ
- name: admin
- requestBody:
- 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
- delete:
- summary: Remove a staff member from this store
+ '204':
+ description: logout successful
+ "/api/v3/admin/me":
+ get:
+ summary: Get current admin user and permissions
tags:
- - Configuration
+ - Authentication
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.
-
- **Required scope:** `write_settings` (for API-key authentication).
+ description: Returns the current admin user profile and a serialized list of
+ permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -250,7 +267,10 @@ paths:
secretKey: 'sk_xxx',
})
- await client.adminUsers.delete('admin_xxx')
+ const me = await client.me.get()
+ if (me.permissions.some((r) => r.allow && r.actions.includes('manage') && r.subjects.includes('Spree::Product'))) {
+ // show "Create product" button
+ }
parameters:
- name: x-spree-api-key
in: header
@@ -260,34 +280,108 @@ paths:
- name: Authorization
in: header
required: true
- schema:
- type: string
- - name: id
- in: path
- required: true
+ description: Bearer token for admin authentication
schema:
type: string
responses:
- '204':
- description: staff removed from store
- "/api/v3/admin/allowed_origins":
- get:
- summary: List allowed origins
- tags:
- - Configuration
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns the CORS allowlist for the current store. Each entry is a
- bare `scheme://host[:port]` permitted to call the admin API from a
- browser. Backs the `Rack::Cors` allowlist and the CSRF boundary of
- the admin cookie session (see
- `docs/plans/5.5-admin-auth-cookie-refresh.md`).
-
-
- **Required scope:** `read_settings` (for API-key authentication).
- x-codeSamples:
+ '200':
+ description: current admin user and permissions
+ content:
+ application/json:
+ example:
+ user:
+ id: admin_UkLWZg9DAJ
+ first_name: Corazon
+ last_name: O'Hara
+ full_name: Corazon O'Hara
+ created_at: '2026-06-08T10:57:08.989Z'
+ updated_at: '2026-06-08T10:57:08.989Z'
+ roles:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ permissions:
+ - allow: true
+ actions:
+ - manage
+ subjects:
+ - all
+ has_conditions: false
+ - allow: false
+ actions:
+ - cancel
+ subjects:
+ - Spree::Order
+ has_conditions: false
+ - allow: true
+ actions:
+ - cancel
+ subjects:
+ - Spree::Order
+ has_conditions: true
+ - allow: false
+ actions:
+ - destroy
+ subjects:
+ - Spree::Order
+ has_conditions: false
+ - allow: true
+ actions:
+ - destroy
+ subjects:
+ - Spree::Order
+ has_conditions: true
+ - allow: false
+ actions:
+ - edit
+ - update
+ subjects:
+ - Spree::RefundReason
+ has_conditions: true
+ - allow: false
+ actions:
+ - edit
+ - update
+ subjects:
+ - Spree::ReimbursementType
+ has_conditions: true
+ - allow: false
+ actions:
+ - update
+ - destroy
+ subjects:
+ - Spree::Role
+ has_conditions: true
+ schema:
+ "$ref": "#/components/schemas/MeResponse"
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/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
+ bare `scheme://host[:port]` permitted to call the admin API from a
+ browser. Backs the `Rack::Cors` allowlist and the CSRF boundary of
+ the admin cookie session (see
+ `docs/plans/5.5-admin-auth-cookie-refresh.md`).
+
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
- lang: javascript
label: Spree Admin SDK
source: |-
@@ -350,8 +444,8 @@ paths:
data:
- id: ao_UkLWZg9DAJ
origin: https://shop.example.com
- created_at: '2026-06-05T13:11:37.617Z'
- updated_at: '2026-06-05T13:11:37.617Z'
+ created_at: '2026-06-08T10:56:31.241Z'
+ updated_at: '2026-06-08T10:56:31.241Z'
meta:
page: 1
limit: 25
@@ -387,7 +481,7 @@ paths:
post:
summary: Create an allowed origin
tags:
- - Configuration
+ - Allowed Origins
security:
- api_key: []
bearer_auth: []
@@ -432,8 +526,8 @@ paths:
example:
id: ao_gbHJdmfrXB
origin: https://admin.example.com
- created_at: '2026-06-05T13:11:38.223Z'
- updated_at: '2026-06-05T13:11:38.223Z'
+ created_at: '2026-06-08T10:56:31.844Z'
+ updated_at: '2026-06-08T10:56:31.844Z'
schema:
"$ref": "#/components/schemas/AllowedOrigin"
'422':
@@ -471,7 +565,7 @@ paths:
get:
summary: Get an allowed origin
tags:
- - Configuration
+ - Allowed Origins
security:
- api_key: []
bearer_auth: []
@@ -517,8 +611,8 @@ paths:
example:
id: ao_UkLWZg9DAJ
origin: https://shop.example.com
- created_at: '2026-06-05T13:11:38.548Z'
- updated_at: '2026-06-05T13:11:38.548Z'
+ created_at: '2026-06-08T10:56:32.140Z'
+ updated_at: '2026-06-08T10:56:32.140Z'
schema:
"$ref": "#/components/schemas/AllowedOrigin"
'404':
@@ -534,7 +628,7 @@ paths:
patch:
summary: Update an allowed origin
tags:
- - Configuration
+ - Allowed Origins
security:
- api_key: []
bearer_auth: []
@@ -576,8 +670,8 @@ paths:
example:
id: ao_UkLWZg9DAJ
origin: https://www.example.com
- created_at: '2026-06-05T13:11:39.123Z'
- updated_at: '2026-06-05T13:11:39.399Z'
+ created_at: '2026-06-08T10:56:32.711Z'
+ updated_at: '2026-06-08T10:56:33.092Z'
schema:
"$ref": "#/components/schemas/AllowedOrigin"
'422':
@@ -606,7 +700,7 @@ paths:
delete:
summary: Delete an allowed origin
tags:
- - Configuration
+ - Allowed Origins
security:
- api_key: []
bearer_auth: []
@@ -648,7 +742,7 @@ paths:
get:
summary: List API keys
tags:
- - Configuration
+ - API Keys
security:
- api_key: []
bearer_auth: []
@@ -691,32 +785,32 @@ paths:
key_type: publishable
token_prefix:
scopes: []
- created_at: '2026-06-05T13:11:39.966Z'
- updated_at: '2026-06-05T13:11:39.966Z'
+ created_at: '2026-06-08T10:56:33.709Z'
+ updated_at: '2026-06-08T10:56:33.709Z'
revoked_at:
last_used_at:
- plaintext_token: pk_vwf79N3EbY55iFtDfBjti1ue
+ plaintext_token: pk_WvcXSjJcJDQJRqu1Yu1vp5yS
created_by_email:
- id: key_gbHJdmfrXB
name: Backend integration
key_type: secret
- token_prefix: sk_SQrcKStFC
+ token_prefix: sk_uXxj3uHMQ
scopes:
- write_all
- created_at: '2026-06-05T13:11:39.967Z'
- updated_at: '2026-06-05T13:11:39.967Z'
+ created_at: '2026-06-08T10:56:33.710Z'
+ updated_at: '2026-06-08T10:56:33.710Z'
revoked_at:
last_used_at:
plaintext_token:
created_by_email:
- id: key_EfhxLZ9ck8
- name: officiis
+ name: porro
key_type: secret
- token_prefix: sk_CbfihKFYJ
+ token_prefix: sk_94S7QchKz
scopes:
- write_all
- created_at: '2026-06-05T13:11:39.968Z'
- updated_at: '2026-06-05T13:11:39.968Z'
+ created_at: '2026-06-08T10:56:33.711Z'
+ updated_at: '2026-06-08T10:56:33.711Z'
revoked_at:
last_used_at:
plaintext_token:
@@ -734,7 +828,7 @@ paths:
post:
summary: Create an API key
tags:
- - Configuration
+ - API Keys
security:
- api_key: []
bearer_auth: []
@@ -779,15 +873,15 @@ paths:
id: key_VqXmZF31wY
name: CI key
key_type: secret
- token_prefix: sk_nRJk8UWAr
+ token_prefix: sk_F2iuHSN5C
scopes:
- read_orders
- created_at: '2026-06-05T13:11:40.519Z'
- updated_at: '2026-06-05T13:11:40.519Z'
+ created_at: '2026-06-08T10:56:34.280Z'
+ updated_at: '2026-06-08T10:56:34.280Z'
revoked_at:
last_used_at:
- plaintext_token: sk_nRJk8UWAreSGDgitF8WmLkW6
- created_by_email: [email protected]
+ plaintext_token: sk_F2iuHSN5CzK3PoX8AeCMNnAZ
+ created_by_email: [email protected]
'422':
description: validation error
content:
@@ -829,7 +923,7 @@ paths:
get:
summary: Show an API key
tags:
- - Configuration
+ - API Keys
security:
- api_key: []
bearer_auth: []
@@ -873,16 +967,16 @@ paths:
key_type: publishable
token_prefix:
scopes: []
- created_at: '2026-06-05T13:11:40.807Z'
- updated_at: '2026-06-05T13:11:40.807Z'
+ created_at: '2026-06-08T10:56:34.628Z'
+ updated_at: '2026-06-08T10:56:34.628Z'
revoked_at:
last_used_at:
- plaintext_token: pk_rMmsAxGPjseAjBerbb8tbLHB
+ plaintext_token: pk_T4HNwJvZLLhdNZnbqgti7bem
created_by_email:
delete:
summary: Delete an API key
tags:
- - Configuration
+ - API Keys
security:
- api_key: []
bearer_auth: []
@@ -922,7 +1016,7 @@ paths:
patch:
summary: Revoke an API key
tags:
- - Configuration
+ - API Keys
security:
- api_key: []
bearer_auth: []
@@ -967,304 +1061,97 @@ paths:
id: key_gbHJdmfrXB
name: Backend integration
key_type: secret
- token_prefix: sk_DdooMj4rL
+ token_prefix: sk_oZErCBJ7u
scopes:
- write_all
- created_at: '2026-06-05T13:11:41.386Z'
- updated_at: '2026-06-05T13:11:41.661Z'
- revoked_at: '2026-06-05T13:11:41.660Z'
+ created_at: '2026-06-08T10:56:35.282Z'
+ updated_at: '2026-06-08T10:56:35.644Z'
+ revoked_at: '2026-06-08T10:56:35.643Z'
last_used_at:
plaintext_token:
created_by_email:
- "/api/v3/admin/auth/login":
- post:
- summary: Login
+ "/api/v3/admin/channels":
+ get:
+ summary: List channels
tags:
- - Authentication
+ - Channels
security:
- api_key: []
- description: |
- Authenticates an admin user and returns a short-lived JWT access token.
- The rotatable refresh token is set in an HttpOnly cookie — it is not
- included in the response body.
-
- Dispatches by the `provider` field to a strategy registered in
- `Spree.admin_authentication_strategies`. When `provider` is omitted it
- defaults to `email`, which uses the built-in email/password strategy.
-
- To plug in a third-party identity provider (Okta, Azure AD, Google
- Workspace SSO, a custom JWT issuer, SAML, etc.), register a
- `Spree::Authentication::Strategies::BaseStrategy` subclass under a
- provider key, then send `{ "provider": "<your_key>", ... }` with the
- fields your strategy requires. The endpoint returns the same Spree-issued
- JWT regardless of which strategy authenticated the request.
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
+ bearer_auth: []
+ description: |-
+ Returns the channels configured for the current store.
- // The refresh token is set as an HttpOnly cookie; only `token` and `user` come back in the body.
- const auth = await client.auth.login({
- email: '[email protected]',
- password: 'password123',
- })
+ **Required scope:** `read_settings` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
responses:
'200':
- description: login successful
- content:
- application/json:
- example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjA1MDE2NWYyLWIxMzgtNGUxNS1hODQzLTViOGQ3ZmQwNDRiNiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzgwNjY1NDAyfQ.kRkK_K3OdO_o-Nt1pqtAYJSsL0xmTAby07V95YGqhQU
- user:
- id: admin_UkLWZg9DAJ
- first_name: Ingrid
- last_name: Powlowski
- full_name: Ingrid Powlowski
- created_at: '2026-06-05T13:11:41.926Z'
- updated_at: '2026-06-05T13:11:41.926Z'
- roles:
- - id: role_UkLWZg9DAJ
- name: admin
- schema:
- "$ref": "#/components/schemas/AuthResponse"
- '401':
- description: invalid credentials
+ description: channels found
content:
application/json:
example:
- error:
- code: authentication_failed
- message: Invalid email or password
+ data:
+ - id: ch_UkLWZg9DAJ
+ name: Online Store
+ code: online
+ active: true
+ default: true
+ preferred_order_routing_strategy:
+ created_at: '2026-06-08T10:56:29.986Z'
+ updated_at: '2026-06-08T10:56:29.986Z'
+ - id: ch_gbHJdmfrXB
+ name: Wholesale
+ code: wholesale
+ active: true
+ default: false
+ preferred_order_routing_strategy:
+ created_at: '2026-06-08T10:56:37.801Z'
+ updated_at: '2026-06-08T10:56:37.801Z'
+ meta:
+ page: 1
+ limit: 25
+ count: 2
+ pages: 1
+ from: 1
+ to: 2
+ in: 2
+ previous:
+ next:
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
- example: password123
- required:
- - email
- - password
- - title: ProviderLogin
- description: |
- Provider-dispatched login. The `provider` key selects a registered
- strategy class; the remaining fields are forwarded to the strategy's
- `authenticate` method. Required fields depend on the registered strategy
- — consult its documentation.
type: object
properties:
- provider:
- type: string
- example: okta
- description: Registered provider key (anything other than `email`).
- not:
- enum:
- - email
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Channel"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
required:
- - provider
- additionalProperties: true
- "/api/v3/admin/auth/refresh":
+ - data
+ - meta
post:
- summary: Refresh token
+ summary: Create a channel
tags:
- - Authentication
- security:
- - api_key: []
- description: |
- Exchanges the HttpOnly refresh-token cookie for a new access JWT and a
- rotated refresh token cookie. No request body or Authorization header
- is required — the cookie alone authenticates the call.
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- // Driven entirely by the HttpOnly refresh-token cookie + CSRF header (set by the SDK).
- const auth = await client.auth.refresh()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- responses:
- '200':
- description: refresh successful
- content:
- application/json:
- example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImNiOGQ2OWI5LWQzNzMtNDFkYy1iZWRhLWZmMjk2MDQ1MGQ5MiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzgwNjY1NDAzfQ.Y008gMr0LiwTlG-IYbvK9jrpa33-dRJ95ZvYHguEG20
- user:
- id: admin_UkLWZg9DAJ
- first_name: Grayce
- last_name: Muller
- full_name: Grayce Muller
- created_at: '2026-06-05T13:11:43.008Z'
- updated_at: '2026-06-05T13:11:43.008Z'
- roles:
- - id: role_UkLWZg9DAJ
- name: admin
- schema:
- "$ref": "#/components/schemas/AuthResponse"
- '401':
- description: missing or invalid refresh-token cookie
- content:
- application/json:
- example:
- error:
- code: invalid_refresh_token
- message: Refresh token cookie missing
- 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.
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- await client.auth.logout()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- responses:
- '204':
- description: logout successful
- "/api/v3/admin/channels":
- get:
- summary: List channels
- tags:
- - Channels
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns the channels configured for the current store.
-
- **Required scope:** `read_settings` (for API-key authentication).
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- responses:
- '200':
- description: channels found
- content:
- application/json:
- example:
- data:
- - id: ch_UkLWZg9DAJ
- name: Online Store
- code: online
- active: true
- default: true
- preferred_order_routing_strategy:
- created_at: '2026-06-05T13:11:36.367Z'
- updated_at: '2026-06-05T13:11:36.367Z'
- - id: ch_gbHJdmfrXB
- name: Wholesale
- code: wholesale
- active: true
- default: false
- preferred_order_routing_strategy:
- created_at: '2026-06-05T13:11:43.589Z'
- updated_at: '2026-06-05T13:11:43.589Z'
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
- 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
+ - Channels
security:
- api_key: []
bearer_auth: []
@@ -1298,8 +1185,8 @@ paths:
active: true
default: false
preferred_order_routing_strategy:
- created_at: '2026-06-05T13:11:44.163Z'
- updated_at: '2026-06-05T13:11:44.163Z'
+ created_at: '2026-06-08T10:56:38.384Z'
+ updated_at: '2026-06-08T10:56:38.384Z'
requestBody:
content:
application/json:
@@ -1356,8 +1243,8 @@ paths:
active: true
default: false
preferred_order_routing_strategy:
- created_at: '2026-06-05T13:11:44.190Z'
- updated_at: '2026-06-05T13:11:44.190Z'
+ created_at: '2026-06-08T10:56:38.395Z'
+ updated_at: '2026-06-08T10:56:38.395Z'
patch:
summary: Update a channel
tags:
@@ -1389,8 +1276,8 @@ paths:
active: true
default: false
preferred_order_routing_strategy:
- created_at: '2026-06-05T13:11:44.493Z'
- updated_at: '2026-06-05T13:11:44.841Z'
+ created_at: '2026-06-08T10:56:38.681Z'
+ updated_at: '2026-06-08T10:56:38.986Z'
requestBody:
content:
application/json:
@@ -1544,78 +1431,6 @@ paths:
type: array
items:
type: string
- "/api/v3/admin/promotions/{promotion_id}/coupon_codes":
- parameters:
- - name: promotion_id
- in: path
- required: true
- schema:
- type: string
- get:
- summary: List coupon codes for a promotion
- tags:
- - Promotions
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.
-
- **Required scope:** `read_promotions` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: coupons } = await client.promotions.couponCodes.list('promo_UkLWZg9DAJ')
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- responses:
- '200':
- description: coupon codes found
- content:
- application/json:
- example:
- data:
- - id: coupon_UkLWZg9DAJ
- code: AAA111
- state: unused
- created_at: '2026-06-05T13:11:45.879Z'
- updated_at: '2026-06-05T13:11:45.879Z'
- promotion_id: promo_UkLWZg9DAJ
- order_id:
- - id: coupon_gbHJdmfrXB
- code: BBB222
- state: unused
- created_at: '2026-06-05T13:11:45.879Z'
- updated_at: '2026-06-05T13:11:45.879Z'
- promotion_id: promo_UkLWZg9DAJ
- order_id:
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
"/api/v3/admin/custom_field_definitions":
get:
summary: List custom field definitions
@@ -1681,8 +1496,8 @@ paths:
field_type: short_text
resource_type: Spree::Product
storefront_visible: true
- created_at: '2026-06-05T13:11:46.203Z'
- updated_at: '2026-06-05T13:11:46.203Z'
+ created_at: '2026-06-08T10:56:40.300Z'
+ updated_at: '2026-06-08T10:56:40.300Z'
- id: cfdef_gbHJdmfrXB
namespace: custom
key: order_notes
@@ -1690,8 +1505,8 @@ paths:
field_type: short_text
resource_type: Spree::Order
storefront_visible: true
- created_at: '2026-06-05T13:11:46.204Z'
- updated_at: '2026-06-05T13:11:46.204Z'
+ created_at: '2026-06-08T10:56:40.301Z'
+ updated_at: '2026-06-08T10:56:40.301Z'
meta:
page: 1
limit: 25
@@ -1754,8 +1569,8 @@ paths:
field_type: short_text
resource_type: Spree::Product
storefront_visible: true
- created_at: '2026-06-05T13:11:46.788Z'
- updated_at: '2026-06-05T13:11:46.788Z'
+ created_at: '2026-06-08T10:56:40.884Z'
+ updated_at: '2026-06-08T10:56:40.884Z'
requestBody:
content:
application/json:
@@ -1838,8 +1653,8 @@ paths:
field_type: short_text
resource_type: Spree::Product
storefront_visible: true
- created_at: '2026-06-05T13:11:46.793Z'
- updated_at: '2026-06-05T13:11:46.793Z'
+ created_at: '2026-06-08T10:56:40.891Z'
+ updated_at: '2026-06-08T10:56:40.891Z'
patch:
summary: Update a custom field definition
tags:
@@ -1878,8 +1693,8 @@ paths:
field_type: short_text
resource_type: Spree::Product
storefront_visible: false
- created_at: '2026-06-05T13:11:47.078Z'
- updated_at: '2026-06-05T13:11:47.360Z'
+ created_at: '2026-06-08T10:56:41.172Z'
+ updated_at: '2026-06-08T10:56:41.449Z'
requestBody:
content:
application/json:
@@ -1924,7 +1739,7 @@ paths:
get:
summary: List customer groups
tags:
- - Customers
+ - Customer Groups
security:
- api_key: []
bearer_auth: []
@@ -2003,14 +1818,14 @@ paths:
name: VIPs
description: Top spenders
customers_count: 0
- created_at: '2026-06-05T13:11:47.654Z'
- updated_at: '2026-06-05T13:11:47.654Z'
+ created_at: '2026-06-08T10:56:41.734Z'
+ updated_at: '2026-06-08T10:56:41.734Z'
- id: cg_gbHJdmfrXB
name: Wholesale
description:
customers_count: 0
- created_at: '2026-06-05T13:11:47.655Z'
- updated_at: '2026-06-05T13:11:47.655Z'
+ created_at: '2026-06-08T10:56:41.735Z'
+ updated_at: '2026-06-08T10:56:41.735Z'
meta:
page: 1
limit: 25
@@ -2046,7 +1861,7 @@ paths:
post:
summary: Create a customer group
tags:
- - Customers
+ - Customer Groups
security:
- api_key: []
bearer_auth: []
@@ -2095,8 +1910,8 @@ paths:
name: Wholesale 2
description: B2B accounts
customers_count: 1
- created_at: '2026-06-05T13:11:48.527Z'
- updated_at: '2026-06-05T13:11:48.527Z'
+ created_at: '2026-06-08T10:56:42.582Z'
+ updated_at: '2026-06-08T10:56:42.582Z'
schema:
"$ref": "#/components/schemas/CustomerGroup"
'422':
@@ -2144,7 +1959,7 @@ paths:
get:
summary: Get a customer group
tags:
- - Customers
+ - Customer Groups
security:
- api_key: []
bearer_auth: []
@@ -2202,24 +2017,24 @@ paths:
name: VIPs
description: Top spenders
customers_count: 1
- created_at: '2026-06-05T13:11:49.112Z'
- updated_at: '2026-06-05T13:11:49.112Z'
+ created_at: '2026-06-08T10:56:43.161Z'
+ updated_at: '2026-06-08T10:56:43.161Z'
customers:
- id: cus_UkLWZg9DAJ
- first_name: Adella
- last_name: Mertz
+ first_name: Santo
+ last_name: Walsh
phone:
accepts_email_marketing: false
- full_name: Adella Mertz
+ full_name: Santo Walsh
available_store_credit_total: '0'
display_available_store_credit_total: "$0.00"
metadata: {}
last_sign_in_at:
current_sign_in_at:
- created_at: '2026-06-05T13:11:49.376Z'
- updated_at: '2026-06-05T13:11:49.376Z'
+ created_at: '2026-06-08T10:56:43.423Z'
+ updated_at: '2026-06-08T10:56:43.423Z'
sign_in_count: 0
failed_attempts: 0
last_sign_in_ip:
@@ -2247,7 +2062,7 @@ paths:
patch:
summary: Update a customer group
tags:
- - Customers
+ - Customer Groups
security:
- api_key: []
bearer_auth: []
@@ -2297,8 +2112,8 @@ paths:
name: VIP customers (Q1)
description: Top spenders
customers_count: 0
- created_at: '2026-06-05T13:11:49.974Z'
- updated_at: '2026-06-05T13:11:50.254Z'
+ created_at: '2026-06-08T10:56:44.004Z'
+ updated_at: '2026-06-08T10:56:44.278Z'
schema:
"$ref": "#/components/schemas/CustomerGroup"
'422':
@@ -2336,7 +2151,7 @@ paths:
delete:
summary: Delete a customer group
tags:
- - Customers
+ - Customer Groups
security:
- api_key: []
bearer_auth: []
@@ -2451,8 +2266,8 @@ paths:
state_name: New York
label:
metadata: {}
- created_at: '2026-06-05T13:11:51.157Z'
- updated_at: '2026-06-05T13:11:51.157Z'
+ created_at: '2026-06-08T10:56:45.123Z'
+ updated_at: '2026-06-08T10:56:45.123Z'
customer_id: cus_UkLWZg9DAJ
meta:
page: 1
@@ -2540,8 +2355,8 @@ paths:
state_name: New York
label: Office
metadata: {}
- created_at: '2026-06-05T13:11:52.510Z'
- updated_at: '2026-06-05T13:11:52.510Z'
+ created_at: '2026-06-08T10:56:46.478Z'
+ updated_at: '2026-06-08T10:56:46.478Z'
customer_id: cus_UkLWZg9DAJ
requestBody:
content:
@@ -2652,8 +2467,8 @@ paths:
state_name: New York
label:
metadata: {}
- created_at: '2026-06-05T13:11:52.780Z'
- updated_at: '2026-06-05T13:11:53.330Z'
+ created_at: '2026-06-08T10:56:46.752Z'
+ updated_at: '2026-06-08T10:56:47.297Z'
customer_id: cus_UkLWZg9DAJ
requestBody:
content:
@@ -2786,8 +2601,8 @@ paths:
customer_id: cus_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
metadata: {}
- created_at: '2026-06-05T13:11:54.435Z'
- updated_at: '2026-06-05T13:11:54.435Z'
+ created_at: '2026-06-08T10:56:48.396Z'
+ updated_at: '2026-06-08T10:56:48.396Z'
meta:
page: 1
limit: 25
@@ -2874,8 +2689,8 @@ paths:
customer_id: cus_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
metadata: {}
- created_at: '2026-06-05T13:11:54.997Z'
- updated_at: '2026-06-05T13:11:54.997Z'
+ created_at: '2026-06-08T10:56:48.944Z'
+ updated_at: '2026-06-08T10:56:48.944Z'
delete:
summary: Delete a customer credit card
tags:
@@ -2994,8 +2809,8 @@ paths:
currency: USD
memo:
metadata: {}
- created_at: '2026-06-05T13:11:56.393Z'
- updated_at: '2026-06-05T13:11:56.393Z'
+ created_at: '2026-06-08T10:56:50.298Z'
+ updated_at: '2026-06-08T10:56:50.298Z'
customer_id: cus_UkLWZg9DAJ
created_by_id: admin_UkLWZg9DAJ
category_id: sccat_UkLWZg9DAJ
@@ -3070,8 +2885,8 @@ paths:
currency: USD
memo: Goodwill
metadata: {}
- created_at: '2026-06-05T13:11:57.509Z'
- updated_at: '2026-06-05T13:11:57.509Z'
+ created_at: '2026-06-08T10:56:51.478Z'
+ updated_at: '2026-06-08T10:56:51.478Z'
customer_id: cus_UkLWZg9DAJ
created_by_id: admin_gbHJdmfrXB
category_id: sccat_UkLWZg9DAJ
@@ -3162,8 +2977,8 @@ paths:
currency: USD
memo: Updated
metadata: {}
- created_at: '2026-06-05T13:11:58.047Z'
- updated_at: '2026-06-05T13:11:58.336Z'
+ created_at: '2026-06-08T10:56:52.025Z'
+ updated_at: '2026-06-08T10:56:52.343Z'
customer_id: cus_UkLWZg9DAJ
created_by_id: admin_UkLWZg9DAJ
category_id: sccat_UkLWZg9DAJ
@@ -3317,8 +3132,8 @@ paths:
metadata: {}
last_sign_in_at:
current_sign_in_at:
- created_at: '2026-06-05T13:11:59.447Z'
- updated_at: '2026-06-05T13:11:59.447Z'
+ created_at: '2026-06-08T10:56:53.476Z'
+ updated_at: '2026-06-08T10:56:53.476Z'
sign_in_count: 0
failed_attempts: 0
last_sign_in_ip:
@@ -3401,8 +3216,8 @@ paths:
metadata: {}
last_sign_in_at:
current_sign_in_at:
- created_at: '2026-06-05T13:12:00.292Z'
- updated_at: '2026-06-05T13:12:00.292Z'
+ created_at: '2026-06-08T10:56:54.324Z'
+ updated_at: '2026-06-08T10:56:54.324Z'
sign_in_count: 0
failed_attempts: 0
last_sign_in_ip:
@@ -3518,8 +3333,8 @@ paths:
metadata: {}
last_sign_in_at:
current_sign_in_at:
- created_at: '2026-06-05T13:12:00.565Z'
- updated_at: '2026-06-05T13:12:00.565Z'
+ created_at: '2026-06-08T10:56:54.595Z'
+ updated_at: '2026-06-08T10:56:54.595Z'
sign_in_count: 0
failed_attempts: 0
last_sign_in_ip:
@@ -3593,8 +3408,8 @@ paths:
metadata: {}
last_sign_in_at:
current_sign_in_at:
- created_at: '2026-06-05T13:12:01.125Z'
- updated_at: '2026-06-05T13:12:01.412Z'
+ created_at: '2026-06-08T10:56:55.159Z'
+ updated_at: '2026-06-08T10:56:55.444Z'
sign_in_count: 0
failed_attempts: 0
last_sign_in_ip:
@@ -4024,11 +3839,11 @@ paths:
example:
data:
- id: exp_UkLWZg9DAJ
- number: EF364027755
+ number: EF093047115
type: Spree::Exports::Products
format: csv
- created_at: '2026-06-05T13:12:05.577Z'
- updated_at: '2026-06-05T13:12:05.577Z'
+ created_at: '2026-06-08T10:56:59.677Z'
+ updated_at: '2026-06-08T10:56:59.677Z'
user_id: admin_UkLWZg9DAJ
done: false
filename:
@@ -4095,11 +3910,11 @@ paths:
application/json:
example:
id: exp_gbHJdmfrXB
- number: EF329172445
+ number: EF199522264
type: Spree::Exports::Products
format: csv
- created_at: '2026-06-05T13:12:05.895Z'
- updated_at: '2026-06-05T13:12:05.895Z'
+ created_at: '2026-06-08T10:57:00.017Z'
+ updated_at: '2026-06-08T10:57:00.017Z'
user_id: admin_UkLWZg9DAJ
done: false
filename:
@@ -4186,11 +4001,11 @@ paths:
application/json:
example:
id: exp_UkLWZg9DAJ
- number: EF518550027
+ number: EF025250323
type: Spree::Exports::Products
format: csv
- created_at: '2026-06-05T13:12:06.180Z'
- updated_at: '2026-06-05T13:12:06.180Z'
+ created_at: '2026-06-08T10:57:00.306Z'
+ updated_at: '2026-06-08T10:57:00.306Z'
user_id: admin_UkLWZg9DAJ
done: false
filename:
@@ -4298,22 +4113,18 @@ paths:
schema:
type: string
format: binary
- "/api/v3/admin/gift_card_batches":
+ "/api/v3/admin/orders/{order_id}/fulfillments":
get:
- summary: List gift card batches
+ summary: List fulfillments
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the gift card batches issued by the current store. Each batch
- groups the cards generated together for a campaign or bulk-issuance
- — the cards themselves live under `/admin/gift_cards` and reference
- the batch via `gift_card_batch_id`.
-
+ Returns all shipments for an order.
- **Required scope:** `read_gift_cards` (for API-key authentication).
+ **Required scope:** `read_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4325,7 +4136,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: batches } = await client.giftCardBatches.list({ page: 1, limit: 25 })
+ const { data: fulfillments } = await client.orders.fulfillments.list('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -4338,46 +4149,64 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: page
- in: query
- required: false
- description: Page number
+ - name: order_id
+ in: path
+ required: true
+ description: Order ID
schema:
- type: integer
- - name: limit
+ type: string
+ - name: expand
in: query
required: false
- description: Records per page
+ 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: integer
- - name: q[prefix_cont]
+ type: string
+ - name: fields
in: query
required: false
- description: Filter by prefix (contains)
- schema:
- type: string
- - name: sort
- in: query
- required: false
- description: Sort by field. Prefix with `-` for descending.
+ description: Comma-separated list of fields to include (e.g., number,status,tracking,cost).
+ id is always included.
schema:
type: string
responses:
'200':
- description: gift card batches found
+ description: fulfillments found
content:
application/json:
example:
data:
- - id: gcb_UkLWZg9DAJ
- codes_count: 2
- currency: USD
- prefix: WELCOME
- created_at: '2026-06-05T13:12:06.832Z'
- updated_at: '2026-06-05T13:12:06.832Z'
- amount: '50.0'
- expires_at:
- created_by_id:
+ - id: ful_UkLWZg9DAJ
+ number: H37428731748
+ tracking: U10000
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: ready
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:11.692Z'
+ updated_at: '2026-06-08T10:57:11.766Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
meta:
page: 1
limit: 25
@@ -4388,34 +4217,18 @@ paths:
in: 1
previous:
next:
- 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
+ "/api/v3/admin/orders/{order_id}/fulfillments/{id}":
+ get:
+ summary: Show a shipment
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Issues a batch of gift cards in a single call. The server generates
- `codes_count` cards inline for small batches (configurable via
- `Spree.config.gift_card_batch_web_limit`, default 500) or enqueues
- a background job for larger ones. Each card's code is the batch
- `prefix` followed by random hex.
-
+ Returns details of a specific shipment.
- **Required scope:** `write_gift_cards` (for API-key authentication).
+ **Required scope:** `read_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4427,13 +4240,7 @@ paths:
secretKey: 'sk_xxx',
})
- const batch = await client.giftCardBatches.create({
- prefix: 'WELCOME',
- amount: '25.00',
- currency: 'USD',
- codes_count: 100,
- expires_at: '2030-12-31',
- })
+ const fulfillment = await client.orders.fulfillments.get('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -4443,87 +4250,83 @@ paths:
- 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:
- '201':
- description: gift card batch created
- content:
- application/json:
- example:
- id: gcb_gbHJdmfrXB
- codes_count: 5
- currency: USD
- prefix: NEWCAMP
- created_at: '2026-06-05T13:12:07.399Z'
- updated_at: '2026-06-05T13:12:07.399Z'
- amount: '25.0'
- expires_at: '2030-12-31'
- created_by_id: admin_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/GiftCardBatch"
- '422':
- description: validation error
+ '200':
+ description: shipment found
content:
application/json:
example:
- error:
- code: validation_error
- message: Prefix can't be blank
- details:
- prefix:
- - can't be blank
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- "/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
+ id: ful_UkLWZg9DAJ
+ number: H58592161546
+ tracking: U10000
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: ready
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:12.372Z'
+ updated_at: '2026-06-08T10:57:12.428Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
+ patch:
+ summary: Update a shipment
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a single batch.
+ Updates a shipment (tracking, shipping rate).
- **Required scope:** `read_gift_cards` (for API-key authentication).
+ **Required scope:** `write_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4535,7 +4338,9 @@ paths:
secretKey: 'sk_xxx',
})
- const batch = await client.giftCardBatches.get('gcb_K3zr8x')
+ const fulfillment = await client.orders.fulfillments.update('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {
+ tracking: '1Z999AA10123456784',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -4545,50 +4350,80 @@ paths:
- 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: gift card batch found
- content:
- application/json:
- example:
- id: gcb_UkLWZg9DAJ
- codes_count: 2
- currency: USD
- prefix: WELCOME
- created_at: '2026-06-05T13:12:07.697Z'
- updated_at: '2026-06-05T13:12:07.697Z'
- amount: '50.0'
- expires_at:
- created_by_id:
- schema:
- "$ref": "#/components/schemas/GiftCardBatch"
- '404':
- description: gift card batch not found
+ description: shipment updated
content:
application/json:
example:
- error:
- code: record_not_found
- message: Gift card batch not found
- 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
- `q[code_cont]` for code search, `q[user_id_eq]` for cards issued
- to a specific customer, or `q[state_eq]` for status filtering.
-
-
- **Required scope:** `read_gift_cards` (for API-key authentication).
+ id: ful_UkLWZg9DAJ
+ number: H48155201967
+ tracking: 1Z999AA10123456784
+ tracking_url: https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1Z999AA10123456784
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: ready
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:13.024Z'
+ updated_at: '2026-06-08T10:57:13.385Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ tracking:
+ type: string
+ example: 1Z999AA10123456784
+ selected_shipping_rate_id:
+ type: string
+ "/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.
+
+ **Required scope:** `write_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4600,11 +4435,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: giftCards } = await client.giftCards.list({
- page: 1,
- limit: 25,
- expand: ['customer', 'created_by'],
- })
+ const fulfillment = await client.orders.fulfillments.fulfill('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -4617,134 +4448,66 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: page
- in: query
- required: false
- description: Page number
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: Number of records per page
- schema:
- type: integer
- - name: q[code_cont]
- in: query
- required: false
- description: Filter by gift card code (contains)
- schema:
- type: string
- - name: q[state_eq]
- in: query
- required: false
- description: Filter by status (active, redeemed, partially_redeemed, canceled)
- schema:
- type: string
- - name: sort
- in: query
- required: false
- description: Sort by field. Prefix with `-` for descending (e.g., `-created_at`).
+ - name: order_id
+ in: path
+ required: true
+ description: Order ID
schema:
type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include. id is always included.
+ - name: id
+ in: path
+ required: true
+ description: Fulfillment ID
schema:
type: string
responses:
'200':
- description: gift cards found
- content:
- application/json:
- example:
- data:
- - id: gc_UkLWZg9DAJ
- code: 6951A14B300CEC04
- status: active
- currency: USD
- amount: '50.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '50.0'
- display_amount: "$50.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$50.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:08.266Z'
- updated_at: '2026-06-05T13:12:08.266Z'
- customer_id:
- created_by_id:
- - id: gc_gbHJdmfrXB
- code: 3E031B73A4AE32CD
- status: active
- currency: USD
- amount: '25.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '25.0'
- display_amount: "$25.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$25.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:08.267Z'
- updated_at: '2026-06-05T13:12:08.267Z'
- customer_id:
- created_by_id:
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/GiftCard"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
- required:
- - data
- - meta
- '401':
- description: unauthorized
+ description: fulfillment fulfilled
content:
application/json:
example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- post:
- summary: Create a gift card
+ id: ful_UkLWZg9DAJ
+ number: H51880549825
+ tracking: U10000
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: shipped
+ fulfillment_type: shipping
+ fulfilled_at: '2026-06-08T10:57:14Z'
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:13.742Z'
+ updated_at: '2026-06-08T10:57:14.099Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
+ "/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":
+ patch:
+ summary: Cancel a fulfillment
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Issues a gift card scoped to the current store. The code is
- auto-generated when omitted. `currency` defaults to the store's
- configured currency. Pass `user_id` (prefixed ID) to attach the
- card to a specific customer.
-
+ Cancels a fulfillment.
- **Required scope:** `write_gift_cards` (for API-key authentication).
+ **Required scope:** `write_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4756,12 +4519,7 @@ paths:
secretKey: 'sk_xxx',
})
- const giftCard = await client.giftCards.create({
- amount: '25.00',
- currency: 'USD',
- expires_at: '2030-12-31',
- user_id: 'cus_UkLWZg9DAJ',
- })
+ const fulfillment = await client.orders.fulfillments.cancel('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -4771,98 +4529,69 @@ paths:
- 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:
- '201':
- description: gift card created
- content:
- application/json:
- example:
- id: gc_EfhxLZ9ck8
- code: CC7C00B458CBFC8F
- status: active
- currency: USD
- amount: '25.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '25.0'
- display_amount: "$25.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$25.00"
- expires_at: '2030-12-31'
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:08.868Z'
- updated_at: '2026-06-05T13:12:08.868Z'
- customer_id:
- created_by_id: admin_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/GiftCard"
- '422':
- description: validation error
+ '200':
+ description: fulfillment canceled
content:
application/json:
example:
- error:
- code: validation_error
- message: Amount must be greater than 0
- details:
- amount:
- - must be greater than 0
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- user_id:
- type: string
- example: cus_UkLWZg9DAJ
- 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
+ id: ful_UkLWZg9DAJ
+ number: H11992775783
+ tracking: U10000
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: canceled
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:14.457Z'
+ updated_at: '2026-06-08T10:57:14.855Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
+ "/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":
+ patch:
+ summary: Resume a fulfillment
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a single gift card.
+ Resumes a canceled fulfillment.
- **Required scope:** `read_gift_cards` (for API-key authentication).
+ **Required scope:** `write_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4874,9 +4603,7 @@ paths:
secretKey: 'sk_xxx',
})
- const giftCard = await client.giftCards.get('gc_K3zr8x', {
- expand: ['customer', 'created_by', 'orders'],
- })
+ const fulfillment = await client.orders.fulfillments.resume('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -4886,64 +4613,69 @@ paths:
- 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.
+ - 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: gift card found
- content:
- application/json:
- example:
- id: gc_UkLWZg9DAJ
- code: A45E8E4B11DA9DBD
- status: active
- currency: USD
- amount: '50.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '50.0'
- display_amount: "$50.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$50.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:09.160Z'
- updated_at: '2026-06-05T13:12:09.160Z'
- customer_id:
- created_by_id:
- schema:
- "$ref": "#/components/schemas/GiftCard"
- '404':
- description: gift card not found
+ description: fulfillment resumed
content:
application/json:
example:
- error:
- code: record_not_found
- message: Gift card not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ id: ful_UkLWZg9DAJ
+ number: H79014622748
+ tracking: U10000
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:15.195Z'
+ updated_at: '2026-06-08T10:57:15.547Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_UkLWZg9DAJ
+ "/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":
patch:
- summary: Update a gift card
+ summary: Split a fulfillment
tags:
- - Gift Cards
+ - Fulfillments
security:
- api_key: []
bearer_auth: []
description: |-
- Updates an active gift card's editable attributes. Redeemed or
- partially-redeemed cards cannot be edited.
-
+ Transfers items from this shipment to a new shipment at a different stock location.
- **Required scope:** `write_gift_cards` (for API-key authentication).
+ **Required scope:** `write_fulfillments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -4955,8 +4687,8 @@ paths:
secretKey: 'sk_xxx',
})
- const giftCard = await client.giftCards.update('gc_K3zr8x', {
- amount: '75.00',
+ const fulfillment = await client.orders.fulfillments.split('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {
+ quantity: 1,
})
parameters:
- name: x-spree-api-key
@@ -4967,65 +4699,92 @@ paths:
- 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: gift card updated
+ description: fulfillment split
content:
application/json:
example:
- id: gc_UkLWZg9DAJ
- code: E6E13513E44B8807
- status: active
- currency: USD
- amount: '75.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '75.0'
- display_amount: "$75.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$75.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:09.749Z'
- updated_at: '2026-06-05T13:12:10.070Z'
- customer_id:
- created_by_id:
- schema:
- "$ref": "#/components/schemas/GiftCard"
+ data:
+ - id: ful_gbHJdmfrXB
+ number: H05613456699
+ tracking:
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: ready
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ metadata: {}
+ adjustment_total: '0.0'
+ pre_tax_amount: '0.0'
+ created_at: '2026-06-08T10:57:16.243Z'
+ updated_at: '2026-06-08T10:57:16.326Z'
+ order_id: or_UkLWZg9DAJ
+ stock_location_id: sloc_gbHJdmfrXB
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - variant_id
+ - quantity
properties:
- amount:
- type: string
- example: '75.00'
- expires_at:
+ variant_id:
type: string
- example: '2031-12-31'
- nullable: true
- user_id:
+ description: Variant ID
+ quantity:
+ type: integer
+ example: 1
+ stock_location_id:
type: string
- example: cus_UkLWZg9DAJ
- nullable: true
- delete:
- summary: Delete a gift card
+ 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: |-
- Deletes an unused gift card. Cards that have been redeemed or
- partially redeemed cannot be deleted and return 422.
-
+ Returns the gift card batches issued by the current store. Each batch
+ groups the cards generated together for a campaign or bulk-issuance
+ — the cards themselves live under `/admin/gift_cards` and reference
+ the batch via `gift_card_batch_id`.
- **Required scope:** `write_gift_cards` (for API-key authentication).
+
+ **Required scope:** `read_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5037,7 +4796,7 @@ paths:
secretKey: 'sk_xxx',
})
- await client.giftCards.delete('gc_K3zr8x')
+ const { data: batches } = await client.giftCardBatches.list({ page: 1, limit: 25 })
parameters:
- name: x-spree-api-key
in: header
@@ -5047,75 +4806,49 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
schema:
type: string
- responses:
- '204':
- description: gift card deleted
- '422':
- description: redeemed gift card cannot be deleted
- content:
- application/json:
- example:
- error:
- code: validation_error
- message: Gift card cannot be deleted
- "/api/v3/admin/invitations":
- get:
- summary: List invitations
- tags:
- - Configuration
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns invitations for the current store, including pending and accepted.
-
- **Required scope:** `read_settings` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: invitations } = await client.invitations.list()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
+ - name: page
+ in: query
+ required: false
+ description: Page number
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ description: Records per page
+ schema:
+ type: integer
+ - name: q[prefix_cont]
+ in: query
+ required: false
+ description: Filter by prefix (contains)
schema:
type: string
- - name: Authorization
- in: header
- required: true
+ - name: sort
+ in: query
+ required: false
+ description: Sort by field. Prefix with `-` for descending.
schema:
type: string
responses:
'200':
- description: invitations found
+ description: gift card batches found
content:
application/json:
example:
data:
- - id: inv_UkLWZg9DAJ
- status: pending
- created_at: '2026-06-05T13:12:10.949Z'
- updated_at: '2026-06-05T13:12:10.949Z'
- expires_at: '2026-06-19T13:12:10.946Z'
- role_id: role_UkLWZg9DAJ
- role_name: admin
- inviter_email: [email protected]
- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=N3LaaRRjJKwDAC53Q7d7XQHE"
- invitee_exists: false
- store:
- id: store_UkLWZg9DAJ
- name: Spree Test Store
+ - id: gcb_UkLWZg9DAJ
+ codes_count: 2
+ currency: USD
+ prefix: WELCOME
+ created_at: '2026-06-08T10:57:00.931Z'
+ updated_at: '2026-06-08T10:57:00.931Z'
+ amount: '50.0'
+ expires_at:
+ created_by_id:
meta:
page: 1
limit: 25
@@ -5126,17 +4859,34 @@ paths:
in: 1
previous:
next:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/GiftCardBatch"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ required:
+ - data
+ - meta
post:
- summary: Create an invitation
+ summary: Create a gift card batch
tags:
- - Configuration
+ - Gift Cards
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.
+ Issues a batch of gift cards in a single call. The server generates
+ `codes_count` cards inline for small batches (configurable via
+ `Spree.config.gift_card_batch_web_limit`, default 500) or enqueues
+ a background job for larger ones. Each card's code is the batch
+ `prefix` followed by random hex.
- **Required scope:** `write_settings` (for API-key authentication).
+
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5148,9 +4898,12 @@ paths:
secretKey: 'sk_xxx',
})
- const invitation = await client.invitations.create({
- email: '[email protected]',
- role_id: 'role_xxx'
+ const batch = await client.giftCardBatches.create({
+ prefix: 'WELCOME',
+ amount: '25.00',
+ currency: 'USD',
+ codes_count: 100,
+ expires_at: '2030-12-31',
})
parameters:
- name: x-spree-api-key
@@ -5165,48 +4918,83 @@ paths:
type: string
responses:
'201':
- description: invitation created
+ description: gift card batch created
content:
application/json:
example:
- id: inv_gbHJdmfrXB
- status: pending
- created_at: '2026-06-05T13:12:11.261Z'
- updated_at: '2026-06-05T13:12:11.261Z'
- expires_at: '2026-06-19T13:12:11.258Z'
- role_id: role_UkLWZg9DAJ
- role_name: admin
- inviter_email: [email protected]
- acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=wYFYKSZ6g8os2yNZ47uq9AKt"
- invitee_exists: false
- store:
- id: store_UkLWZg9DAJ
- name: Spree Test Store
+ id: gcb_gbHJdmfrXB
+ codes_count: 5
+ currency: USD
+ prefix: NEWCAMP
+ created_at: '2026-06-08T10:57:01.503Z'
+ updated_at: '2026-06-08T10:57:01.503Z'
+ amount: '25.0'
+ expires_at: '2030-12-31'
+ created_by_id: admin_UkLWZg9DAJ
+ schema:
+ "$ref": "#/components/schemas/GiftCardBatch"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Prefix can't be blank
+ details:
+ prefix:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
required:
- - email
- - role_id
+ - prefix
+ - amount
+ - codes_count
properties:
- email:
+ prefix:
type: string
- role_id:
+ example: WELCOME
+ description: Lowercased and prepended to every generated code.
+ amount:
type: string
- example: role_xxx
- "/api/v3/admin/invitations/{id}":
- delete:
- summary: Revoke an invitation
+ 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
+ "/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:
- - Configuration
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `write_settings` (for API-key authentication)."
+ description: |-
+ Returns a single batch.
+
+ **Required scope:** `read_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5218,7 +5006,7 @@ paths:
secretKey: 'sk_xxx',
})
- await client.invitations.delete('inv_xxx')
+ const batch = await client.giftCardBatches.get('gcb_K3zr8x')
parameters:
- name: x-spree-api-key
in: header
@@ -5230,26 +5018,48 @@ paths:
required: true
schema:
type: string
- - name: id
- in: path
- required: true
- schema:
- type: string
responses:
- '204':
- description: invitation revoked
- "/api/v3/admin/invitations/{id}/resend":
- patch:
- summary: Resend an invitation
+ '200':
+ description: gift card batch found
+ content:
+ application/json:
+ example:
+ id: gcb_UkLWZg9DAJ
+ codes_count: 2
+ currency: USD
+ prefix: WELCOME
+ created_at: '2026-06-08T10:57:01.792Z'
+ updated_at: '2026-06-08T10:57:01.792Z'
+ amount: '50.0'
+ expires_at:
+ created_by_id:
+ schema:
+ "$ref": "#/components/schemas/GiftCardBatch"
+ '404':
+ description: gift card batch not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Gift card batch not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/admin/gift_cards":
+ get:
+ summary: List gift cards
tags:
- - Configuration
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
description: |-
- Issues a fresh token and dispatches the invitation email again.
+ Returns the gift cards issued by the current store. Filter by
+ `q[code_cont]` for code search, `q[user_id_eq]` for cards issued
+ to a specific customer, or `q[state_eq]` for status filtering.
- **Required scope:** `write_settings` (for API-key authentication).
+
+ **Required scope:** `read_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5261,70 +5071,11 @@ paths:
secretKey: 'sk_xxx',
})
- const invitation = await client.invitations.resend('inv_xxx')
- 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:
- example:
- id: inv_UkLWZg9DAJ
- status: pending
- created_at: '2026-06-05T13:12:11.821Z'
- updated_at: '2026-06-05T13:12:11.821Z'
- expires_at: '2026-06-19T13:12:11.819Z'
- role_id: role_UkLWZg9DAJ
- role_name: admin
- inviter_email: [email protected]
- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=Yc4V21BzHSZrGdscgN1Nqty3"
- invitee_exists: false
- store:
- id: store_UkLWZg9DAJ
- name: Spree Test Store
- "/api/v3/admin/markets":
- get:
- summary: List markets
- tags:
- - Pricing
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns the markets configured for the current store. Markets are
- store-scoped and ordered by `position` (an `acts_as_list` column —
- update the order via `PATCH /markets/{id}` with `position`).
-
-
- **Required scope:** `read_settings` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: markets } = await client.markets.list()
+ const { data: giftCards } = await client.giftCards.list({
+ page: 1,
+ limit: 25,
+ expand: ['customer', 'created_by'],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -5334,61 +5085,98 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
schema:
type: string
- name: page
in: query
required: false
+ description: Page number
schema:
type: integer
- name: limit
in: query
required: false
+ description: Number of records per page
schema:
type: integer
- - name: q[name_cont]
+ - name: q[code_cont]
+ in: query
+ required: false
+ description: Filter by gift card code (contains)
+ schema:
+ type: string
+ - name: q[state_eq]
in: query
required: false
+ description: Filter by status (active, redeemed, partially_redeemed, canceled)
schema:
type: string
- name: sort
in: query
required: false
+ description: Sort by field. Prefix with `-` for descending (e.g., `-created_at`).
schema:
type: string
- - name: expand
+ - name: fields
in: query
required: false
- description: 'Comma-separated associations to embed. Supported: `countries`.'
+ description: Comma-separated list of fields to include. id is always included.
schema:
type: string
responses:
'200':
- description: markets found
+ description: gift cards found
content:
application/json:
example:
data:
- - id: mkt_UkLWZg9DAJ
- name: EU
+ - id: gc_UkLWZg9DAJ
+ code: BAA028CDF578F746
+ status: active
currency: USD
- default_locale: en
- tax_inclusive: false
- default: false
- country_isos:
- - DE
- supported_locales:
- - en
- created_at: '2026-06-05T13:12:11.873Z'
- updated_at: '2026-06-05T13:12:11.873Z'
+ amount: '50.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '50.0'
+ display_amount: "$50.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$50.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:02.369Z'
+ updated_at: '2026-06-08T10:57:02.369Z'
+ customer_id:
+ created_by_id:
+ - id: gc_gbHJdmfrXB
+ code: B7B9C97DAE77E96A
+ status: active
+ currency: USD
+ amount: '25.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '25.0'
+ display_amount: "$25.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$25.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:02.370Z'
+ updated_at: '2026-06-08T10:57:02.370Z'
+ customer_id:
+ created_by_id:
meta:
page: 1
limit: 25
- count: 1
+ count: 2
pages: 1
from: 1
- to: 1
- in: 1
+ to: 2
+ in: 2
previous:
next:
schema:
@@ -5397,32 +5185,37 @@ paths:
data:
type: array
items:
- "$ref": "#/components/schemas/Market"
+ "$ref": "#/components/schemas/GiftCard"
meta:
"$ref": "#/components/schemas/PaginationMeta"
required:
- data
- meta
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
post:
- summary: Create a market
+ summary: Create a gift card
tags:
- - Pricing
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
description: |-
- Creates a new market for the current store.
-
- - `country_isos` accepts 2-letter ISO country codes (e.g. `["DE", "FR"]`);
- the market must contain at least one country. Unknown codes are
- silently dropped.
- - `supported_locales` accepts an array of locale codes; the
- `default_locale` is always implicitly included.
- - Setting `default: true` automatically demotes the previous default
- market in the store.
+ Issues a gift card scoped to the current store. The code is
+ auto-generated when omitted. `currency` defaults to the store's
+ configured currency. Pass `user_id` (prefixed ID) to attach the
+ card to a specific customer.
- **Required scope:** `write_settings` (for API-key authentication).
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5434,13 +5227,11 @@ paths:
secretKey: 'sk_xxx',
})
- const market = await client.markets.create({
- name: 'Europe',
- currency: 'EUR',
- default_locale: 'de',
- supported_locales: ['de', 'en', 'fr'],
- tax_inclusive: true,
- country_isos: ['DE', 'FR', 'IT'],
+ const giftCard = await client.giftCards.create({
+ amount: '25.00',
+ currency: 'USD',
+ expires_at: '2030-12-31',
+ user_id: 'cus_UkLWZg9DAJ',
})
parameters:
- name: x-spree-api-key
@@ -5455,25 +5246,31 @@ paths:
type: string
responses:
'201':
- description: market created
+ description: gift card created
content:
application/json:
example:
- id: mkt_gbHJdmfrXB
- name: France only
- currency: EUR
- default_locale: fr
- tax_inclusive: true
- default: false
- country_isos:
- - FR
- supported_locales:
- - en
- - fr
- created_at: '2026-06-05T13:12:12.481Z'
- updated_at: '2026-06-05T13:12:12.481Z'
+ id: gc_EfhxLZ9ck8
+ code: E983499BEFF8FE2F
+ status: active
+ currency: USD
+ amount: '25.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '25.0'
+ display_amount: "$25.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$25.00"
+ expires_at: '2030-12-31'
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:02.961Z'
+ updated_at: '2026-06-08T10:57:02.961Z'
+ customer_id:
+ created_by_id: admin_UkLWZg9DAJ
schema:
- "$ref": "#/components/schemas/Market"
+ "$ref": "#/components/schemas/GiftCard"
'422':
description: validation error
content:
@@ -5481,17 +5278,10 @@ paths:
example:
error:
code: validation_error
- message: Name can't be blank, Currency can't be blank, Default locale
- can't be blank, and Countries can't be blank
+ message: Amount must be greater than 0
details:
- name:
- - can't be blank
- currency:
- - can't be blank
- default_locale:
- - can't be blank
- countries:
- - can't be blank
+ amount:
+ - must be greater than 0
schema:
"$ref": "#/components/schemas/ErrorResponse"
requestBody:
@@ -5499,67 +5289,51 @@ paths:
application/json:
schema:
type: object
+ required:
+ - amount
properties:
- name:
+ amount:
type: string
- example: Europe
+ example: '25.00'
+ description: Decimal amount, greater than zero.
currency:
type: string
- example: EUR
- description: ISO 4217 currency code.
- default_locale:
+ example: USD
+ description: ISO 4217 currency code. Defaults to the store currency.
+ code:
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_isos:
- 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_isos
- "/api/v3/admin/markets/{id}":
+ 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
+ user_id:
+ type: string
+ example: cus_UkLWZg9DAJ
+ 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 market
+ summary: Get a gift card
tags:
- - Pricing
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `read_settings` (for API-key authentication)."
+ description: |-
+ Returns a single gift card.
+
+ **Required scope:** `read_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5571,7 +5345,9 @@ paths:
secretKey: 'sk_xxx',
})
- const market = await client.markets.get('market_xxx')
+ const giftCard = await client.giftCards.get('gc_K3zr8x', {
+ expand: ['customer', 'created_by', 'orders'],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -5583,58 +5359,62 @@ paths:
required: true
schema:
type: string
- - name: expand
+ - name: fields
in: query
required: false
+ description: Comma-separated list of fields to include. id is always included.
schema:
type: string
responses:
'200':
- description: market found
+ description: gift card found
content:
application/json:
example:
- id: mkt_UkLWZg9DAJ
- name: EU
+ id: gc_UkLWZg9DAJ
+ code: 415FB670C81E9D04
+ status: active
currency: USD
- default_locale: en
- tax_inclusive: false
- default: false
- country_isos:
- - DE
- supported_locales:
- - en
- created_at: '2026-06-05T13:12:12.806Z'
- updated_at: '2026-06-05T13:12:12.806Z'
+ amount: '50.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '50.0'
+ display_amount: "$50.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$50.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:03.255Z'
+ updated_at: '2026-06-08T10:57:03.255Z'
+ customer_id:
+ created_by_id:
schema:
- "$ref": "#/components/schemas/Market"
+ "$ref": "#/components/schemas/GiftCard"
'404':
- description: market not found
+ description: gift card not found
content:
application/json:
example:
error:
code: record_not_found
- message: Market not found
+ message: Gift card not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
patch:
- summary: Update a market
+ summary: Update a gift card
tags:
- - Pricing
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
description: |-
- Updates an existing market. Pass `country_isos` to replace the
- market's country list (full-set update), `supported_locales` to
- replace the supported locales, or `position` to reorder the market
- within the store.
-
- Setting `default: true` automatically demotes the previous default.
+ Updates an active gift card's editable attributes. Redeemed or
+ partially-redeemed cards cannot be edited.
- **Required scope:** `write_settings` (for API-key authentication).
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5646,13 +5426,8 @@ paths:
secretKey: 'sk_xxx',
})
- // `country_isos` is a full-set update — the market is reconciled to match
- // the array (adds new countries, removes ones not present). Setting
- // `default: true` demotes the previous default market in the store.
- const market = await client.markets.update('market_UkLWZg9DAJ', {
- name: 'European Union',
- tax_inclusive: true,
- country_isos: ['DE', 'FR'],
+ const giftCard = await client.giftCards.update('gc_K3zr8x', {
+ amount: '75.00',
})
parameters:
- name: x-spree-api-key
@@ -5667,77 +5442,61 @@ paths:
type: string
responses:
'200':
- description: market updated
+ description: gift card updated
content:
application/json:
example:
- id: mkt_UkLWZg9DAJ
- name: European Union
+ id: gc_UkLWZg9DAJ
+ code: 8BDA7FE50F533A90
+ status: active
currency: USD
- default_locale: en
- tax_inclusive: true
- default: false
- country_isos:
- - DE
- supported_locales:
- - en
- created_at: '2026-06-05T13:12:13.407Z'
- updated_at: '2026-06-05T13:12:13.691Z'
- schema:
- "$ref": "#/components/schemas/Market"
- '422':
- description: validation error
- content:
- application/json:
- example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
+ amount: '75.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '75.0'
+ display_amount: "$75.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$75.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:03.831Z'
+ updated_at: '2026-06-08T10:57:04.125Z'
+ customer_id:
+ created_by_id:
schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ "$ref": "#/components/schemas/GiftCard"
requestBody:
content:
application/json:
schema:
type: object
properties:
- name:
+ amount:
type: string
- currency:
+ example: '75.00'
+ expires_at:
type: string
- default_locale:
+ example: '2031-12-31'
+ nullable: true
+ user_id:
type: string
- supported_locales:
- type: array
- items:
- type: string
- tax_inclusive:
- type: boolean
- default:
- type: boolean
- position:
- type: integer
- country_isos:
- type: array
- items:
- type: string
+ example: cus_UkLWZg9DAJ
+ nullable: true
delete:
- summary: Delete a market
+ summary: Delete a gift card
tags:
- - Pricing
+ - Gift Cards
security:
- api_key: []
bearer_auth: []
description: |-
- Soft-deletes the market (sets `deleted_at`). The default market and
- the last remaining market in a store cannot be deleted — both return
- 422 with a `validation_error`.
+ Deletes an unused gift card. Cards that have been redeemed or
+ partially redeemed cannot be deleted and return 422.
- **Required scope:** `write_settings` (for API-key authentication).
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5749,9 +5508,7 @@ paths:
secretKey: 'sk_xxx',
})
- // Soft-deletes the market (sets `deleted_at`). The default market and the
- // last remaining market in a store cannot be deleted — both return 422.
- await client.markets.delete('market_UkLWZg9DAJ')
+ await client.giftCards.delete('gc_K3zr8x')
parameters:
- name: x-spree-api-key
in: header
@@ -5765,25 +5522,30 @@ paths:
type: string
responses:
'204':
- description: market deleted
+ description: gift card deleted
'422':
- description: cannot delete default or last market
+ description: redeemed gift card cannot be deleted
content:
application/json:
example:
error:
code: validation_error
- message: Market cannot be deleted
- "/api/v3/admin/me":
+ message: Gift card cannot be deleted
+ "/api/v3/admin/markets":
get:
- summary: Get current admin user and permissions
+ summary: List markets
tags:
- - Authentication
+ - Markets
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.
+ description: |-
+ Returns the markets configured for the current store. Markets are
+ store-scoped and ordered by `position` (an `acts_as_list` column —
+ update the order via `PATCH /markets/{id}` with `position`).
+
+
+ **Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -5795,10 +5557,7 @@ paths:
secretKey: 'sk_xxx',
})
- const me = await client.me.get()
- if (me.permissions.some((r) => r.allow && r.actions.includes('manage') && r.subjects.includes('Spree::Product'))) {
- // show "Create product" button
- }
+ const { data: markets } = await client.markets.list()
parameters:
- name: x-spree-api-key
in: header
@@ -5808,174 +5567,53 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: sort
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: 'Comma-separated associations to embed. Supported: `countries`.'
schema:
type: string
responses:
'200':
- description: current admin user and permissions
- content:
- application/json:
- example:
- user:
- id: admin_UkLWZg9DAJ
- first_name: Contessa
- last_name: Wilkinson
- full_name: Contessa Wilkinson
- created_at: '2026-06-05T13:12:14.933Z'
- updated_at: '2026-06-05T13:12:14.933Z'
- roles:
- - id: role_UkLWZg9DAJ
- name: admin
- permissions:
- - allow: true
- actions:
- - manage
- subjects:
- - all
- has_conditions: false
- - allow: false
- actions:
- - cancel
- subjects:
- - Spree::Order
- has_conditions: false
- - allow: true
- actions:
- - cancel
- subjects:
- - Spree::Order
- has_conditions: true
- - allow: false
- actions:
- - destroy
- subjects:
- - Spree::Order
- has_conditions: false
- - allow: true
- actions:
- - destroy
- subjects:
- - Spree::Order
- has_conditions: true
- - allow: false
- actions:
- - edit
- - update
- subjects:
- - Spree::RefundReason
- has_conditions: true
- - allow: false
- actions:
- - edit
- - update
- subjects:
- - Spree::ReimbursementType
- has_conditions: true
- - allow: false
- actions:
- - update
- - destroy
- subjects:
- - Spree::Role
- has_conditions: true
- schema:
- "$ref": "#/components/schemas/MeResponse"
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/admin/option_types":
- get:
- summary: List option types
- tags:
- - Product Catalog
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns a paginated list of option types.
-
- **Required scope:** `read_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: optionTypes } = await client.optionTypes.list()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
- description: Bearer token for admin authentication
- schema:
- type: string
- - name: page
- in: query
- required: false
- description: Page number
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: Number of records per page
- schema:
- type: integer
- - name: q[name_cont]
- in: query
- required: false
- description: Filter by name (contains)
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (e.g., option_values).
- Use dot notation for nested expand (max 4 levels).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,label,position).
- id is always included.
- schema:
- type: string
- responses:
- '200':
- description: option types found
+ description: markets found
content:
application/json:
example:
data:
- - id: opt_UkLWZg9DAJ
- name: foo-size-1
- label: Size
- position: 1
- kind: dropdown
- metadata: {}
- filterable: true
- created_at: '2026-06-05T13:12:14.971Z'
- updated_at: '2026-06-05T13:12:14.971Z'
+ - id: mkt_UkLWZg9DAJ
+ name: EU
+ currency: USD
+ default_locale: en
+ tax_inclusive: false
+ default: false
+ country_isos:
+ - DE
+ supported_locales:
+ - en
+ created_at: '2026-06-08T10:57:05.954Z'
+ updated_at: '2026-06-08T10:57:05.954Z'
meta:
page: 1
limit: 25
@@ -5992,36 +5630,32 @@ paths:
data:
type: array
items:
- "$ref": "#/components/schemas/OptionType"
+ "$ref": "#/components/schemas/Market"
meta:
"$ref": "#/components/schemas/PaginationMeta"
required:
- data
- meta
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
post:
- summary: Create an option type
+ summary: Create a market
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
bearer_auth: []
description: |-
- Creates a new option type. Supports nested option values.
+ Creates a new market for the current store.
- Option values can be provided inline and will be created or updated by name.
+ - `country_isos` accepts 2-letter ISO country codes (e.g. `["DE", "FR"]`);
+ the market must contain at least one country. Unknown codes are
+ silently dropped.
+ - `supported_locales` accepts an array of locale codes; the
+ `default_locale` is always implicitly included.
+ - Setting `default: true` automatically demotes the previous default
+ market in the store.
- **Required scope:** `write_products` (for API-key authentication).
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6033,13 +5667,13 @@ paths:
secretKey: 'sk_xxx',
})
- const optionType = await client.optionTypes.create({
- name: 'color',
- presentation: 'Color',
- option_values: [
- { name: 'red', presentation: 'Red' },
- { name: 'navy', presentation: 'Navy' },
- ],
+ const market = await client.markets.create({
+ name: 'Europe',
+ currency: 'EUR',
+ default_locale: 'de',
+ supported_locales: ['de', 'en', 'fr'],
+ tax_inclusive: true,
+ country_isos: ['DE', 'FR', 'IT'],
})
parameters:
- name: x-spree-api-key
@@ -6050,26 +5684,29 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
responses:
'201':
- description: option type created
+ description: market created
content:
application/json:
example:
- id: opt_gbHJdmfrXB
- name: material
- label: Material
- position: 2
- kind: dropdown
- metadata: {}
- filterable: true
- created_at: '2026-06-05T13:12:15.556Z'
- updated_at: '2026-06-05T13:12:15.556Z'
+ id: mkt_gbHJdmfrXB
+ name: France only
+ currency: EUR
+ default_locale: fr
+ tax_inclusive: true
+ default: false
+ country_isos:
+ - FR
+ supported_locales:
+ - en
+ - fr
+ created_at: '2026-06-08T10:57:06.548Z'
+ updated_at: '2026-06-08T10:57:06.548Z'
schema:
- "$ref": "#/components/schemas/OptionType"
+ "$ref": "#/components/schemas/Market"
'422':
description: validation error
content:
@@ -6077,11 +5714,16 @@ paths:
example:
error:
code: validation_error
- message: Name can't be blank and Presentation can't be blank
+ message: Name can't be blank, Currency can't be blank, Default locale
+ can't be blank, and Countries can't be blank
details:
name:
- can't be blank
- presentation:
+ currency:
+ - can't be blank
+ default_locale:
+ - can't be blank
+ countries:
- can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
@@ -6093,44 +5735,64 @@ paths:
properties:
name:
type: string
- example: color
- label:
+ example: Europe
+ currency:
type: string
- example: Color
+ 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
- example: 1
- filterable:
- type: boolean
- example: true
- option_values:
+ description: Sort order within the store; lower = first.
+ country_isos:
type: array
items:
- type: object
- properties:
- name:
- type: string
- example: red
- label:
- type: string
- example: Red
- position:
- type: integer
+ type: string
+ description: 2-letter ISO country codes assigned to this market.
+ At least one is required.
+ example:
+ - DE
+ - FR
required:
- name
- - label
- "/api/v3/admin/option_types/{id}":
- get:
- summary: Get an option type
- tags:
- - Product Catalog
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Returns a single option type by ID, including its option values.
-
- **Required scope:** `read_products` (for API-key authentication).
+ - currency
+ - default_locale
+ - country_isos
+ "/api/v3/admin/markets/{id}":
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ get:
+ summary: Get a market
+ tags:
+ - Markets
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: "**Required scope:** `read_settings` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6142,7 +5804,7 @@ paths:
secretKey: 'sk_xxx',
})
- const optionType = await client.optionTypes.get('ot_UkLWZg9DAJ')
+ const market = await client.markets.get('market_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -6152,67 +5814,60 @@ paths:
- 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
+ description: market found
content:
application/json:
example:
- id: opt_UkLWZg9DAJ
- name: foo-size-5
- label: Size
- position: 1
- kind: dropdown
- metadata: {}
- filterable: true
- created_at: '2026-06-05T13:12:15.850Z'
- updated_at: '2026-06-05T13:12:15.850Z'
+ id: mkt_UkLWZg9DAJ
+ name: EU
+ currency: USD
+ default_locale: en
+ tax_inclusive: false
+ default: false
+ country_isos:
+ - DE
+ supported_locales:
+ - en
+ created_at: '2026-06-08T10:57:06.885Z'
+ updated_at: '2026-06-08T10:57:06.885Z'
schema:
- "$ref": "#/components/schemas/OptionType"
+ "$ref": "#/components/schemas/Market"
'404':
- description: option type not found
+ description: market not found
content:
application/json:
example:
error:
code: record_not_found
- message: Option type not found
+ message: Market not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
patch:
- summary: Update an option type
+ summary: Update a market
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
bearer_auth: []
description: |-
- Updates an option type. Supports updating nested option values.
+ Updates an existing market. Pass `country_isos` to replace the
+ market's country list (full-set update), `supported_locales` to
+ replace the supported locales, or `position` to reorder the market
+ within the store.
- **Required scope:** `write_products` (for API-key authentication).
+ Setting `default: true` automatically demotes the previous default.
+
+
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6224,11 +5879,13 @@ paths:
secretKey: 'sk_xxx',
})
- const optionType = await client.optionTypes.update('ot_UkLWZg9DAJ', {
- presentation: 'Updated Presentation',
- option_values: [
- { name: 'red', presentation: 'Crimson' },
- ],
+ // `country_isos` is a full-set update — the market is reconciled to match
+ // the array (adds new countries, removes ones not present). Setting
+ // `default: true` demotes the previous default market in the store.
+ const market = await client.markets.update('market_UkLWZg9DAJ', {
+ name: 'European Union',
+ tax_inclusive: true,
+ country_isos: ['DE', 'FR'],
})
parameters:
- name: x-spree-api-key
@@ -6239,32 +5896,28 @@ paths:
- 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
+ description: market updated
content:
application/json:
example:
- id: opt_UkLWZg9DAJ
- name: foo-size-7
- label: Updated Label
- position: 1
- kind: dropdown
- metadata: {}
- filterable: true
- created_at: '2026-06-05T13:12:16.438Z'
- updated_at: '2026-06-05T13:12:16.733Z'
+ id: mkt_UkLWZg9DAJ
+ name: European Union
+ currency: USD
+ default_locale: en
+ tax_inclusive: true
+ default: false
+ country_isos:
+ - DE
+ supported_locales:
+ - en
+ created_at: '2026-06-08T10:57:07.498Z'
+ updated_at: '2026-06-08T10:57:07.783Z'
schema:
- "$ref": "#/components/schemas/OptionType"
+ "$ref": "#/components/schemas/Market"
'422':
description: validation error
content:
@@ -6272,9 +5925,9 @@ paths:
example:
error:
code: validation_error
- message: Presentation can't be blank
+ message: Name can't be blank
details:
- presentation:
+ name:
- can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
@@ -6286,43 +5939,38 @@ paths:
properties:
name:
type: string
- example: color
- label:
+ currency:
type: string
- example: Color
+ default_locale:
+ type: string
+ supported_locales:
+ type: array
+ items:
+ type: string
+ tax_inclusive:
+ type: boolean
+ default:
+ type: boolean
position:
type: integer
- example: 1
- filterable:
- type: boolean
- example: true
- option_values:
+ country_isos:
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
+ type: string
delete:
- summary: Delete an option type
+ summary: Delete a market
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
bearer_auth: []
description: |-
- Deletes an option type.
+ Soft-deletes the market (sets `deleted_at`). The default market and
+ the last remaining market in a store cannot be deleted — both return
+ 422 with a `validation_error`.
- **Required scope:** `write_products` (for API-key authentication).
+
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6334,7 +5982,9 @@ paths:
secretKey: 'sk_xxx',
})
- await client.optionTypes.delete('ot_UkLWZg9DAJ')
+ // Soft-deletes the market (sets `deleted_at`). The default market and the
+ // last remaining market in a store cannot be deleted — both return 422.
+ await client.markets.delete('market_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -6344,30 +5994,31 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
- schema:
- type: string
- - name: id
- in: path
- required: true
- description: Option type ID
schema:
type: string
responses:
'204':
- description: option type deleted
- "/api/v3/admin/orders/{order_id}/fulfillments":
+ description: market deleted
+ '422':
+ description: cannot delete default or last market
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Market cannot be deleted
+ "/api/v3/admin/option_types":
get:
- summary: List fulfillments
+ summary: List option types
tags:
- - Orders
+ - Option Types
security:
- api_key: []
bearer_auth: []
description: |-
- Returns all shipments for an order.
+ Returns a paginated list of option types.
- **Required scope:** `read_fulfillments` (for API-key authentication).
+ **Required scope:** `read_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6379,7 +6030,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: fulfillments } = await client.orders.fulfillments.list('or_UkLWZg9DAJ')
+ const { data: optionTypes } = await client.optionTypes.list()
parameters:
- name: x-spree-api-key
in: header
@@ -6392,64 +6043,54 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
- in: path
- required: true
- description: Order ID
+ - name: page
+ in: query
+ required: false
+ description: Page number
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ description: Number of records per page
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ description: Filter by name (contains)
schema:
type: string
- name: expand
in: query
required: false
- description: Comma-separated associations to expand (e.g., inventory_units,
- stock_location, shipping_rates). Use dot notation for nested expand (max
- 4 levels).
+ 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., number,status,tracking,cost).
+ description: Comma-separated list of fields to include (e.g., name,label,position).
id is always included.
schema:
type: string
responses:
'200':
- description: fulfillments found
+ description: option types found
content:
application/json:
example:
data:
- - id: ful_UkLWZg9DAJ
- number: H66206934403
- tracking: U10000
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: ready
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
+ - id: opt_UkLWZg9DAJ
+ name: foo-size-1
+ label: Size
+ position: 1
+ kind: dropdown
metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:17.678Z'
- updated_at: '2026-06-05T13:12:17.764Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
+ filterable: true
+ created_at: '2026-06-08T10:57:09.036Z'
+ updated_at: '2026-06-08T10:57:09.036Z'
meta:
page: 1
limit: 25
@@ -6460,18 +6101,42 @@ paths:
in: 1
previous:
next:
- "/api/v3/admin/orders/{order_id}/fulfillments/{id}":
- get:
- summary: Show a shipment
+ 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:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ post:
+ summary: Create an option type
tags:
- - Orders
+ - Option Types
security:
- api_key: []
bearer_auth: []
description: |-
- Returns details of a specific shipment.
+ Creates a new option type. Supports nested option values.
- **Required scope:** `read_fulfillments` (for API-key authentication).
+ Option values can be provided inline and will be created or updated by name.
+
+
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6483,7 +6148,14 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.get('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
+ const optionType = await client.optionTypes.create({
+ name: 'color',
+ presentation: 'Color',
+ option_values: [
+ { name: 'red', presentation: 'Red' },
+ { name: 'navy', presentation: 'Navy' },
+ ],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -6496,80 +6168,166 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
- in: path
+ responses:
+ '201':
+ description: option type created
+ content:
+ application/json:
+ example:
+ id: opt_gbHJdmfrXB
+ name: material
+ label: Material
+ position: 2
+ kind: dropdown
+ metadata: {}
+ filterable: true
+ created_at: '2026-06-08T10:57:09.626Z'
+ updated_at: '2026-06-08T10:57:09.626Z'
+ schema:
+ "$ref": "#/components/schemas/OptionType"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Name can't be blank and Presentation can't be blank
+ details:
+ name:
+ - can't be blank
+ presentation:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ 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
+ "/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.
+
+ **Required scope:** `read_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const optionType = await client.optionTypes.get('ot_UkLWZg9DAJ')
+ parameters:
+ - name: x-spree-api-key
+ in: header
required: true
- description: Order ID
+ 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: Fulfillment ID
+ description: Option type 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).
+ 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., number,status,tracking,cost).
+ description: Comma-separated list of fields to include (e.g., name,label,position).
id is always included.
schema:
type: string
responses:
'200':
- description: shipment found
+ description: option type found
content:
application/json:
example:
- id: ful_UkLWZg9DAJ
- number: H71788811584
- tracking: U10000
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: ready
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
+ id: opt_UkLWZg9DAJ
+ name: foo-size-5
+ label: Size
+ position: 1
+ kind: dropdown
metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:18.394Z'
- updated_at: '2026-06-05T13:12:18.461Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
+ filterable: true
+ created_at: '2026-06-08T10:57:09.919Z'
+ updated_at: '2026-06-08T10:57:09.919Z'
+ schema:
+ "$ref": "#/components/schemas/OptionType"
+ '404':
+ description: option type not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Option type not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
patch:
- summary: Update a shipment
+ summary: Update an option type
tags:
- - Orders
+ - Option Types
security:
- api_key: []
bearer_auth: []
description: |-
- Updates a shipment (tracking, shipping rate).
+ Updates an option type. Supports updating nested option values.
- **Required scope:** `write_fulfillments` (for API-key authentication).
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6581,8 +6339,11 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.update('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {
- tracking: '1Z999AA10123456784',
+ const optionType = await client.optionTypes.update('ot_UkLWZg9DAJ', {
+ presentation: 'Updated Presentation',
+ option_values: [
+ { name: 'red', presentation: 'Crimson' },
+ ],
})
parameters:
- name: x-spree-api-key
@@ -6596,77 +6357,87 @@ paths:
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
+ description: Option type ID
schema:
type: string
responses:
'200':
- description: shipment updated
+ description: option type updated
content:
application/json:
example:
- id: ful_UkLWZg9DAJ
- number: H67296446384
- tracking: 1Z999AA10123456784
- tracking_url: https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1Z999AA10123456784
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: ready
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
+ id: opt_UkLWZg9DAJ
+ name: foo-size-7
+ label: Updated Label
+ position: 1
+ kind: dropdown
metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:19.053Z'
- updated_at: '2026-06-05T13:12:19.401Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
- requestBody:
- content:
- application/json:
- schema:
+ filterable: true
+ created_at: '2026-06-08T10:57:10.492Z'
+ updated_at: '2026-06-08T10:57:10.771Z'
+ schema:
+ "$ref": "#/components/schemas/OptionType"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Presentation can't be blank
+ details:
+ presentation:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
type: object
properties:
- tracking:
+ name:
type: string
- example: 1Z999AA10123456784
- selected_shipping_rate_id:
+ example: color
+ label:
type: string
- "/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":
- patch:
- summary: Fulfill a fulfillment
+ 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
+ delete:
+ summary: Delete an option type
tags:
- - Orders
+ - Option Types
security:
- api_key: []
bearer_auth: []
description: |-
- Marks a fulfillment as fulfilled.
+ Deletes an option type.
- **Required scope:** `write_fulfillments` (for API-key authentication).
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6678,7 +6449,7 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.fulfill('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
+ await client.optionTypes.delete('ot_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -6691,66 +6462,27 @@ paths:
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
+ description: Option type ID
schema:
type: string
responses:
- '200':
- description: fulfillment fulfilled
- content:
- application/json:
- example:
- id: ful_UkLWZg9DAJ
- number: H69393047882
- tracking: U10000
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: shipped
- fulfillment_type: shipping
- fulfilled_at: '2026-06-05T13:12:20Z'
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:19.753Z'
- updated_at: '2026-06-05T13:12:20.121Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
- "/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":
- patch:
- summary: Cancel a fulfillment
+ '204':
+ description: option type deleted
+ "/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: |-
- Cancels a fulfillment.
+ Applies a gift card by code to the order. Returns the gift card.
- **Required scope:** `write_fulfillments` (for API-key authentication).
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6762,7 +6494,9 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.cancel('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
+ await client.orders.giftCards.apply('or_UkLWZg9DAJ', {
+ code: 'GIFT-XXXX-YYYY',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -6781,60 +6515,55 @@ paths:
description: Order ID
schema:
type: string
- - name: id
- in: path
- required: true
- description: Fulfillment ID
- schema:
- type: string
responses:
- '200':
- description: fulfillment canceled
+ '201':
+ description: gift card applied
content:
application/json:
example:
- id: ful_UkLWZg9DAJ
- number: H10254297058
- tracking: U10000
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: canceled
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:20.465Z'
- updated_at: '2026-06-05T13:12:20.820Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
- "/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":
- patch:
- summary: Resume a fulfillment
+ id: gc_UkLWZg9DAJ
+ code: D1978DA92B314BFD
+ status: active
+ currency: USD
+ amount: '10.0'
+ amount_used: '10.0'
+ amount_authorized: '0.0'
+ amount_remaining: '0.0'
+ display_amount: "$10.00"
+ display_amount_used: "$10.00"
+ display_amount_remaining: "$0.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ created_at: '2026-06-08T10:57:16.764Z'
+ updated_at: '2026-06-08T10:57:17.068Z'
+ customer_id:
+ created_by_id:
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - code
+ properties:
+ code:
+ type: string
+ description: Gift card code
+ example: GIFT-XXXX-YYYY
+ "/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: |-
- Resumes a canceled fulfillment.
+ Removes the gift card from the order.
- **Required scope:** `write_fulfillments` (for API-key authentication).
+ **Required scope:** `write_gift_cards` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6846,7 +6575,7 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.resume('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')
+ await client.orders.giftCards.remove('or_UkLWZg9DAJ', 'gc_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -6868,57 +6597,24 @@ paths:
- name: id
in: path
required: true
- description: Fulfillment ID
+ description: Gift card ID
schema:
type: string
responses:
- '200':
- description: fulfillment resumed
- content:
- application/json:
- example:
- id: ful_UkLWZg9DAJ
- number: H16692131444
- tracking: U10000
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:21.205Z'
- updated_at: '2026-06-05T13:12:21.558Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_UkLWZg9DAJ
- "/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":
- patch:
- summary: Split a fulfillment
+ '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: |-
- Transfers items from this shipment to a new shipment at a different stock location.
+ Returns all line items for an order.
- **Required scope:** `write_fulfillments` (for API-key authentication).
+ **Required scope:** `read_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -6930,9 +6626,7 @@ paths:
secretKey: 'sk_xxx',
})
- const fulfillment = await client.orders.fulfillments.split('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {
- quantity: 1,
- })
+ const { data: items } = await client.orders.items.list('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -6951,246 +6645,11 @@ paths:
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:
- example:
- data:
- - id: ful_gbHJdmfrXB
- number: H35539389110
- tracking:
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: ready
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- metadata: {}
- adjustment_total: '0.0'
- pre_tax_amount: '0.0'
- created_at: '2026-06-05T13:12:22.230Z'
- updated_at: '2026-06-05T13:12:22.284Z'
- order_id: or_UkLWZg9DAJ
- stock_location_id: sloc_gbHJdmfrXB
- requestBody:
- 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
- "/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.
-
- **Required scope:** `write_gift_cards` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- await client.orders.giftCards.apply('or_UkLWZg9DAJ', {
- code: 'GIFT-XXXX-YYYY',
- })
- parameters:
- - name: x-spree-api-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:
- example:
- id: gc_UkLWZg9DAJ
- code: 0F23E851245D7551
- status: active
- currency: USD
- amount: '10.0'
- amount_used: '10.0'
- amount_authorized: '0.0'
- amount_remaining: '0.0'
- display_amount: "$10.00"
- display_amount_used: "$10.00"
- display_amount_remaining: "$0.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- created_at: '2026-06-05T13:12:22.652Z'
- updated_at: '2026-06-05T13:12:22.951Z'
- customer_id:
- created_by_id:
- requestBody:
- content:
- application/json:
- schema:
- type: object
- required:
- - code
- properties:
- code:
- type: string
- description: Gift card code
- example: GIFT-XXXX-YYYY
- "/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.
-
- **Required scope:** `write_gift_cards` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- await client.orders.giftCards.remove('or_UkLWZg9DAJ', 'gc_UkLWZg9DAJ')
- parameters:
- - name: x-spree-api-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.
-
- **Required scope:** `read_orders` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: items } = await client.orders.items.list('or_UkLWZg9DAJ')
- parameters:
- - name: x-spree-api-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).
+ - 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
@@ -7211,8 +6670,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 2
currency: USD
- name: Product 123949
- slug: product-123949
+ name: Product 121399
+ slug: product-121399
options_text: 'Size: S'
price: '10.0'
display_price: "$10.00"
@@ -7244,12 +6703,12 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:12:23.640Z'
- updated_at: '2026-06-05T13:12:23.640Z'
+ created_at: '2026-06-08T10:57:17.775Z'
+ updated_at: '2026-06-08T10:57:17.775Z'
digital_links: []
metadata: {}
- created_at: '2026-06-05T13:12:23.928Z'
- updated_at: '2026-06-05T13:12:23.928Z'
+ created_at: '2026-06-08T10:57:18.061Z'
+ updated_at: '2026-06-08T10:57:18.061Z'
cost_price: '17.0'
tax_category_id: taxcat_UkLWZg9DAJ
meta:
@@ -7316,8 +6775,8 @@ paths:
variant_id: variant_VqXmZF31wY
quantity: 3
currency: USD
- name: Product 146023
- slug: product-146023
+ name: Product 14285
+ slug: product-14285
options_text: 'Size: S'
price: '19.99'
display_price: "$19.99"
@@ -7349,12 +6808,12 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:12:24.866Z'
- updated_at: '2026-06-05T13:12:24.866Z'
+ created_at: '2026-06-08T10:57:19.059Z'
+ updated_at: '2026-06-08T10:57:19.059Z'
digital_links: []
metadata: {}
- created_at: '2026-06-05T13:12:24.902Z'
- updated_at: '2026-06-05T13:12:24.902Z'
+ created_at: '2026-06-08T10:57:19.089Z'
+ updated_at: '2026-06-08T10:57:19.089Z'
cost_price: '17.0'
tax_category_id: taxcat_UkLWZg9DAJ
requestBody:
@@ -7443,8 +6902,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 2
currency: USD
- name: Product 154567
- slug: product-154567
+ name: Product 158509
+ slug: product-158509
options_text: 'Size: S'
price: '10.0'
display_price: "$10.00"
@@ -7476,12 +6935,12 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:12:24.995Z'
- updated_at: '2026-06-05T13:12:24.995Z'
+ created_at: '2026-06-08T10:57:19.183Z'
+ updated_at: '2026-06-08T10:57:19.183Z'
digital_links: []
metadata: {}
- created_at: '2026-06-05T13:12:25.281Z'
- updated_at: '2026-06-05T13:12:25.281Z'
+ created_at: '2026-06-08T10:57:19.496Z'
+ updated_at: '2026-06-08T10:57:19.496Z'
cost_price: '17.0'
tax_category_id: taxcat_UkLWZg9DAJ
patch:
@@ -7543,8 +7002,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 5
currency: USD
- name: Product 163612
- slug: product-163612
+ name: Product 164071
+ slug: product-164071
options_text: 'Size: S'
price: '19.99'
display_price: "$19.99"
@@ -7576,12 +7035,12 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:12:25.675Z'
- updated_at: '2026-06-05T13:12:25.675Z'
+ created_at: '2026-06-08T10:57:19.842Z'
+ updated_at: '2026-06-08T10:57:19.842Z'
digital_links: []
metadata: {}
- created_at: '2026-06-05T13:12:25.974Z'
- updated_at: '2026-06-05T13:12:26.297Z'
+ created_at: '2026-06-08T10:57:20.129Z'
+ updated_at: '2026-06-08T10:57:20.438Z'
cost_price: '17.0'
tax_category_id: taxcat_UkLWZg9DAJ
requestBody:
@@ -7642,18 +7101,18 @@ paths:
responses:
'204':
description: line item removed
- "/api/v3/admin/orders/{order_id}/payments":
- get:
- summary: List payments
+ "/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: |-
- Returns all payments for an order.
+ Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.
- **Required scope:** `read_payments` (for API-key authentication).
+ **Required scope:** `write_store_credits` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -7665,7 +7124,9 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: payments } = await client.orders.payments.list('or_UkLWZg9DAJ')
+ const order = await client.orders.storeCredits.apply('or_UkLWZg9DAJ', {
+ amount: 25.00,
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -7684,79 +7145,89 @@ paths:
description: Order ID
schema:
type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (e.g., payment_method,
- source). Use dot notation for nested expand (max 4 levels).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., amount,status,number,response_code).
- id is always included.
- schema:
- type: string
responses:
- '200':
- description: payments found
+ '201':
+ description: store credit applied
content:
application/json:
example:
- data:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: BGS-610e4508ff71
- number: PA2ZJ1PN
- amount: '110.0'
- display_amount: "$110.00"
- status: completed
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- customer_id:
- payment_method_id: pm_gbHJdmfrXB
- metadata: {}
- created_at: '2026-06-05T13:12:27.286Z'
- updated_at: '2026-06-05T13:12:27.289Z'
- metadata: {}
- avs_response:
- cvv_response_code:
- cvv_response_message:
- created_at: '2026-06-05T13:12:27.288Z'
- updated_at: '2026-06-05T13:12:27.288Z'
- captured_amount: '0.0'
- order_id: or_UkLWZg9DAJ
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- post:
- summary: Create a payment
+ id: or_UkLWZg9DAJ
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R970913639
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '60.0'
+ display_amount_due: "$60.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ fulfillment_status:
+ payment_status:
+ completed_at:
+ store_credit_total: '50.0'
+ display_store_credit_total: "-$50.00"
+ covered_by_store_credit: false
+ gift_card:
+ market:
+ status: draft
+ last_ip_address:
+ considered_risky: false
+ confirmation_delivered: false
+ store_owner_notification_delivered:
+ payment_total: '0.0'
+ display_payment_total: "$0.00"
+ metadata: {}
+ canceled_at:
+ approved_at:
+ created_at: '2026-06-08T10:57:27.159Z'
+ updated_at: '2026-06-08T10:57:27.226Z'
+ preferred_stock_location_id:
+ tags: []
+ internal_note:
+ approver_id:
+ canceler_id:
+ created_by_id:
+ customer_id: cus_UkLWZg9DAJ
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ amount:
+ type: number
+ 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: |-
- Creates a new payment for the order.
+ Removes any applied store credit from the order.
- **Required scope:** `write_payments` (for API-key authentication).
+ **Required scope:** `write_store_credits` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -7768,11 +7239,7 @@ paths:
secretKey: 'sk_xxx',
})
- const payment = await client.orders.payments.create('or_UkLWZg9DAJ', {
- payment_method_id: 'pm_UkLWZg9DAJ',
- amount: 99.99,
- source_id: 'cc_UkLWZg9DAJ',
- })
+ await client.orders.storeCredits.remove('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -7792,58 +7259,20 @@ paths:
schema:
type: string
responses:
- '201':
- description: payment created
- content:
- application/json:
- example:
- id: py_gbHJdmfrXB
- payment_method_id: pm_EfhxLZ9ck8
- response_code:
- number: PXM5FBY9
- amount: '110.0'
- display_amount: "$110.00"
- status: checkout
- source_type:
- source_id:
- source:
- metadata: {}
- avs_response:
- cvv_response_code:
- cvv_response_message:
- created_at: '2026-06-05T13:12:28.585Z'
- updated_at: '2026-06-05T13:12:28.585Z'
- captured_amount: '0.0'
- order_id: or_gbHJdmfrXB
- requestBody:
- content:
- application/json:
- schema:
- type: object
- required:
- - payment_method_id
- properties:
- payment_method_id:
- type: string
- description: Payment method ID
- amount:
- type: number
- example: 99.99
- source_id:
- type: string
- description: Payment source ID
- "/api/v3/admin/orders/{order_id}/payments/{id}":
+ '204':
+ description: store credit removed
+ "/api/v3/admin/orders":
get:
- summary: Show a payment
+ summary: List orders
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Returns details of a specific payment.
+ Returns a paginated list of orders for the current store.
- **Required scope:** `read_payments` (for API-key authentication).
+ **Required scope:** `read_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -7855,7 +7284,12 @@ paths:
secretKey: 'sk_xxx',
})
- const payment = await client.orders.payments.get('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
+ const { data: orders, meta } = await client.orders.list({
+ status_eq: 'complete',
+ completed_at_gt: '2026-01-01',
+ sort: '-completed_at',
+ limit: 25,
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -7868,176 +7302,154 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
- in: path
- required: true
- description: Order ID
+ - 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: id
- in: path
- required: true
- description: Payment ID
+ - name: q[state_eq]
+ in: query
+ required: false
+ description: Filter by state (cart, address, delivery, payment, confirm, complete,
+ canceled)
+ schema:
+ type: string
+ - name: q[email_cont]
+ in: query
+ required: false
+ description: Filter by email (contains)
+ schema:
+ type: string
+ - name: q[number_eq]
+ in: query
+ required: false
+ description: Filter by order number
+ schema:
+ type: string
+ - name: q[completed_at_gt]
+ in: query
+ required: false
+ description: Filter by completed after date
schema:
type: string
- name: expand
in: query
required: false
- description: Comma-separated associations to expand (e.g., payment_method,
- source). Use dot notation for nested expand (max 4 levels).
+ 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., amount,status,number,response_code).
+ 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: payment found
+ description: orders found
content:
application/json:
example:
- id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: BGS-30f317a77b37
- number: P02PKLSP
- amount: '110.0'
- display_amount: "$110.00"
- status: completed
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- customer_id:
- payment_method_id: pm_gbHJdmfrXB
- metadata: {}
- created_at: '2026-06-05T13:12:28.956Z'
- updated_at: '2026-06-05T13:12:28.958Z'
- metadata: {}
- avs_response:
- cvv_response_code:
- cvv_response_message:
- created_at: '2026-06-05T13:12:28.957Z'
- updated_at: '2026-06-05T13:12:28.957Z'
- captured_amount: '0.0'
- order_id: or_UkLWZg9DAJ
- "/api/v3/admin/orders/{order_id}/payments/{id}/capture":
- patch:
- summary: Capture a payment
- tags:
- - Orders
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Captures a pending payment.
-
- **Required scope:** `write_payments` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const payment = await client.orders.payments.capture('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
- parameters:
- - name: x-spree-api-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:
- example:
- id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: BGS-8274fb792a75
- number: PACXCPQH
- amount: '110.0'
- display_amount: "$110.00"
- status: completed
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- customer_id:
- payment_method_id: pm_gbHJdmfrXB
+ data:
+ - id: or_UkLWZg9DAJ
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R311015146
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ fulfillment_status:
+ payment_status:
+ completed_at:
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ gift_card:
+ market:
+ status: draft
+ last_ip_address:
+ considered_risky: false
+ confirmation_delivered: false
+ store_owner_notification_delivered:
+ payment_total: '0.0'
+ display_payment_total: "$0.00"
metadata: {}
- created_at: '2026-06-05T13:12:29.611Z'
- updated_at: '2026-06-05T13:12:29.614Z'
- metadata: {}
- avs_response:
- cvv_response_code:
- cvv_response_message:
- created_at: '2026-06-05T13:12:29.613Z'
- updated_at: '2026-06-05T13:12:29.973Z'
- captured_amount: '110.0'
- order_id: or_UkLWZg9DAJ
- '422':
- description: capture failed
+ canceled_at:
+ approved_at:
+ created_at: '2026-06-08T10:57:29.022Z'
+ updated_at: '2026-06-08T10:57:29.022Z'
+ preferred_stock_location_id:
+ tags: []
+ internal_note:
+ approver_id:
+ canceler_id:
+ created_by_id:
+ customer_id: cus_UkLWZg9DAJ
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ '401':
+ description: unauthorized
content:
application/json:
example:
error:
- code: processing_error
- message: 'Bogus Gateway: Forced failure'
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/admin/orders/{order_id}/payments/{id}/void":
- patch:
- summary: Void a payment
+ post:
+ summary: Create a draft order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
- description: |-
- Voids a payment.
-
- **Required scope:** `write_payments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8049,7 +7461,82 @@ paths:
secretKey: 'sk_xxx',
})
- const payment = await client.orders.payments.void('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
+ // One-shot order create: customer, items, addresses, market, channel,
+ // notes, metadata, and a coupon code in a single call. Everything
+ // except `email` is optional.
+ const order = await client.orders.create({
+ email: '[email protected]',
+ customer_id: 'cus_UkLWZg9DAJ', // Existing customer; omit for guest orders
+ use_customer_default_address: false, // true to copy the customer's saved addresses
+
+ currency: 'USD',
+ market_id: 'mkt_UkLWZg9DAJ',
+ channel_id: 'ch_UkLWZg9DAJ', // Optional — defaults to the store's primary channel
+ locale: 'en-US',
+
+ // Pin the order's preferred fulfillment location. Order Routing's
+ // built-in PreferredLocation rule ranks this location first when
+ // it stocks the cart's items; if it doesn't, routing falls back
+ // to the next rule (Minimize Splits → Default Location).
+ preferred_stock_location_id: 'sloc_UkLWZg9DAJ',
+
+ customer_note: 'Please leave at the front desk.',
+ internal_note: 'VIP customer — handle with care.',
+ metadata: {
+ external_reference: 'subscription_invoice_2026_04',
+ source: 'recurring-engine',
+ },
+
+ // Items: each variant_id + quantity. Optional metadata per line.
+ items: [
+ { variant_id: 'variant_k5nR8xLq', quantity: 2 },
+ { variant_id: 'variant_QXyZ12abCD', quantity: 1, metadata: { gift: true } },
+ ],
+
+ // Provide addresses inline OR by ID (existing customer addresses).
+ shipping_address: {
+ first_name: 'Jane',
+ last_name: 'Doe',
+ address1: '350 Fifth Avenue',
+ address2: 'Floor 42',
+ city: 'New York',
+ postal_code: '10118',
+ country_iso: 'US',
+ state_abbr: 'NY',
+ phone: '+1 212 555 1234',
+ company: 'Acme Inc.',
+ },
+ // shipping_address_id: 'addr_UkLWZg9DAJ', // alternative to inline
+
+ billing_address: {
+ first_name: 'Jane',
+ last_name: 'Doe',
+ address1: '350 Fifth Avenue',
+ city: 'New York',
+ postal_code: '10118',
+ country_iso: 'US',
+ state_abbr: 'NY',
+ phone: '+1 212 555 1234',
+ },
+ // billing_address_id: 'addr_UkLWZg9DAJ',
+
+ // Optional. Invalid codes are non-fatal — the order is created either way.
+ coupon_code: 'WELCOME10',
+ })
+ description: |-
+ Creates a new draft order in one shot. Customer, items, addresses, currency,
+ market, channel, locale, notes, metadata, and a coupon code can all be
+ provided inline.
+
+ Setting `preferred_stock_location_id` pins the order's preferred fulfillment
+ location — Order Routing's built-in `PreferredLocation` rule consumes it
+ when picking which stock location ships each shipment.
+
+ Invalid coupon codes are non-fatal — the order is created and the failure
+ is reported on the service result (not in the API response body for now).
+
+
+ **Required scope:** `write_orders` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -8062,67 +7549,188 @@ paths:
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
+ '201':
+ description: order created with preferred_stock_location_id
content:
application/json:
example:
- id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: void-BGS-c5cdfced60ed
- number: PX8LJ7IH
- amount: '110.0'
- display_amount: "$110.00"
- status: void
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- customer_id:
- payment_method_id: pm_gbHJdmfrXB
- metadata: {}
- created_at: '2026-06-05T13:12:31.062Z'
- updated_at: '2026-06-05T13:12:31.065Z'
+ id: or_gbHJdmfrXB
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R734764741
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ fulfillment_status:
+ payment_status:
+ completed_at:
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ gift_card:
+ market:
+ status: draft
+ last_ip_address:
+ considered_risky: false
+ confirmation_delivered: false
+ store_owner_notification_delivered:
+ payment_total: '0.0'
+ display_payment_total: "$0.00"
metadata: {}
- avs_response:
- cvv_response_code:
- cvv_response_message:
- created_at: '2026-06-05T13:12:31.064Z'
- updated_at: '2026-06-05T13:12:31.376Z'
- captured_amount: '0.0'
- order_id: or_UkLWZg9DAJ
- "/api/v3/admin/orders/{order_id}/refunds":
+ canceled_at:
+ approved_at:
+ created_at: '2026-06-08T10:57:30.750Z'
+ updated_at: '2026-06-08T10:57:30.753Z'
+ preferred_stock_location_id: sloc_UkLWZg9DAJ
+ tags: []
+ internal_note:
+ approver_id:
+ canceler_id:
+ created_by_id:
+ customer_id:
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ customer_id:
+ type: string
+ description: 'Customer ID. Alias: user_id (legacy).'
+ use_customer_default_address:
+ type: boolean
+ description: When true with customer_id, copies the customer's saved
+ billing/shipping addresses onto the order.
+ currency:
+ type: string
+ 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_iso:
+ type: string
+ state_abbr:
+ type: string
+ phone:
+ type: string
+ shipping_address_id:
+ type: string
+ description: Existing customer address ID
+ billing_address:
+ type: object
+ properties:
+ first_name:
+ type: string
+ last_name:
+ type: string
+ address1:
+ type: string
+ city:
+ type: string
+ postal_code:
+ type: string
+ country_iso:
+ type: string
+ state_abbr:
+ type: string
+ phone:
+ type: string
+ billing_address_id:
+ type: string
+ description: Existing customer address ID
+ items:
+ type: array
+ items:
+ type: object
+ required:
+ - variant_id
+ - quantity
+ properties:
+ variant_id:
+ type: string
+ description: Variant ID
+ quantity:
+ type: integer
+ example: 1
+ 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: List refunds
+ summary: Show an order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Returns all refunds for an order.
+ Returns full order details including admin-only fields.
- **Required scope:** `read_refunds` (for API-key authentication).
+ **Required scope:** `read_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8134,7 +7742,9 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: refunds } = await client.orders.refunds.list('or_UkLWZg9DAJ')
+ const order = await client.orders.get('or_UkLWZg9DAJ', {
+ expand: ['items', 'fulfillments', 'payments', 'customer'],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -8147,133 +7757,110 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
+ - name: id
in: path
required: true
- description: Order ID
+ description: Order ID (e.g., or_xxx)
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).
+ 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., amount,reason,transaction_id).
+ 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: refunds found
+ description: order found
content:
application/json:
example:
- data: []
- meta:
- page: 1
- limit: 25
- count: 0
- pages: 1
- from: 0
- to: 0
- in: 0
- previous:
- next:
- post:
- summary: Create a refund
- tags:
- - Orders
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.
-
- **Required scope:** `write_refunds` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const refund = await client.orders.refunds.create('or_UkLWZg9DAJ', {
- payment_id: 'pay_UkLWZg9DAJ',
- amount: 5.00,
- refund_reason_id: 'refrsn_UkLWZg9DAJ',
- })
- parameters:
- - name: x-spree-api-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:
+ id: or_UkLWZg9DAJ
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R377667939
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ fulfillment_status:
+ payment_status:
+ completed_at:
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ gift_card:
+ market:
+ status: draft
+ last_ip_address:
+ considered_risky: false
+ confirmation_delivered: false
+ store_owner_notification_delivered:
+ payment_total: '0.0'
+ display_payment_total: "$0.00"
+ metadata: {}
+ canceled_at:
+ approved_at:
+ created_at: '2026-06-08T10:57:31.030Z'
+ updated_at: '2026-06-08T10:57:31.030Z'
+ preferred_stock_location_id:
+ tags: []
+ internal_note:
+ approver_id:
+ canceler_id:
+ created_by_id:
+ customer_id: cus_UkLWZg9DAJ
+ '404':
+ description: order not found
+ content:
application/json:
example:
- id: re_UkLWZg9DAJ
- transaction_id: BGS-fc6b3e38ec30
- amount: '5.0'
- payment_id: py_UkLWZg9DAJ
- refund_reason_id: rr_UkLWZg9DAJ
- reimbursement_id:
- metadata: {}
- created_at: '2026-06-05T13:12:32.755Z'
- updated_at: '2026-06-05T13:12:32.755Z'
- requestBody:
- content:
- application/json:
- schema:
- type: object
- required:
- - payment_id
- - amount
- properties:
- payment_id:
- type: string
- description: Payment ID
- amount:
- type: number
- example: 10.0
- refund_reason_id:
- type: string
- description: Refund reason ID
- "/api/v3/admin/orders/{order_id}/store_credits":
- post:
- summary: Apply customer's store credit to an order
+ error:
+ code: order_not_found
+ message: Order not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ patch:
+ summary: Update 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.
+ Updates an order. Supports updating email, addresses, special instructions, and line items.
- **Required scope:** `write_store_credits` (for API-key authentication).
+ **Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8285,8 +7872,9 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.storeCredits.apply('or_UkLWZg9DAJ', {
- amount: 25.00,
+ const order = await client.orders.update('or_UkLWZg9DAJ', {
+ email: '[email protected]',
+ internal_note: 'VIP — gift wrap on next order',
})
parameters:
- name: x-spree-api-key
@@ -8300,29 +7888,29 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
+ - name: id
in: path
required: true
description: Order ID
schema:
type: string
responses:
- '201':
- description: store credit applied
+ '200':
+ description: order updated
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R368133355
+ number: R109563285
customer_note:
currency: USD
locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -8333,19 +7921,19 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '0.0'
+ display_total: "$0.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '60.0'
- display_amount_due: "$60.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
fulfillment_status:
payment_status:
completed_at:
- store_credit_total: '50.0'
- display_store_credit_total: "-$50.00"
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
covered_by_store_credit: false
gift_card:
market:
@@ -8359,8 +7947,8 @@ paths:
metadata: {}
canceled_at:
approved_at:
- created_at: '2026-06-05T13:12:33.082Z'
- updated_at: '2026-06-05T13:12:33.137Z'
+ created_at: '2026-06-08T10:57:32.132Z'
+ updated_at: '2026-06-08T10:57:32.439Z'
preferred_stock_location_id:
tags: []
internal_note:
@@ -8374,21 +7962,84 @@ paths:
schema:
type: object
properties:
- amount:
- type: number
- description: Optional explicit amount; defaults to order outstanding
- balance
+ email:
+ type: string
+ special_instructions:
+ type: string
+ internal_note:
+ type: string
+ channel_id:
+ type: string
+ description: Channel ID
+ preferred_stock_location_id:
+ type: string
+ description: Stock Location ID to prefer for fulfillment. Re-runs
+ Order Routing's PreferredLocation rule on subsequent shipment
+ rebuilds.
+ ship_address:
+ type: object
+ properties:
+ firstname:
+ type: string
+ lastname:
+ type: string
+ address1:
+ type: string
+ city:
+ type: string
+ zipcode:
+ type: string
+ country_iso:
+ type: string
+ state_abbr:
+ type: string
+ phone:
+ type: string
+ bill_address:
+ type: object
+ properties:
+ firstname:
+ type: string
+ lastname:
+ type: string
+ address1:
+ type: string
+ city:
+ type: string
+ zipcode:
+ type: string
+ country_iso:
+ type: string
+ state_abbr:
+ type: string
+ phone:
+ type: string
+ items:
+ type: array
+ items:
+ type: object
+ required:
+ - variant_id
+ properties:
+ variant_id:
+ type: string
+ description: Variant ID
+ quantity:
+ type: integer
+ example: 1
+ metadata:
+ type: object
delete:
- summary: Remove store credit from an order
+ summary: Delete a draft order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Removes any applied store credit from the order.
+ Deletes a draft order. Completed orders cannot be deleted.
- **Required scope:** `write_store_credits` (for API-key authentication).
+ **Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8400,7 +8051,7 @@ paths:
secretKey: 'sk_xxx',
})
- await client.orders.storeCredits.remove('or_UkLWZg9DAJ')
+ await client.orders.delete('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -8413,7 +8064,7 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: order_id
+ - name: id
in: path
required: true
description: Order ID
@@ -8421,19 +8072,22 @@ paths:
type: string
responses:
'204':
- description: store credit removed
- "/api/v3/admin/orders":
- get:
- summary: List orders
+ description: order deleted
+ "/api/v3/admin/orders/{id}/complete":
+ patch:
+ summary: Complete an order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a paginated list of orders for the current store.
+ Completes an order in the `confirm` state, marking it as placed.
- **Required scope:** `read_orders` (for API-key authentication).
+ Set `notify_customer: true` to send the order confirmation email.
+
+
+ **Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8445,11 +8099,8 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: orders, meta } = await client.orders.list({
- status_eq: 'complete',
- completed_at_gt: '2026-01-01',
- sort: '-completed_at',
- limit: 25,
+ const order = await client.orders.complete('or_UkLWZg9DAJ', {
+ notify_customer: true,
})
parameters:
- name: x-spree-api-key
@@ -8463,270 +8114,29 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: page
- in: query
- required: false
- description: Page number
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: Number of records per page
- schema:
- type: integer
- - name: sort
- in: query
- required: false
- description: Sort field (e.g., created_at, -created_at, completed_at)
- schema:
- type: string
- - name: q[state_eq]
- in: query
- required: false
- description: Filter by state (cart, address, delivery, payment, confirm, complete,
- canceled)
- schema:
- type: string
- - name: q[email_cont]
- in: query
- required: false
- description: Filter by email (contains)
- schema:
- type: string
- - name: q[number_eq]
- in: query
- required: false
- description: Filter by order number
- schema:
- type: string
- - name: q[completed_at_gt]
- in: query
- required: false
- description: Filter by completed after date
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (e.g., items, fulfillments,
- payments, customer, discounts, billing_address, shipping_address). Use dot
- notation for nested expand (max 4 levels).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., number,total,status,completed_at).
- id is always included.
+ - name: id
+ in: path
+ required: true
+ description: Order ID
schema:
type: string
responses:
'200':
- description: orders found
- content:
- application/json:
- example:
- data:
- - id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R114520773
- customer_note:
- currency: USD
- locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- fulfillment_status:
- payment_status:
- completed_at:
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- gift_card:
- market:
- status: draft
- last_ip_address:
- considered_risky: false
- confirmation_delivered: false
- store_owner_notification_delivered:
- payment_total: '0.0'
- display_payment_total: "$0.00"
- metadata: {}
- canceled_at:
- approved_at:
- created_at: '2026-06-05T13:12:34.902Z'
- updated_at: '2026-06-05T13:12:34.902Z'
- preferred_stock_location_id:
- tags: []
- internal_note:
- approver_id:
- canceler_id:
- created_by_id:
- customer_id: cus_UkLWZg9DAJ
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- post:
- summary: Create a draft order
- tags:
- - Orders
- security:
- - api_key: []
- bearer_auth: []
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- // One-shot order create: customer, items, addresses, market, channel,
- // notes, metadata, and a coupon code in a single call. Everything
- // except `email` is optional.
- const order = await client.orders.create({
- email: '[email protected]',
- customer_id: 'cus_UkLWZg9DAJ', // Existing customer; omit for guest orders
- use_customer_default_address: false, // true to copy the customer's saved addresses
-
- currency: 'USD',
- market_id: 'mkt_UkLWZg9DAJ',
- channel_id: 'ch_UkLWZg9DAJ', // Optional — defaults to the store's primary channel
- locale: 'en-US',
-
- // Pin the order's preferred fulfillment location. Order Routing's
- // built-in PreferredLocation rule ranks this location first when
- // it stocks the cart's items; if it doesn't, routing falls back
- // to the next rule (Minimize Splits → Default Location).
- preferred_stock_location_id: 'sloc_UkLWZg9DAJ',
-
- customer_note: 'Please leave at the front desk.',
- internal_note: 'VIP customer — handle with care.',
- metadata: {
- external_reference: 'subscription_invoice_2026_04',
- source: 'recurring-engine',
- },
-
- // Items: each variant_id + quantity. Optional metadata per line.
- items: [
- { variant_id: 'variant_k5nR8xLq', quantity: 2 },
- { variant_id: 'variant_QXyZ12abCD', quantity: 1, metadata: { gift: true } },
- ],
-
- // Provide addresses inline OR by ID (existing customer addresses).
- shipping_address: {
- first_name: 'Jane',
- last_name: 'Doe',
- address1: '350 Fifth Avenue',
- address2: 'Floor 42',
- city: 'New York',
- postal_code: '10118',
- country_iso: 'US',
- state_abbr: 'NY',
- phone: '+1 212 555 1234',
- company: 'Acme Inc.',
- },
- // shipping_address_id: 'addr_UkLWZg9DAJ', // alternative to inline
-
- billing_address: {
- first_name: 'Jane',
- last_name: 'Doe',
- address1: '350 Fifth Avenue',
- city: 'New York',
- postal_code: '10118',
- country_iso: 'US',
- state_abbr: 'NY',
- phone: '+1 212 555 1234',
- },
- // billing_address_id: 'addr_UkLWZg9DAJ',
-
- // Optional. Invalid codes are non-fatal — the order is created either way.
- coupon_code: 'WELCOME10',
- })
- description: |-
- Creates a new draft order in one shot. Customer, items, addresses, currency,
- market, channel, locale, notes, metadata, and a coupon code can all be
- provided inline.
-
- Setting `preferred_stock_location_id` pins the order's preferred fulfillment
- location — Order Routing's built-in `PreferredLocation` rule consumes it
- when picking which stock location ships each shipment.
-
- Invalid coupon codes are non-fatal — the order is created and the failure
- is reported on the service result (not in the API response body for now).
-
-
- **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
+ description: order completed
content:
application/json:
example:
- id: or_gbHJdmfrXB
+ id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R773205198
+ number: R852541066
customer_note:
currency: USD
locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -8737,17 +8147,17 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
amount_due: '0.0'
display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- fulfillment_status:
- payment_status:
- completed_at:
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ fulfillment_status: ready
+ payment_status: paid
+ completed_at: '2026-06-08T10:57:33.412Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
@@ -8758,140 +8168,54 @@ paths:
considered_risky: false
confirmation_delivered: false
store_owner_notification_delivered:
- payment_total: '0.0'
- display_payment_total: "$0.00"
+ payment_total: '110.0'
+ display_payment_total: "$110.00"
metadata: {}
canceled_at:
approved_at:
- created_at: '2026-06-05T13:12:36.601Z'
- updated_at: '2026-06-05T13:12:36.605Z'
- preferred_stock_location_id: sloc_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:33.311Z'
+ updated_at: '2026-06-08T10:57:33.471Z'
+ preferred_stock_location_id:
tags: []
internal_note:
approver_id:
canceler_id:
created_by_id:
- customer_id:
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- customer_id:
- type: string
- description: 'Customer ID. Alias: user_id (legacy).'
- use_customer_default_address:
+ customer_id: cus_UkLWZg9DAJ
+ '422':
+ description: order cannot be completed
+ content:
+ application/json:
+ example:
+ error:
+ code: order_cannot_complete
+ message: No payment found
+ details:
+ base:
+ - No payment found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ notify_customer:
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_iso:
- type: string
- state_abbr:
- type: string
- phone:
- type: string
- shipping_address_id:
- type: string
- description: Existing customer address ID
- billing_address:
- type: object
- properties:
- first_name:
- type: string
- last_name:
- type: string
- address1:
- type: string
- city:
- type: string
- postal_code:
- type: string
- country_iso:
- type: string
- state_abbr:
- type: string
- phone:
- type: string
- billing_address_id:
- type: string
- description: Existing customer address ID
- items:
- type: array
- items:
- type: object
- required:
- - variant_id
- - quantity
- properties:
- variant_id:
- type: string
- description: Variant ID
- quantity:
- type: integer
- example: 1
- 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
+ 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: |-
- Returns full order details including admin-only fields.
+ Cancels a completed order.
- **Required scope:** `read_orders` (for API-key authentication).
+ **Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -8903,9 +8227,7 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.get('or_UkLWZg9DAJ', {
- expand: ['items', 'fulfillments', 'payments', 'customer'],
- })
+ const order = await client.orders.cancel('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -8921,41 +8243,26 @@ paths:
- 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.
+ description: Order ID
schema:
type: string
responses:
'200':
- description: order found
+ description: order canceled
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R639530153
+ number: R706412366
customer_note:
currency: USD
locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -8966,23 +8273,23 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
+ total: '20.0'
+ display_total: "$20.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '0.0'
+ amount_due: "-0.0"
display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- fulfillment_status:
- payment_status:
- completed_at:
+ delivery_total: '10.0'
+ display_delivery_total: "$10.00"
+ fulfillment_status: canceled
+ payment_status: void
+ completed_at: '2026-06-08T10:57:34.738Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
gift_card:
market:
- status: draft
+ status: canceled
last_ip_address:
considered_risky: false
confirmation_delivered: false
@@ -8990,36 +8297,27 @@ paths:
payment_total: '0.0'
display_payment_total: "$0.00"
metadata: {}
- canceled_at:
+ canceled_at: '2026-06-08T10:57:35.022Z'
approved_at:
- created_at: '2026-06-05T13:12:36.884Z'
- updated_at: '2026-06-05T13:12:36.884Z'
+ created_at: '2026-06-08T10:57:34.691Z'
+ updated_at: '2026-06-08T10:57:35.060Z'
preferred_stock_location_id:
tags: []
internal_note:
approver_id:
- canceler_id:
+ canceler_id: admin_UkLWZg9DAJ
created_by_id:
customer_id: cus_UkLWZg9DAJ
- '404':
- description: order not found
- content:
- application/json:
- example:
- error:
- code: order_not_found
- message: Order not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/admin/orders/{id}/approve":
patch:
- summary: Update an order
+ summary: Approve an order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Updates an order. Supports updating email, addresses, special instructions, and line items.
+ Approves an order (e.g., for fraud review).
**Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
@@ -9033,10 +8331,7 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.update('or_UkLWZg9DAJ', {
- email: '[email protected]',
- internal_note: 'VIP — gift wrap on next order',
- })
+ const order = await client.orders.approve('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -9057,21 +8352,21 @@ paths:
type: string
responses:
'200':
- description: order updated
+ description: order approved
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R770729281
+ number: R211398927
customer_note:
currency: USD
locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -9082,17 +8377,17 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
fulfillment_status:
payment_status:
- completed_at:
+ completed_at: '2026-06-08T10:57:35.417Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
@@ -9107,146 +8402,26 @@ paths:
display_payment_total: "$0.00"
metadata: {}
canceled_at:
- approved_at:
- created_at: '2026-06-05T13:12:37.996Z'
- updated_at: '2026-06-05T13:12:38.281Z'
+ approved_at: '2026-06-08T10:57:35.719Z'
+ created_at: '2026-06-08T10:57:35.357Z'
+ updated_at: '2026-06-08T10:57:35.417Z'
preferred_stock_location_id:
tags: []
internal_note:
- approver_id:
+ approver_id: admin_UkLWZg9DAJ
canceler_id:
created_by_id:
customer_id: cus_UkLWZg9DAJ
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- special_instructions:
- type: string
- internal_note:
- type: string
- channel_id:
- type: string
- description: Channel ID
- preferred_stock_location_id:
- type: string
- description: Stock Location ID to prefer for fulfillment. Re-runs
- Order Routing's PreferredLocation rule on subsequent shipment
- rebuilds.
- ship_address:
- type: object
- properties:
- firstname:
- type: string
- lastname:
- type: string
- address1:
- type: string
- city:
- type: string
- zipcode:
- type: string
- country_iso:
- type: string
- state_abbr:
- type: string
- phone:
- type: string
- bill_address:
- type: object
- properties:
- firstname:
- type: string
- lastname:
- type: string
- address1:
- type: string
- city:
- type: string
- zipcode:
- type: string
- country_iso:
- type: string
- state_abbr:
- type: string
- phone:
- type: string
- items:
- type: array
- items:
- type: object
- required:
- - variant_id
- properties:
- variant_id:
- type: string
- description: Variant ID
- quantity:
- type: integer
- example: 1
- 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.
-
- **Required scope:** `write_orders` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- await client.orders.delete('or_UkLWZg9DAJ')
- parameters:
- - name: x-spree-api-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":
+ "/api/v3/admin/orders/{id}/resume":
patch:
- summary: Complete an order
+ summary: Resume a canceled order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Completes an order in the `confirm` state, marking it as placed.
-
- Set `notify_customer: true` to send the order confirmation email.
-
+ Resumes a previously canceled order.
**Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
@@ -9260,9 +8435,7 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.complete('or_UkLWZg9DAJ', {
- notify_customer: true,
- })
+ const order = await client.orders.resume('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -9283,15 +8456,15 @@ paths:
type: string
responses:
'200':
- description: order completed
+ description: order resumed
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R150931097
+ number: R155035324
customer_note:
currency: USD
locale: en
@@ -9308,73 +8481,51 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '20.0'
+ display_total: "$20.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- fulfillment_status: ready
- payment_status: paid
- completed_at: '2026-06-05T13:12:39.240Z'
+ amount_due: '20.0'
+ display_amount_due: "$20.00"
+ delivery_total: '10.0'
+ display_delivery_total: "$10.00"
+ fulfillment_status: canceled
+ payment_status: void
+ completed_at: '2026-06-08T10:57:36.085Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
gift_card:
market:
- status: draft
+ status: placed
last_ip_address:
considered_risky: false
confirmation_delivered: false
store_owner_notification_delivered:
- payment_total: '110.0'
- display_payment_total: "$110.00"
+ payment_total: '0.0'
+ display_payment_total: "$0.00"
metadata: {}
- canceled_at:
+ canceled_at: '2026-06-08T10:57:36.371Z'
approved_at:
- created_at: '2026-06-05T13:12:39.156Z'
- updated_at: '2026-06-05T13:12:39.289Z'
+ created_at: '2026-06-08T10:57:36.023Z'
+ updated_at: '2026-06-08T10:57:36.451Z'
preferred_stock_location_id:
tags: []
internal_note:
approver_id:
- canceler_id:
+ canceler_id: admin_UkLWZg9DAJ
created_by_id:
customer_id: cus_UkLWZg9DAJ
- '422':
- description: order cannot be completed
- content:
- application/json:
- example:
- error:
- code: order_cannot_complete
- message: No payment found
- details:
- base:
- - No payment found
- 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
+ "/api/v3/admin/orders/{id}/resend_confirmation":
+ post:
+ summary: Resend confirmation email
tags:
- Orders
security:
- api_key: []
bearer_auth: []
description: |-
- Cancels a completed order.
+ Publishes the order.completed event to trigger confirmation email delivery.
**Required scope:** `write_orders` (for API-key authentication).
x-codeSamples:
@@ -9388,7 +8539,7 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.cancel('or_UkLWZg9DAJ')
+ await client.orders.resendConfirmation('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -9409,15 +8560,15 @@ paths:
type: string
responses:
'200':
- description: order canceled
+ description: confirmation resent
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R477684328
+ number: R297088709
customer_note:
currency: USD
locale: en
@@ -9434,23 +8585,23 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '20.0'
- display_total: "$20.00"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: "-0.0"
- display_amount_due: "$0.00"
- delivery_total: '10.0'
- display_delivery_total: "$10.00"
- fulfillment_status: canceled
- payment_status: void
- completed_at: '2026-06-05T13:12:40.644Z'
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ fulfillment_status:
+ payment_status:
+ completed_at: '2026-06-08T10:57:36.813Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
gift_card:
market:
- status: canceled
+ status: draft
last_ip_address:
considered_risky: false
confirmation_delivered: false
@@ -9458,29 +8609,29 @@ paths:
payment_total: '0.0'
display_payment_total: "$0.00"
metadata: {}
- canceled_at: '2026-06-05T13:12:40.934Z'
+ canceled_at:
approved_at:
- created_at: '2026-06-05T13:12:40.589Z'
- updated_at: '2026-06-05T13:12:40.972Z'
+ created_at: '2026-06-08T10:57:36.746Z'
+ updated_at: '2026-06-08T10:57:36.812Z'
preferred_stock_location_id:
tags: []
internal_note:
approver_id:
- canceler_id: admin_UkLWZg9DAJ
+ canceler_id:
created_by_id:
customer_id: cus_UkLWZg9DAJ
- "/api/v3/admin/orders/{id}/approve":
- patch:
- summary: Approve an order
+ "/api/v3/admin/payment_methods":
+ get:
+ summary: List payment methods
tags:
- - Orders
+ - Payment Methods
security:
- api_key: []
bearer_auth: []
description: |-
- Approves an order (e.g., for fraud review).
+ Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.
- **Required scope:** `write_orders` (for API-key authentication).
+ **Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -9492,7 +8643,7 @@ paths:
secretKey: 'sk_xxx',
})
- const order = await client.orders.approve('or_UkLWZg9DAJ')
+ const { data: paymentMethods } = await client.paymentMethods.list()
parameters:
- name: x-spree-api-key
in: header
@@ -9502,101 +8653,1145 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
- - name: id
- in: path
- required: true
- description: Order ID
+ - 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: order approved
+ description: payment methods found
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R292529403
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- fulfillment_status:
- payment_status:
- completed_at: '2026-06-05T13:12:41.327Z'
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- gift_card:
- market:
- status: draft
- last_ip_address:
- considered_risky: false
- confirmation_delivered: false
- store_owner_notification_delivered:
- payment_total: '0.0'
- display_payment_total: "$0.00"
+ data:
+ - id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: check
+ session_required: false
+ source_required: false
+ metadata: {}
+ active: true
+ auto_capture:
+ storefront_visible: true
+ position: 1
+ created_at: '2026-06-08T10:57:37.124Z'
+ updated_at: '2026-06-08T10:57:37.125Z'
+ preferences: {}
+ preference_schema: []
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ "/api/v3/admin/payment_methods/types":
+ get:
+ summary: List available payment provider types
+ tags:
+ - Payment Methods
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: |-
+ Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a "Provider" dropdown in admin UIs.
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: types } = await client.paymentMethods.types()
+ parameters:
+ - 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:
+ example:
+ data:
+ - type: bogus
+ label: Bogus
+ description:
+ preference_schema:
+ - key: dummy_key
+ type: string
+ default: PUBLICKEY123
+ - key: dummy_secret_key
+ type: password
+ default:
+ - type: custom_payment_source_method
+ label: Custom Payment Source Method
+ description:
+ preference_schema: []
+ "/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.
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const paymentMethod = await client.paymentMethods.get('pm_UkLWZg9DAJ')
+ 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:
+ example:
+ id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: check
+ session_required: false
+ source_required: false
metadata: {}
- canceled_at:
- approved_at: '2026-06-05T13:12:41.625Z'
- created_at: '2026-06-05T13:12:41.271Z'
- updated_at: '2026-06-05T13:12:41.327Z'
- preferred_stock_location_id:
- tags: []
- internal_note:
- approver_id: admin_UkLWZg9DAJ
- canceler_id:
- created_by_id:
- customer_id: cus_UkLWZg9DAJ
- "/api/v3/admin/orders/{id}/resume":
- patch:
- summary: Resume a canceled order
+ active: true
+ auto_capture:
+ storefront_visible: true
+ position: 1
+ created_at: '2026-06-08T10:57:37.721Z'
+ updated_at: '2026-06-08T10:57:37.722Z'
+ preferences: {}
+ preference_schema: []
+ "/api/v3/admin/orders/{order_id}/payments":
+ get:
+ summary: List payments
tags:
- - Orders
+ - Payments
security:
- api_key: []
bearer_auth: []
description: |-
- Resumes a previously canceled order.
+ Returns all payments for an order.
- **Required scope:** `write_orders` (for API-key authentication).
+ **Required scope:** `read_payments` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
source: |-
import { createAdminClient } from '@spree/admin-sdk'
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: payments } = await client.orders.payments.list('or_UkLWZg9DAJ')
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ description: Bearer token for admin authentication
+ schema:
+ type: string
+ - name: order_id
+ in: path
+ required: true
+ description: Order ID
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (e.g., payment_method,
+ source). Use dot notation for nested expand (max 4 levels).
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., amount,status,number,response_code).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: payments found
+ content:
+ application/json:
+ example:
+ data:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: BGS-8a4389715a82
+ number: P4WYE9BN
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: completed
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ customer_id:
+ payment_method_id: pm_gbHJdmfrXB
+ metadata: {}
+ created_at: '2026-06-08T10:57:21.449Z'
+ updated_at: '2026-06-08T10:57:21.453Z'
+ metadata: {}
+ avs_response:
+ cvv_response_code:
+ cvv_response_message:
+ created_at: '2026-06-08T10:57:21.451Z'
+ updated_at: '2026-06-08T10:57:21.451Z'
+ captured_amount: '0.0'
+ order_id: or_UkLWZg9DAJ
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ post:
+ summary: Create a payment
+ tags:
+ - Payments
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: |-
+ Creates a new payment for the order.
+
+ **Required scope:** `write_payments` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const payment = await client.orders.payments.create('or_UkLWZg9DAJ', {
+ payment_method_id: 'pm_UkLWZg9DAJ',
+ amount: 99.99,
+ source_id: 'cc_UkLWZg9DAJ',
+ })
+ parameters:
+ - name: x-spree-api-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:
+ example:
+ id: py_gbHJdmfrXB
+ payment_method_id: pm_EfhxLZ9ck8
+ response_code:
+ number: P9YJWKYL
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: checkout
+ source_type:
+ source_id:
+ source:
+ metadata: {}
+ avs_response:
+ cvv_response_code:
+ cvv_response_message:
+ created_at: '2026-06-08T10:57:22.839Z'
+ updated_at: '2026-06-08T10:57:22.839Z'
+ captured_amount: '0.0'
+ order_id: or_gbHJdmfrXB
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - payment_method_id
+ properties:
+ payment_method_id:
+ type: string
+ description: Payment method ID
+ amount:
+ type: number
+ example: 99.99
+ 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.
+
+ **Required scope:** `read_payments` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const payment = await client.orders.payments.get('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
+ parameters:
+ - name: x-spree-api-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:
+ example:
+ id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: BGS-593d862e96f0
+ number: PG90UG3I
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: completed
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ customer_id:
+ payment_method_id: pm_gbHJdmfrXB
+ metadata: {}
+ created_at: '2026-06-08T10:57:23.214Z'
+ updated_at: '2026-06-08T10:57:23.217Z'
+ metadata: {}
+ avs_response:
+ cvv_response_code:
+ cvv_response_message:
+ created_at: '2026-06-08T10:57:23.216Z'
+ updated_at: '2026-06-08T10:57:23.216Z'
+ captured_amount: '0.0'
+ order_id: or_UkLWZg9DAJ
+ "/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.
+
+ **Required scope:** `write_payments` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const payment = await client.orders.payments.capture('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
+ parameters:
+ - name: x-spree-api-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:
+ example:
+ id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: BGS-0a1bdc7c0459
+ number: PKBIGM2X
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: completed
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ customer_id:
+ payment_method_id: pm_gbHJdmfrXB
+ metadata: {}
+ created_at: '2026-06-08T10:57:23.864Z'
+ updated_at: '2026-06-08T10:57:23.866Z'
+ metadata: {}
+ avs_response:
+ cvv_response_code:
+ cvv_response_message:
+ created_at: '2026-06-08T10:57:23.865Z'
+ updated_at: '2026-06-08T10:57:24.186Z'
+ captured_amount: '110.0'
+ order_id: or_UkLWZg9DAJ
+ '422':
+ description: capture failed
+ content:
+ application/json:
+ example:
+ error:
+ code: processing_error
+ message: 'Bogus Gateway: Forced failure'
+ 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.
+
+ **Required scope:** `write_payments` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const payment = await client.orders.payments.void('or_UkLWZg9DAJ', 'pay_UkLWZg9DAJ')
+ parameters:
+ - name: x-spree-api-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:
+ example:
+ id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: void-BGS-1fec0a04658a
+ number: P122PQX0
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: void
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ customer_id:
+ payment_method_id: pm_gbHJdmfrXB
+ metadata: {}
+ created_at: '2026-06-08T10:57:25.233Z'
+ updated_at: '2026-06-08T10:57:25.235Z'
+ metadata: {}
+ avs_response:
+ cvv_response_code:
+ cvv_response_message:
+ created_at: '2026-06-08T10:57:25.234Z'
+ updated_at: '2026-06-08T10:57:25.532Z'
+ captured_amount: '0.0'
+ order_id: or_UkLWZg9DAJ
+ "/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.
+
+ **Required scope:** `read_products` (for API-key authentication).
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: q[status_eq]
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: sort
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: 'Comma-separated associations to embed. Supported: `price_rules`.'
+ schema:
+ type: string
+ responses:
+ '200':
+ description: price lists found
+ content:
+ application/json:
+ example:
+ data:
+ - id: pl_UkLWZg9DAJ
+ name: Wholesale
+ description:
+ status: draft
+ position: 1
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:38.019Z'
+ updated_at: '2026-06-08T10:57:38.019Z'
+ currently_active: false
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ - id: pl_gbHJdmfrXB
+ name: Holiday
+ description:
+ status: draft
+ position: 2
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:38.020Z'
+ updated_at: '2026-06-08T10:57:38.020Z'
+ currently_active: false
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ meta:
+ page: 1
+ limit: 25
+ count: 2
+ pages: 1
+ from: 1
+ to: 2
+ in: 2
+ previous:
+ next:
+ 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.
+
+ **Required scope:** `write_products` (for API-key authentication).
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ '201':
+ description: price list created (server-to-server — rules + prices, no product_ids)
+ content:
+ application/json:
+ example:
+ id: pl_EfhxLZ9ck8
+ name: EU wholesale
+ description:
+ status: draft
+ position: 3
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:38.996Z'
+ updated_at: '2026-06-08T10:57:38.998Z'
+ currently_active: false
+ products_count: 1
+ prices_count: 2
+ product_ids:
+ - prod_UkLWZg9DAJ
+ schema:
+ "$ref": "#/components/schemas/PriceList"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Name can't be blank
+ details:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ 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
+ product_ids:
+ type: array
+ items:
+ type: string
+ description: Prefixed product ids to seed the list with.
+ example:
+ - prod_aBc123
+ rules:
+ type: array
+ description: STI-typed price rules to attach on create. Existing
+ rules 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 alternative to `product_ids`: ship
+ the exact per-variant prices the list should contain. Each row
+ upserts on the unique key `(variant_id, currency, price_list_id)`.
+ Mix-and-match with `product_ids` is supported but typically unnecessary
+ — `prices` alone tells the server which variants belong to the
+ list and what the override amount is.'
+ items:
+ type: object
+ required:
+ - variant_id
+ - currency
+ properties:
+ variant_id:
+ type: string
+ 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'
+ "/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:
+ example:
+ id: pl_UkLWZg9DAJ
+ name: Wholesale
+ description:
+ status: draft
+ position: 1
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:39.301Z'
+ updated_at: '2026-06-08T10:57:39.301Z'
+ currently_active: false
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ schema:
+ "$ref": "#/components/schemas/PriceList"
+ '404':
+ description: price list not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Price list not found
+ 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
+ STI-typed price rules in a single round-trip — existing rules update
+ by `id`, new rules build, missing rules destroy. Mirrors the
+ promotion editor's "save the whole thing on Save" pattern.
+
+
+ **Required scope:** `write_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:
+ example:
+ id: pl_UkLWZg9DAJ
+ name: Wholesale (Q3)
+ description:
+ status: draft
+ position: 1
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:40.918Z'
+ updated_at: '2026-06-08T10:57:41.207Z'
+ currently_active: false
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ schema:
+ "$ref": "#/components/schemas/PriceList"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ name:
+ type: string
+ description:
+ type: string
+ nullable: true
+ starts_at:
+ type: string
+ nullable: true
+ ends_at:
+ type: string
+ nullable: true
+ match_policy:
+ type: string
+ enum:
+ - all
+ - any
+ position:
+ type: integer
+ product_ids:
+ type: array
+ items:
+ type: string
+ description: Prefixed product ids — reconciles list membership (adds
+ + removes).
+ example:
+ - prod_aBc123
+ 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'
+ delete:
+ summary: Delete a price list
+ tags:
+ - Pricing
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: |-
+ Soft-deletes the price list. Associated prices are removed asynchronously.
+
+ **Required scope:** `write_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
+ in the future the list is marked `scheduled` instead, matching the
+ legacy admin behaviour.
+
- const order = await client.orders.resume('or_UkLWZg9DAJ')
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -9606,89 +9801,98 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
- - name: id
- in: path
+ responses:
+ '200':
+ description: price list activated
+ content:
+ application/json:
+ example:
+ id: pl_UkLWZg9DAJ
+ name: Wholesale
+ description:
+ status: active
+ position: 1
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:41.507Z'
+ updated_at: '2026-06-08T10:57:41.796Z'
+ currently_active: true
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ 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
- description: Order ID
schema:
type: string
responses:
'200':
- description: order resumed
+ description: price list deactivated
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R684756853
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '20.0'
- display_total: "$20.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '20.0'
- display_amount_due: "$20.00"
- delivery_total: '10.0'
- display_delivery_total: "$10.00"
- fulfillment_status: canceled
- payment_status: void
- completed_at: '2026-06-05T13:12:41.987Z'
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- gift_card:
- market:
- status: placed
- last_ip_address:
- considered_risky: false
- confirmation_delivered: false
- store_owner_notification_delivered:
- payment_total: '0.0'
- display_payment_total: "$0.00"
- metadata: {}
- canceled_at: '2026-06-05T13:12:42.318Z'
- approved_at:
- created_at: '2026-06-05T13:12:41.911Z'
- updated_at: '2026-06-05T13:12:42.409Z'
- preferred_stock_location_id:
- tags: []
- internal_note:
- approver_id:
- canceler_id: admin_UkLWZg9DAJ
- created_by_id:
- customer_id: cus_UkLWZg9DAJ
- "/api/v3/admin/orders/{id}/resend_confirmation":
- post:
- summary: Resend confirmation email
+ id: pl_UkLWZg9DAJ
+ name: Price List 1
+ description:
+ status: inactive
+ position: 1
+ match_policy: all
+ starts_at:
+ ends_at:
+ deleted_at:
+ created_at: '2026-06-08T10:57:41.806Z'
+ updated_at: '2026-06-08T10:57:42.092Z'
+ currently_active: false
+ products_count: 0
+ prices_count: 0
+ product_ids: []
+ schema:
+ "$ref": "#/components/schemas/PriceList"
+ "/api/v3/admin/prices":
+ get:
+ summary: List prices
tags:
- - Orders
+ - Pricing
security:
- api_key: []
bearer_auth: []
description: |-
- Publishes the order.completed event to trigger confirmation email delivery.
+ Generic prices endpoint covering both base prices and price-list
+ overrides. Filter with Ransack: `q[price_list_id_eq]=…`,
+ `q[currency_eq]=USD`, `q[price_list_id_null]=true` (base prices only).
- **Required scope:** `write_orders` (for API-key authentication).
+ The admin spreadsheet uses this with server-side pagination so it
+ scales past the metadata-PATCH path on `/price_lists/:id`.
+
+
+ **Required scope:** `read_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -9700,7 +9904,11 @@ paths:
secretKey: 'sk_xxx',
})
- await client.orders.resendConfirmation('or_UkLWZg9DAJ')
+ const { data: prices } = await client.prices.list({
+ price_list_id_eq: 'pl_xxx',
+ currency_eq: 'USD',
+ expand: ['variant'],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -9710,89 +9918,116 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
- - name: id
- in: path
- required: true
- description: Order ID
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[price_list_id_eq]
+ in: query
+ required: false
schema:
type: string
- responses:
- '200':
- description: confirmation resent
- content:
- application/json:
- example:
- id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R815365085
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- fulfillment_status:
- payment_status:
- completed_at: '2026-06-05T13:12:42.746Z'
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- gift_card:
- market:
- status: draft
- last_ip_address:
- considered_risky: false
- confirmation_delivered: false
- store_owner_notification_delivered:
- payment_total: '0.0'
- display_payment_total: "$0.00"
- metadata: {}
- canceled_at:
- approved_at:
- created_at: '2026-06-05T13:12:42.695Z'
- updated_at: '2026-06-05T13:12:42.746Z'
- preferred_stock_location_id:
- tags: []
- internal_note:
- approver_id:
- canceler_id:
- created_by_id:
- customer_id: cus_UkLWZg9DAJ
- "/api/v3/admin/payment_methods":
- get:
- summary: List payment methods
+ - name: q[price_list_id_null]
+ in: query
+ required: false
+ schema:
+ type: boolean
+ - name: q[currency_eq]
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: q[variant_id_eq]
+ in: query
+ required: false
+ schema:
+ type: string
+ - name: sort
+ in: query
+ required: false
+ description: Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: 'Comma-separated associations to embed. Supported: `variant`.'
+ schema:
+ type: string
+ responses:
+ '200':
+ description: prices found
+ content:
+ application/json:
+ example:
+ data:
+ - id: price_gbHJdmfrXB
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ variant_id: variant_gbHJdmfrXB
+ created_at: '2026-06-08T10:57:42.151Z'
+ updated_at: '2026-06-08T10:57:42.151Z'
+ - id: price_EfhxLZ9ck8
+ amount: '5.0'
+ amount_in_cents: 500
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$5.00"
+ display_compare_at_amount:
+ price_list_id: pl_UkLWZg9DAJ
+ variant_id: variant_gbHJdmfrXB
+ created_at: '2026-06-08T10:57:42.159Z'
+ updated_at: '2026-06-08T10:57:42.159Z'
+ meta:
+ page: 1
+ limit: 25
+ count: 2
+ pages: 1
+ from: 1
+ to: 2
+ in: 2
+ previous:
+ next:
+ 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:
- - Configuration
+ - Pricing
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.
+ Creates a single price. Omit `price_list_id` to create a base price.
+ For more than a handful of rows, prefer `POST /admin/prices/bulk_upsert`.
- **Required scope:** `read_settings` (for API-key authentication).
+
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -9804,7 +10039,11 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: paymentMethods } = await client.paymentMethods.list()
+ const price = await client.prices.create({
+ variant_id: 'variant_xxx',
+ currency: 'USD',
+ amount: '19.99',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -9816,64 +10055,68 @@ paths:
required: true
schema:
type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand. Use dot notation for
- nested expand (max 4 levels).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,type,active).
- id is always included.
- schema:
- type: string
responses:
- '200':
- description: payment methods found
+ '201':
+ description: price created
content:
application/json:
example:
- data:
- - id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: check
- session_required: false
- source_required: false
- metadata: {}
- active: true
- auto_capture:
- storefront_visible: true
- position: 1
- created_at: '2026-06-05T13:12:43.046Z'
- updated_at: '2026-06-05T13:12:43.047Z'
- preferences: {}
- preference_schema: []
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- "/api/v3/admin/payment_methods/types":
+ id: price_uw2YK1rnl0
+ amount: '9.99'
+ amount_in_cents: 999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: EUR
+ display_amount: "€9.99"
+ display_compare_at_amount:
+ price_list_id:
+ variant_id: variant_EfhxLZ9ck8
+ created_at: '2026-06-08T10:57:42.971Z'
+ updated_at: '2026-06-08T10:57:42.971Z'
+ schema:
+ "$ref": "#/components/schemas/Price"
+ requestBody:
+ 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
+ "/api/v3/admin/prices/{id}":
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
get:
- summary: List available payment provider types
+ summary: Get a price
tags:
- - Configuration
+ - Pricing
security:
- api_key: []
bearer_auth: []
- description: |-
- Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a "Provider" dropdown in admin UIs.
-
- **Required scope:** `read_settings` (for API-key authentication).
+ description: "**Required scope:** `read_products` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -9885,7 +10128,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: types } = await client.paymentMethods.types()
+ const price = await client.prices.get('price_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -9899,37 +10142,42 @@ paths:
type: string
responses:
'200':
- description: provider types found
+ description: price found
content:
application/json:
example:
- data:
- - type: bogus
- label: Bogus
- description:
- preference_schema:
- - key: dummy_key
- type: string
- default: PUBLICKEY123
- - key: dummy_secret_key
- type: password
- default:
- - type: custom_payment_source_method
- label: Custom Payment Source Method
- description:
- preference_schema: []
- "/api/v3/admin/payment_methods/{id}":
- get:
- summary: Show a payment method
+ id: price_EfhxLZ9ck8
+ amount: '5.0'
+ amount_in_cents: 500
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$5.00"
+ display_compare_at_amount:
+ price_list_id: pl_UkLWZg9DAJ
+ variant_id: variant_gbHJdmfrXB
+ created_at: '2026-06-08T10:57:43.043Z'
+ updated_at: '2026-06-08T10:57:43.043Z'
+ schema:
+ "$ref": "#/components/schemas/Price"
+ '404':
+ description: price not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Price not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ patch:
+ summary: Update a price
tags:
- - Configuration
+ - Pricing
security:
- api_key: []
bearer_auth: []
- description: |-
- Returns a payment method by ID.
-
- **Required scope:** `read_settings` (for API-key authentication).
+ description: "**Required scope:** `write_products` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -9941,7 +10189,9 @@ paths:
secretKey: 'sk_xxx',
})
- const paymentMethod = await client.paymentMethods.get('pm_UkLWZg9DAJ')
+ const price = await client.prices.update('price_xxx', {
+ amount: '12.34',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -9953,58 +10203,61 @@ paths:
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
+ description: price updated
content:
application/json:
example:
- id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: check
- session_required: false
- source_required: false
- metadata: {}
- active: true
- auto_capture:
- storefront_visible: true
- position: 1
- created_at: '2026-06-05T13:12:43.637Z'
- updated_at: '2026-06-05T13:12:43.638Z'
- preferences: {}
- preference_schema: []
- "/api/v3/admin/price_lists":
- get:
- summary: List price lists
+ id: price_EfhxLZ9ck8
+ amount: '12.34'
+ amount_in_cents: 1234
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$12.34"
+ display_compare_at_amount:
+ price_list_id: pl_UkLWZg9DAJ
+ variant_id: variant_gbHJdmfrXB
+ created_at: '2026-06-08T10:57:43.751Z'
+ updated_at: '2026-06-08T10:57:44.076Z'
+ 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: |-
- Returns the price lists configured for the current store.
+ Soft-deletes the price (acts_as_paranoid).
- **Required scope:** `read_products` (for API-key authentication).
+ **Required scope:** `write_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ await client.prices.delete('price_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -10016,107 +10269,58 @@ paths:
required: true
schema:
type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- - name: q[name_cont]
- in: query
- required: false
- schema:
- type: string
- - name: q[status_eq]
- in: query
- required: false
- schema:
- type: string
- - name: sort
- in: query
- required: false
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: 'Comma-separated associations to embed. Supported: `price_rules`.'
- schema:
- type: string
responses:
- '200':
- description: price lists found
- content:
- application/json:
- example:
- data:
- - id: pl_UkLWZg9DAJ
- name: Wholesale
- description:
- status: draft
- position: 1
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:43.927Z'
- updated_at: '2026-06-05T13:12:43.927Z'
- currently_active: false
- products_count: 0
- prices_count: 0
- product_ids: []
- - id: pl_gbHJdmfrXB
- name: Holiday
- description:
- status: draft
- position: 2
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:43.928Z'
- updated_at: '2026-06-05T13:12:43.928Z'
- currently_active: false
- products_count: 0
- prices_count: 0
- product_ids: []
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/PriceList"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
- required:
- - data
- - meta
+ '204':
+ description: price deleted
+ "/api/v3/admin/prices/bulk_upsert":
post:
- summary: Create a price list
+ summary: Bulk-upsert prices
tags:
- Pricing
security:
- api_key: []
bearer_auth: []
description: |-
- Creates a new draft price list.
+ Upserts a batch of prices in a single SQL round trip.
+
+ Each row either:
+ * targets an existing price by `id`, OR
+ * matches on the unique key `(variant_id, currency, price_list_id)` —
+ updating the existing row if one exists, creating one otherwise.
+
+ Model callbacks (e.g. PriceHistory) are bypassed; this is a
+ bulk-write fast path for the admin spreadsheet. The response
+ carries `price_count` — the number of rows touched.
+
**Required scope:** `write_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { price_count } = await client.prices.bulkUpsert({
+ prices: [
+ {
+ variant_id: 'variant_xxx',
+ currency: 'USD',
+ price_list_id: 'pl_xxx',
+ amount: '11.11',
+ },
+ {
+ variant_id: 'variant_yyy',
+ currency: 'USD',
+ price_list_id: 'pl_xxx',
+ amount: '22.22',
+ },
+ ],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -10129,115 +10333,57 @@ paths:
schema:
type: string
responses:
- '201':
- description: price list created (server-to-server — rules + prices, no product_ids)
- content:
- application/json:
- example:
- id: pl_EfhxLZ9ck8
- name: EU wholesale
- description:
- status: draft
- position: 3
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:44.932Z'
- updated_at: '2026-06-05T13:12:44.934Z'
- currently_active: false
- products_count: 1
- prices_count: 2
- product_ids:
- - prod_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/PriceList"
- '422':
- description: validation error
+ '200':
+ description: prices upserted
content:
application/json:
- example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- product_ids:
- type: array
- items:
- type: string
- description: Prefixed product ids to seed the list with.
- example:
- - prod_aBc123
- rules:
- type: array
- description: STI-typed price rules to attach on create. Existing
- rules 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
+ example:
+ price_count: 2
+ schema:
+ type: object
+ properties:
+ price_count:
+ type: integer
+ '422':
+ description: missing prices key
+ content:
+ application/json:
+ example:
+ error:
+ code: missing_prices
+ message: prices is required (send an empty array to no-op).
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - prices
+ properties:
prices:
type: array
- description: 'Server-to-server alternative to `product_ids`: ship
- the exact per-variant prices the list should contain. Each row
- upserts on the unique key `(variant_id, currency, price_list_id)`.
- Mix-and-match with `product_ids` is supported but typically unnecessary
- — `prices` alone tells the server which variants belong to the
- list and what the override amount is.'
items:
type: object
required:
- variant_id
- currency
properties:
+ 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
@@ -10246,21 +10392,91 @@ paths:
type: string
nullable: true
example: '24.99'
- "/api/v3/admin/price_lists/{id}":
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- get:
- summary: Get a price list
+ "/api/v3/admin/prices/bulk_destroy":
+ delete:
+ summary: Bulk-delete prices
tags:
- Pricing
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `read_products` (for API-key authentication)."
+ description: |-
+ Soft-deletes each price in `ids`. Returns the count actually destroyed.
+
+ **Required scope:** `write_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { price_count } = await client.prices.bulkDestroy({
+ ids: ['price_xxx', 'price_yyy'],
+ })
+ parameters:
+ - 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:
+ example:
+ price_count: 1
+ 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.
+
+ **Required scope:** `read_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: customFields } = await client.products.customFields.list('prod_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -10272,59 +10488,78 @@ paths:
required: true
schema:
type: string
+ - name: product_id
+ in: path
+ required: true
+ schema:
+ type: string
- name: expand
in: query
required: false
+ description: Comma-separated associations to expand (e.g., custom_field_definition).
+ Use dot notation for nested expand (max 4 levels).
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., key,value,namespace).
+ id is always included.
schema:
type: string
responses:
'200':
- description: price list found
- content:
- application/json:
- example:
- id: pl_UkLWZg9DAJ
- name: Wholesale
- description:
- status: draft
- position: 1
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:45.249Z'
- updated_at: '2026-06-05T13:12:45.249Z'
- currently_active: false
- products_count: 0
- prices_count: 0
- product_ids: []
- schema:
- "$ref": "#/components/schemas/PriceList"
- '404':
- description: price list not found
+ description: custom fields found
content:
application/json:
example:
- error:
- code: record_not_found
- message: Price list not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update a price list
+ data:
+ - id: cf_UkLWZg9DAJ
+ label: Title
+ type: Spree::Metafields::ShortText
+ field_type: short_text
+ key: custom.title
+ value: wool
+ created_at: '2026-06-08T10:57:45.538Z'
+ updated_at: '2026-06-08T10:57:45.538Z'
+ storefront_visible: true
+ custom_field_definition_id: cfdef_UkLWZg9DAJ
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ post:
+ summary: Create a product custom field
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Updates a price list. The optional `rules:` array reconciles nested
- STI-typed price rules in a single round-trip — existing rules update
- by `id`, new rules build, missing rules destroy. Mirrors the
- promotion editor's "save the whole thing on Save" pattern.
-
+ Sets a custom field value on the product. Requires an existing CustomFieldDefinition; pass its prefixed `cfdef_…` id.
**Required scope:** `write_products` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const customField = await client.products.customFields.create('prod_UkLWZg9DAJ', {
+ custom_field_definition_id: 'cfdef_AbC123XyZ',
+ value: 'wool',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -10336,119 +10571,61 @@ paths:
required: true
schema:
type: string
+ - name: product_id
+ in: path
+ required: true
+ schema:
+ type: string
responses:
- '200':
- description: price list updated with nested rules
+ '201':
+ description: custom field created
content:
application/json:
example:
- id: pl_UkLWZg9DAJ
- name: Wholesale (Q3)
- description:
- status: draft
- position: 1
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:46.832Z'
- updated_at: '2026-06-05T13:12:47.116Z'
- currently_active: false
- products_count: 0
- prices_count: 0
- product_ids: []
- schema:
- "$ref": "#/components/schemas/PriceList"
+ id: cf_gbHJdmfrXB
+ label: Description
+ type: Spree::Metafields::LongText
+ field_type: long_text
+ key: custom.description
+ value: A longer description
+ created_at: '2026-06-08T10:57:46.140Z'
+ updated_at: '2026-06-08T10:57:46.140Z'
+ storefront_visible: true
+ custom_field_definition_id: cfdef_gbHJdmfrXB
+ '422':
+ description: duplicate definition for the same product
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Metafield definition has already been taken
+ details:
+ metafield_definition_id:
+ - has already been taken
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - custom_field_definition_id
+ - value
properties:
- name:
- type: string
- description:
- type: string
- nullable: true
- starts_at:
- type: string
- nullable: true
- ends_at:
- type: string
- nullable: true
- match_policy:
+ custom_field_definition_id:
type: string
- enum:
- - all
- - any
- position:
- type: integer
- product_ids:
- type: array
- items:
- type: string
- description: Prefixed product ids — reconciles list membership (adds
- + removes).
- example:
- - prod_aBc123
- rules:
- type: array
- items:
- 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'
- delete:
- summary: Delete a price list
+ 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:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
- description: |-
- Soft-deletes the price list. Associated prices are removed asynchronously.
-
- **Required scope:** `write_products` (for API-key authentication).
+ description: "**Required scope:** `read_products` (for API-key authentication)."
parameters:
- name: x-spree-api-key
in: header
@@ -10460,28 +10637,55 @@ paths:
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:
- '204':
- description: price list deleted
- "/api/v3/admin/price_lists/{id}/activate":
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
+ '200':
+ description: custom field found
+ content:
+ application/json:
+ example:
+ id: cf_UkLWZg9DAJ
+ label: Title
+ type: Spree::Metafields::ShortText
+ field_type: short_text
+ key: custom.title
+ value: wool
+ created_at: '2026-06-08T10:57:46.496Z'
+ updated_at: '2026-06-08T10:57:46.496Z'
+ storefront_visible: true
+ custom_field_definition_id: cfdef_UkLWZg9DAJ
patch:
- summary: Activate a price list
+ summary: Update a product custom field
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Transitions a draft / inactive list to `active`. If `starts_at` is
- in the future the list is marked `scheduled` instead, matching the
- legacy admin behaviour.
-
+ Updates the custom field's `value`. The linked definition cannot be changed — delete and recreate to switch.
**Required scope:** `write_products` (for API-key authentication).
parameters:
@@ -10495,40 +10699,46 @@ paths:
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: price list activated
+ description: custom field updated
content:
application/json:
example:
- id: pl_UkLWZg9DAJ
- name: Wholesale
- description:
- status: active
- position: 1
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:47.414Z'
- updated_at: '2026-06-05T13:12:47.693Z'
- currently_active: true
- products_count: 0
- prices_count: 0
- product_ids: []
- 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
+ id: cf_UkLWZg9DAJ
+ label: Title
+ type: Spree::Metafields::ShortText
+ field_type: short_text
+ key: custom.title
+ value: cotton
+ created_at: '2026-06-08T10:57:46.820Z'
+ updated_at: '2026-06-08T10:57:47.180Z'
+ storefront_visible: true
+ custom_field_definition_id: cfdef_UkLWZg9DAJ
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - value
+ properties:
+ value:
+ description: New value
+ delete:
+ summary: Delete a product custom field
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
@@ -10544,45 +10754,29 @@ paths:
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: price list deactivated
- content:
- application/json:
- example:
- id: pl_UkLWZg9DAJ
- name: Price List 1
- description:
- status: inactive
- position: 1
- match_policy: all
- starts_at:
- ends_at:
- deleted_at:
- created_at: '2026-06-05T13:12:47.702Z'
- updated_at: '2026-06-05T13:12:47.980Z'
- currently_active: false
- products_count: 0
- prices_count: 0
- product_ids: []
- schema:
- "$ref": "#/components/schemas/PriceList"
- "/api/v3/admin/prices":
+ '204':
+ description: custom field deleted
+ "/api/v3/admin/products":
get:
- summary: List prices
- tags:
- - Pricing
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Generic prices endpoint covering both base prices and price-list
- overrides. Filter with Ransack: `q[price_list_id_eq]=…`,
- `q[currency_eq]=USD`, `q[price_list_id_null]=true` (base prices only).
-
- The admin spreadsheet uses this with server-side pagination so it
- scales past the metadata-PATCH path on `/price_lists/:id`.
-
+ summary: List products
+ tags:
+ - Products
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: |-
+ Returns a paginated list of products for the current store.
**Required scope:** `read_products` (for API-key authentication).
x-codeSamples:
@@ -10596,10 +10790,11 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: prices } = await client.prices.list({
- price_list_id_eq: 'pl_xxx',
- currency_eq: 'USD',
- expand: ['variant'],
+ const { data: products } = await client.products.list({
+ name_cont: 'shirt',
+ status_eq: 'active',
+ sort: '-created_at',
+ limit: 25,
})
parameters:
- name: x-spree-api-key
@@ -10610,266 +10805,150 @@ paths:
- 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[price_list_id_eq]
+ - name: sort
in: query
required: false
+ description: Sort field (e.g., name, -name, price, -price, best_selling)
schema:
type: string
- - name: q[price_list_id_null]
- in: query
- required: false
- schema:
- type: boolean
- - name: q[currency_eq]
+ - 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: q[variant_id_eq]
+ - 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: sort
+ - name: q[name_cont]
in: query
required: false
- description: Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.
+ description: Filter by name (contains)
schema:
type: string
- - name: expand
+ - name: q[status_eq]
in: query
required: false
- description: 'Comma-separated associations to embed. Supported: `variant`.'
+ description: Filter by status
schema:
type: string
responses:
'200':
- description: prices found
+ description: products found
content:
application/json:
example:
data:
- - id: price_gbHJdmfrXB
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- variant_id: variant_gbHJdmfrXB
- created_at: '2026-06-05T13:12:48.033Z'
- updated_at: '2026-06-05T13:12:48.033Z'
- - id: price_EfhxLZ9ck8
- amount: '5.0'
- amount_in_cents: 500
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$5.00"
- display_compare_at_amount:
- price_list_id: pl_UkLWZg9DAJ
- variant_id: variant_gbHJdmfrXB
- created_at: '2026-06-05T13:12:48.037Z'
- updated_at: '2026-06-05T13:12:48.037Z'
+ - id: prod_UkLWZg9DAJ
+ name: Product 57785
+ slug: product-57785
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 0
+ available_on:
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: Explicabo inventore laboriosam iure maxime sed placeat.
+ Corporis at perferendis animi maiores illum quisquam. Odit saepe
+ non vel cupiditate. Sapiente harum inventore expedita cumque adipisci.
+ Amet perspiciatis quod aliquam eos.
+ description_html: Explicabo inventore laboriosam iure maxime sed
+ placeat. Corporis at perferendis animi maiores illum quisquam.
+ Odit saepe non vel cupiditate. Sapiente harum inventore expedita
+ cumque adipisci. Amet perspiciatis quod aliquam eos.
+ default_variant_id: variant_UkLWZg9DAJ
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_UkLWZg9DAJ
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ variant_id: variant_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:47.555Z'
+ updated_at: '2026-06-08T10:57:47.555Z'
+ original_price:
+ status: active
+ metadata: {}
+ deleted_at:
+ created_at: '2026-06-08T10:57:47.542Z'
+ updated_at: '2026-06-08T10:57:47.562Z'
+ tax_category_id: taxcat_UkLWZg9DAJ
meta:
page: 1
limit: 25
- count: 2
+ count: 1
pages: 1
from: 1
- to: 2
- in: 2
+ to: 1
+ in: 1
previous:
- next:
- 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.
- For more than a handful of rows, prefer `POST /admin/prices/bulk_upsert`.
-
-
- **Required scope:** `write_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const price = await client.prices.create({
- variant_id: 'variant_xxx',
- currency: 'USD',
- amount: '19.99',
- })
- 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:
- example:
- id: price_uw2YK1rnl0
- amount: '9.99'
- amount_in_cents: 999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: EUR
- display_amount: "€9.99"
- display_compare_at_amount:
- price_list_id:
- variant_id: variant_EfhxLZ9ck8
- created_at: '2026-06-05T13:12:48.724Z'
- updated_at: '2026-06-05T13:12:48.724Z'
- schema:
- "$ref": "#/components/schemas/Price"
- requestBody:
- 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
- "/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)."
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const price = await client.prices.get('price_xxx')
- parameters:
- - 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:
- example:
- id: price_EfhxLZ9ck8
- amount: '5.0'
- amount_in_cents: 500
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$5.00"
- display_compare_at_amount:
- price_list_id: pl_UkLWZg9DAJ
- variant_id: variant_gbHJdmfrXB
- created_at: '2026-06-05T13:12:48.822Z'
- updated_at: '2026-06-05T13:12:48.822Z'
- schema:
- "$ref": "#/components/schemas/Price"
- '404':
- description: price not found
+ next:
+ 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:
example:
error:
- code: record_not_found
- message: Price not found
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update a price
+ post:
+ summary: Create a product
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `write_products` (for API-key authentication)."
+ description: |-
+ Creates a new product. Supports nested variants with prices and option types.
+
+ Option types and values are auto-created if they don't exist.
+ Prices are upserted by currency. Stock items are upserted by stock location.
+
+
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -10881,8 +10960,37 @@ paths:
secretKey: 'sk_xxx',
})
- const price = await client.prices.update('price_xxx', {
- amount: '12.34',
+ const product = await client.products.create({
+ name: 'Premium T-Shirt',
+ description: 'Soft, organic cotton.',
+ status: 'active',
+ variants: [
+ {
+ sku: 'TSHIRT-S-NAVY',
+ options: [
+ { name: 'size', value: 'Small' },
+ { name: 'color', value: 'navy' },
+ ],
+ prices: [
+ { currency: 'USD', amount: 29.99 },
+ { currency: 'EUR', amount: 27.99 },
+ ],
+ stock_items: [
+ { stock_location_id: 'sloc_UkLWZg9DAJ', count_on_hand: 50 },
+ ],
+ },
+ {
+ sku: 'TSHIRT-M-NAVY',
+ options: [
+ { name: 'size', value: 'Medium' },
+ { name: 'color', value: 'navy' },
+ ],
+ prices: [{ currency: 'USD', amount: 29.99 }],
+ stock_items: [
+ { stock_location_id: 'sloc_UkLWZg9DAJ', count_on_hand: 30 },
+ ],
+ },
+ ],
})
parameters:
- name: x-spree-api-key
@@ -10893,99 +11001,165 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
schema:
type: string
responses:
- '200':
- description: price updated
+ '201':
+ description: product created
content:
application/json:
example:
- id: price_EfhxLZ9ck8
- amount: '12.34'
- amount_in_cents: 1234
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$12.34"
- display_compare_at_amount:
- price_list_id: pl_UkLWZg9DAJ
- variant_id: variant_gbHJdmfrXB
- created_at: '2026-06-05T13:12:49.490Z'
- updated_at: '2026-06-05T13:12:49.771Z'
+ id: prod_gbHJdmfrXB
+ name: New Product
+ slug: new-product
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 0
+ available_on:
+ purchasable: false
+ in_stock: false
+ backorderable: false
+ available: false
+ description:
+ description_html:
+ default_variant_id: variant_gbHJdmfrXB
+ thumbnail_url:
+ tags: []
+ price:
+ original_price:
+ status: draft
+ metadata: {}
+ deleted_at:
+ created_at: '2026-06-08T10:57:48.313Z'
+ updated_at: '2026-06-08T10:57:48.314Z'
+ tax_category_id:
schema:
- "$ref": "#/components/schemas/Price"
+ "$ref": "#/components/schemas/Product"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Name can't be blank
+ details:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
properties:
- amount:
+ name:
type: string
- nullable: true
- compare_at_amount:
+ example: Premium T-Shirt
+ description:
type: string
- nullable: true
- delete:
- summary: Delete a price
- tags:
- - Pricing
- security:
- - api_key: []
- bearer_auth: []
- description: |-
- Soft-deletes the price (acts_as_paranoid).
-
- **Required scope:** `write_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- await client.prices.delete('price_xxx')
- 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
+ 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
+ variants:
+ type: array
+ description: Array of variant payloads. Variants can declare multiple
+ option pairs via `options:` and per-currency prices via `prices:`.
+ Stock counts go in `stock_items:` (per stock location).
+ items:
+ type: object
+ properties:
+ sku:
+ type: string
+ options:
+ type: array
+ description: One pair per option type the variant participates
+ in (e.g. size + color). Option types and values are auto-created
+ if missing.
+ items:
+ type: object
+ required:
+ - name
+ - value
+ properties:
+ name:
+ type: string
+ 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: number
+ example: 29.99
+ compare_at_amount:
+ type: number
+ example: 39.99
+ stock_items:
+ type: array
+ description: Per-stock-location inventory. Upserted by stock_location_id.
+ items:
+ type: object
+ required:
+ - stock_location_id
+ - count_on_hand
+ properties:
+ stock_location_id:
+ type: string
+ description: Stock location ID (e.g. sloc_xxx)
+ count_on_hand:
+ type: integer
+ example: 50
+ backorderable:
+ type: boolean
+ required:
+ - name
+ "/api/v3/admin/products/{id}":
+ get:
+ summary: Get a product
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Upserts a batch of prices in a single SQL round trip.
-
- Each row either:
- * targets an existing price by `id`, OR
- * matches on the unique key `(variant_id, currency, price_list_id)` —
- updating the existing row if one exists, creating one otherwise.
-
- Model callbacks (e.g. PriceHistory) are bypassed; this is a
- bulk-write fast path for the admin spreadsheet. The response
- carries `price_count` — the number of rows touched.
-
+ Returns a single product by ID.
- **Required scope:** `write_products` (for API-key authentication).
+ **Required scope:** `read_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -10997,21 +11171,8 @@ paths:
secretKey: 'sk_xxx',
})
- const { price_count } = await client.prices.bulkUpsert({
- prices: [
- {
- variant_id: 'variant_xxx',
- currency: 'USD',
- price_list_id: 'pl_xxx',
- amount: '11.11',
- },
- {
- variant_id: 'variant_yyy',
- currency: 'USD',
- price_list_id: 'pl_xxx',
- amount: '22.22',
- },
- ],
+ const product = await client.products.get('prod_86Rf07xd4z', {
+ expand: ['variants', 'option_types'],
})
parameters:
- name: x-spree-api-key
@@ -11022,78 +11183,101 @@ paths:
- 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: prices upserted
+ description: product found
content:
application/json:
example:
- price_count: 2
+ id: prod_UkLWZg9DAJ
+ name: Product 614200
+ slug: product-614200
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 0
+ available_on:
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: Odio impedit nobis rerum nostrum numquam sit illum quae.
+ Necessitatibus autem nisi ipsa reiciendis itaque. In earum maiores
+ animi placeat debitis. Modi sapiente quas perspiciatis quae labore.
+ Laudantium dolorum debitis earum occaecati. Quam in voluptatem deleniti
+ distinctio. Reiciendis maiores libero a perferendis delectus exercitationem
+ omnis. Occaecati cupiditate eligendi consequatur debitis. Impedit
+ laboriosam odit quisquam dignissimos est blanditiis ratione.
+ description_html: |-
+ Odio impedit nobis rerum nostrum numquam sit illum quae. Necessitatibus autem nisi ipsa reiciendis itaque. In earum maiores animi placeat debitis. Modi sapiente quas perspiciatis quae labore.
+ Laudantium dolorum debitis earum occaecati. Quam in voluptatem deleniti distinctio. Reiciendis maiores libero a perferendis delectus exercitationem omnis. Occaecati cupiditate eligendi consequatur debitis. Impedit laboriosam odit quisquam dignissimos est blanditiis ratione.
+ default_variant_id: variant_UkLWZg9DAJ
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_UkLWZg9DAJ
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ variant_id: variant_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:48.860Z'
+ updated_at: '2026-06-08T10:57:48.860Z'
+ original_price:
+ status: active
+ metadata: {}
+ deleted_at:
+ created_at: '2026-06-08T10:57:48.847Z'
+ updated_at: '2026-06-08T10:57:48.868Z'
+ tax_category_id: taxcat_UkLWZg9DAJ
schema:
- type: object
- properties:
- price_count:
- type: integer
- '422':
- description: missing prices key
+ "$ref": "#/components/schemas/Product"
+ '404':
+ description: product not found
content:
application/json:
example:
error:
- code: missing_prices
- message: prices is required (send an empty array to no-op).
+ code: record_not_found
+ message: Product not found
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
- 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'
- "/api/v3/admin/prices/bulk_destroy":
- delete:
- summary: Bulk-delete prices
+ patch:
+ summary: Update a product
tags:
- - Pricing
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Soft-deletes each price in `ids`. Returns the count actually destroyed.
+ Updates a product. Only provided fields are updated.
**Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
@@ -11107,8 +11291,10 @@ paths:
secretKey: 'sk_xxx',
})
- const { price_count } = await client.prices.bulkDestroy({
- ids: ['price_xxx', 'price_yyy'],
+ const product = await client.products.update('prod_86Rf07xd4z', {
+ name: 'Updated Name',
+ status: 'active',
+ tags: ['eco', 'sale'],
})
parameters:
- name: x-spree-api-key
@@ -11119,44 +11305,188 @@ paths:
- 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: prices deleted
+ description: product updated
content:
application/json:
example:
- price_count: 1
+ id: prod_UkLWZg9DAJ
+ name: Updated Name
+ slug: product-632303
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 0
+ available_on:
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: Magni repellendus magnam quasi nemo molestias quia corrupti.
+ Debitis dolorum unde aliquam asperiores eius sit incidunt. Ducimus
+ esse ipsam neque error rem. Alias esse beatae eum aperiam. Qui exercitationem
+ in repudiandae est laboriosam alias quam officia. Aut corporis temporibus
+ dolor dolorem repellat debitis. Assumenda ut cumque labore enim
+ deleniti adipisci consectetur. Nesciunt laudantium iste tempore
+ reprehenderit distinctio.
+ description_html: |-
+ Magni repellendus magnam quasi nemo molestias quia corrupti. Debitis dolorum unde aliquam asperiores eius sit incidunt. Ducimus esse ipsam neque error rem. Alias esse beatae eum aperiam.
+ Qui exercitationem in repudiandae est laboriosam alias quam officia. Aut corporis temporibus dolor dolorem repellat debitis. Assumenda ut cumque labore enim deleniti adipisci consectetur. Nesciunt laudantium iste tempore reprehenderit distinctio.
+ default_variant_id: variant_UkLWZg9DAJ
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_UkLWZg9DAJ
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ variant_id: variant_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:49.569Z'
+ updated_at: '2026-06-08T10:57:49.569Z'
+ original_price:
+ status: active
+ metadata: {}
+ deleted_at:
+ created_at: '2026-06-08T10:57:49.558Z'
+ updated_at: '2026-06-08T10:57:49.867Z'
+ tax_category_id: taxcat_UkLWZg9DAJ
schema:
- type: object
- properties:
- price_count:
- type: integer
+ "$ref": "#/components/schemas/Product"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Name can't be blank
+ details:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
- required:
- - ids
properties:
- ids:
+ 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
- "/api/v3/admin/products/{product_id}/custom_fields":
- get:
- summary: List product custom fields
+ description: Array of category IDs
+ tags:
+ type: array
+ items:
+ type: string
+ example:
+ - eco
+ - sale
+ variants:
+ type: array
+ description: Array of variant payloads. Variants can declare multiple
+ option pairs via `options:` and per-currency prices via `prices:`.
+ Stock counts go in `stock_items:` (per stock location).
+ items:
+ type: object
+ properties:
+ sku:
+ type: string
+ options:
+ type: array
+ description: One pair per option type the variant participates
+ in (e.g. size + color). Option types and values are auto-created
+ if missing.
+ items:
+ type: object
+ required:
+ - name
+ - value
+ properties:
+ name:
+ type: string
+ 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: number
+ example: 29.99
+ compare_at_amount:
+ type: number
+ example: 39.99
+ stock_items:
+ type: array
+ description: Per-stock-location inventory. Upserted by stock_location_id.
+ items:
+ type: object
+ required:
+ - stock_location_id
+ - count_on_hand
+ properties:
+ stock_location_id:
+ type: string
+ description: Stock location ID (e.g. sloc_xxx)
+ count_on_hand:
+ type: integer
+ example: 50
+ backorderable:
+ type: boolean
+ delete:
+ summary: Delete a product
tags:
- Products
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the product's custom field values.
+ Soft-deletes a product.
- **Required scope:** `read_products` (for API-key authentication).
+ **Required scope:** `write_products` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -11168,7 +11498,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: customFields } = await client.products.customFields.list('prod_UkLWZg9DAJ')
+ await client.products.delete('prod_86Rf07xd4z')
parameters:
- name: x-spree-api-key
in: header
@@ -11178,80 +11508,32 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
schema:
type: string
- - name: product_id
+ - 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.
+ description: Product ID
schema:
type: string
responses:
- '200':
- description: custom fields found
- content:
- application/json:
- example:
- data:
- - id: cf_UkLWZg9DAJ
- label: Title
- type: Spree::Metafields::ShortText
- field_type: short_text
- key: custom.title
- value: wool
- created_at: '2026-06-05T13:12:51.254Z'
- updated_at: '2026-06-05T13:12:51.254Z'
- storefront_visible: true
- custom_field_definition_id: cfdef_UkLWZg9DAJ
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
+ '204':
+ description: product deleted
+ "/api/v3/admin/products/bulk_status_update":
post:
- summary: Create a product custom field
+ summary: Bulk-update product status
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.
-
- **Required scope:** `write_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
+ Sets `status` on each product in `ids`. Reindexes the affected products
+ for search. Cross-store IDs are silently dropped. Returns counts.
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
- const customField = await client.products.customFields.create('prod_UkLWZg9DAJ', {
- custom_field_definition_id: 'cfdef_AbC123XyZ',
- value: 'wool',
- })
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -11263,61 +11545,67 @@ paths:
required: true
schema:
type: string
- - name: product_id
- in: path
- required: true
- schema:
- type: string
responses:
- '201':
- description: custom field created
+ '200':
+ description: cross-store products silently dropped
content:
application/json:
example:
- id: cf_gbHJdmfrXB
- label: Description
- type: Spree::Metafields::LongText
- field_type: long_text
- key: custom.description
- value: A longer description
- created_at: '2026-06-05T13:12:51.866Z'
- updated_at: '2026-06-05T13:12:51.866Z'
- storefront_visible: true
- custom_field_definition_id: cfdef_gbHJdmfrXB
+ product_count: 0
+ status: archived
+ schema:
+ type: object
+ properties:
+ product_count:
+ type: integer
+ status:
+ type: string
'422':
- description: duplicate definition for the same product
+ description: invalid status
content:
application/json:
example:
error:
- code: validation_error
- message: Metafield definition has already been taken
- details:
- metafield_definition_id:
- - has already been taken
+ code: invalid_status
+ message: Invalid status
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
required:
- - custom_field_definition_id
- - value
+ - ids
+ - status
properties:
- custom_field_definition_id:
+ ids:
+ type: array
+ items:
+ type: string
+ example:
+ - prod_UkLWZg9DAJ
+ status:
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
+ enum:
+ - draft
+ - active
+ - archived
+ example: archived
+ "/api/v3/admin/products/bulk_add_to_categories":
+ post:
+ summary: Bulk-add products to categories
tags:
- Products
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `read_products` (for API-key authentication)."
+ description: |-
+ Attaches each product in `ids` to every category (taxon) in `category_ids`.
+ Categories from sibling stores are silently ignored.
+
+
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -11329,55 +11617,48 @@ paths:
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
+ description: products added to categories
content:
application/json:
example:
- id: cf_UkLWZg9DAJ
- label: Title
- type: Spree::Metafields::ShortText
- field_type: short_text
- key: custom.title
- value: wool
- created_at: '2026-06-05T13:12:52.251Z'
- updated_at: '2026-06-05T13:12:52.251Z'
- storefront_visible: true
- custom_field_definition_id: cfdef_UkLWZg9DAJ
- patch:
- summary: Update a product custom field
+ product_count: 1
+ category_count: 1
+ 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: |-
- Updates the custom field's `value`. The linked definition cannot be changed — delete and recreate to switch.
+ Detaches each product in `ids` from every category in `category_ids`.
**Required scope:** `write_products` (for API-key authentication).
parameters:
@@ -11391,50 +11672,46 @@ paths:
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
+ description: products removed from categories
content:
application/json:
example:
- id: cf_UkLWZg9DAJ
- label: Title
- type: Spree::Metafields::ShortText
- field_type: short_text
- key: custom.title
- value: cotton
- created_at: '2026-06-05T13:12:52.572Z'
- updated_at: '2026-06-05T13:12:52.858Z'
- storefront_visible: true
- custom_field_definition_id: cfdef_UkLWZg9DAJ
+ product_count: 1
+ category_count: 1
requestBody:
content:
application/json:
schema:
type: object
required:
- - value
+ - ids
+ - category_ids
properties:
- value:
- description: New value
- delete:
- summary: Delete a product custom field
+ ids:
+ type: array
+ items:
+ type: string
+ category_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: "**Required scope:** `write_products` (for API-key authentication)."
+ description: |-
+ Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —
+ re-publishing on an existing channel is a no-op. Channels from sibling stores
+ are silently ignored.
+
+
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -11446,48 +11723,50 @@ paths:
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":
- get:
- summary: List products
+ '200':
+ description: products published on channels
+ content:
+ application/json:
+ example:
+ product_count: 1
+ channel_count: 1
+ 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:
- - Product Catalog
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a paginated list of products for the current store.
-
- **Required scope:** `read_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
+ Unpublishes each product in `ids` from every channel in `channel_ids`.
- const { data: products } = await client.products.list({
- name_cont: 'shirt',
- status_eq: 'active',
- sort: '-created_at',
- limit: 25,
- })
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -11497,198 +11776,55 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
- schema:
- type: string
- - name: page
- in: query
- required: false
- description: Page number
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: Number of records per page
- schema:
- type: integer
- - name: sort
- in: query
- required: false
- description: Sort field (e.g., name, -name, price, -price, best_selling)
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (e.g., variants, media,
- option_types, categories). Use dot notation for nested expand (max 4 levels).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price,status).
- id is always included.
- schema:
- type: string
- - name: q[name_cont]
- in: query
- required: false
- description: Filter by name (contains)
- schema:
- type: string
- - name: q[status_eq]
- in: query
- required: false
- description: Filter by status
schema:
type: string
responses:
'200':
- description: products found
+ description: products unpublished from channels
content:
application/json:
example:
- data:
- - id: prod_UkLWZg9DAJ
- name: Product 574995
- slug: product-574995
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 0
- available_on:
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: Exercitationem necessitatibus eaque perspiciatis voluptates
- dolore. Non fugiat alias saepe possimus cum atque velit itaque.
- Id quod eos eius possimus. Quis id reiciendis numquam voluptatibus.
- Similique nisi quod omnis optio quaerat tempore commodi. Dolorum
- officia labore architecto laudantium magnam eligendi a quis. Praesentium
- minus facere voluptates a magni repellat. Quo neque necessitatibus
- autem nostrum laboriosam. Excepturi aspernatur commodi amet voluptatum
- doloribus. Tempore itaque numquam nihil corrupti eum veniam. Soluta
- minus temporibus laboriosam facere sit itaque.
- description_html: |-
- Exercitationem necessitatibus eaque perspiciatis voluptates dolore. Non fugiat alias saepe possimus cum atque velit itaque. Id quod eos eius possimus. Quis id reiciendis numquam voluptatibus.
- Similique nisi quod omnis optio quaerat tempore commodi. Dolorum officia labore architecto laudantium magnam eligendi a quis. Praesentium minus facere voluptates a magni repellat. Quo neque necessitatibus autem nostrum laboriosam.
- Excepturi aspernatur commodi amet voluptatum doloribus. Tempore itaque numquam nihil corrupti eum veniam. Soluta minus temporibus laboriosam facere sit itaque.
- default_variant_id: variant_UkLWZg9DAJ
- thumbnail_url:
- tags: []
- price:
- id: price_UkLWZg9DAJ
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- variant_id: variant_UkLWZg9DAJ
- created_at: '2026-06-05T13:12:53.204Z'
- updated_at: '2026-06-05T13:12:53.204Z'
- original_price:
- status: active
- metadata: {}
- deleted_at:
- created_at: '2026-06-05T13:12:53.193Z'
- updated_at: '2026-06-05T13:12:53.211Z'
- tax_category_id: taxcat_UkLWZg9DAJ
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
+ product_count: 1
+ channel_count: 1
+ removed: 1
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:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ 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: Create a product
+ summary: Bulk-add tags to products
tags:
- - Product Catalog
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Creates a new product. Supports nested variants with prices and option types.
-
- Option types and values are auto-created if they don't exist.
- Prices are upserted by currency. Stock items are upserted by stock location.
-
+ Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.
**Required scope:** `write_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const product = await client.products.create({
- name: 'Premium T-Shirt',
- description: 'Soft, organic cotton.',
- status: 'active',
- variants: [
- {
- sku: 'TSHIRT-S-NAVY',
- options: [
- { name: 'size', value: 'Small' },
- { name: 'color', value: 'navy' },
- ],
- prices: [
- { currency: 'USD', amount: 29.99 },
- { currency: 'EUR', amount: 27.99 },
- ],
- stock_items: [
- { stock_location_id: 'sloc_UkLWZg9DAJ', count_on_hand: 50 },
- ],
- },
- {
- sku: 'TSHIRT-M-NAVY',
- options: [
- { name: 'size', value: 'Medium' },
- { name: 'color', value: 'navy' },
- ],
- prices: [{ currency: 'USD', amount: 29.99 }],
- stock_items: [
- { stock_location_id: 'sloc_UkLWZg9DAJ', count_on_hand: 30 },
- ],
- },
- ],
- })
parameters:
- name: x-spree-api-key
in: header
@@ -11698,179 +11834,55 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
responses:
- '201':
- description: product created
- content:
- application/json:
- example:
- id: prod_gbHJdmfrXB
- name: New Product
- slug: new-product
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 0
- available_on:
- purchasable: false
- in_stock: false
- backorderable: false
- available: false
- description:
- description_html:
- default_variant_id: variant_gbHJdmfrXB
- thumbnail_url:
- tags: []
- price:
- original_price:
- status: draft
- metadata: {}
- deleted_at:
- created_at: '2026-06-05T13:12:53.859Z'
- updated_at: '2026-06-05T13:12:53.860Z'
- tax_category_id:
- schema:
- "$ref": "#/components/schemas/Product"
- '422':
- description: validation error
+ '200':
+ description: tags added
content:
application/json:
example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
+ product_count: 1
+ tag_count: 2
schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ type: object
+ properties:
+ product_count:
+ type: integer
+ tag_count:
+ type: integer
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - ids
+ - tags
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:
+ ids:
type: array
items:
type: string
- description: Array of category IDs
tags:
type: array
items:
type: string
example:
- - eco
+ - summer
- sale
- variants:
- type: array
- description: Array of variant payloads. Variants can declare multiple
- option pairs via `options:` and per-currency prices via `prices:`.
- Stock counts go in `stock_items:` (per stock location).
- items:
- type: object
- properties:
- sku:
- type: string
- options:
- type: array
- description: One pair per option type the variant participates
- in (e.g. size + color). Option types and values are auto-created
- if missing.
- items:
- type: object
- required:
- - name
- - value
- properties:
- name:
- type: string
- 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: number
- example: 29.99
- compare_at_amount:
- type: number
- example: 39.99
- stock_items:
- type: array
- description: Per-stock-location inventory. Upserted by stock_location_id.
- items:
- type: object
- required:
- - stock_location_id
- - count_on_hand
- properties:
- stock_location_id:
- type: string
- description: Stock location ID (e.g. sloc_xxx)
- count_on_hand:
- type: integer
- example: 50
- backorderable:
- type: boolean
- required:
- - name
- "/api/v3/admin/products/{id}":
- get:
- summary: Get a product
+ "/api/v3/admin/products/bulk_remove_tags":
+ post:
+ summary: Bulk-remove tags from products
tags:
- - Product Catalog
+ - Products
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a single product by ID.
-
- **Required scope:** `read_products` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
+ Removes each tag in `tags` from every product in `ids`.
- const product = await client.products.get('prod_86Rf07xd4z', {
- expand: ['variants', 'option_types'],
- })
+ **Required scope:** `write_products` (for API-key authentication).
parameters:
- name: x-spree-api-key
in: header
@@ -11880,112 +11892,98 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
- - name: id
- in: path
+ responses:
+ '200':
+ description: tags removed
+ content:
+ application/json:
+ example:
+ product_count: 1
+ tag_count: 1
+ 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.
+
+ **Required scope:** `write_products` (for API-key authentication).
+ parameters:
+ - name: x-spree-api-key
+ in: header
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.
+ - name: Authorization
+ in: header
+ required: true
schema:
type: string
responses:
'200':
- description: product found
- content:
- application/json:
- example:
- id: prod_UkLWZg9DAJ
- name: Product 613292
- slug: product-613292
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 0
- available_on:
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: Corrupti incidunt recusandae tenetur impedit asperiores
- in culpa error. Ea quod incidunt inventore reiciendis molestiae
- error voluptatem. Assumenda sint adipisci odit et quisquam dicta
- nemo. Quas expedita voluptatem corrupti facere harum porro. Quia
- cumque natus inventore quam odit. Sint amet eum inventore quae soluta
- maxime. At excepturi placeat ipsum harum quo nemo. Voluptate ullam
- officiis iste aut. Ex fuga similique id commodi dolorem. Placeat
- dolor quasi consequatur iste nesciunt voluptatem. Omnis aspernatur
- consequatur aperiam est sequi. Officia vel nesciunt quaerat delectus.
- Laboriosam quis itaque debitis deserunt. Sed nesciunt occaecati
- veniam voluptas voluptatem nostrum architecto. Dolores in temporibus
- earum culpa. Fugit a eum natus odio libero. Doloribus dolor animi
- explicabo ullam sunt accusamus ipsa assumenda. Cum suscipit magnam
- expedita dolorum unde dicta odio.
- description_html: |-
- Corrupti incidunt recusandae tenetur impedit asperiores in culpa error. Ea quod incidunt inventore reiciendis molestiae error voluptatem. Assumenda sint adipisci odit et quisquam dicta nemo. Quas expedita voluptatem corrupti facere harum porro. Quia cumque natus inventore quam odit.
- Sint amet eum inventore quae soluta maxime. At excepturi placeat ipsum harum quo nemo. Voluptate ullam officiis iste aut. Ex fuga similique id commodi dolorem. Placeat dolor quasi consequatur iste nesciunt voluptatem.
- Omnis aspernatur consequatur aperiam est sequi. Officia vel nesciunt quaerat delectus. Laboriosam quis itaque debitis deserunt. Sed nesciunt occaecati veniam voluptas voluptatem nostrum architecto.
- Dolores in temporibus earum culpa. Fugit a eum natus odio libero. Doloribus dolor animi explicabo ullam sunt accusamus ipsa assumenda. Cum suscipit magnam expedita dolorum unde dicta odio.
- default_variant_id: variant_UkLWZg9DAJ
- thumbnail_url:
- tags: []
- price:
- id: price_UkLWZg9DAJ
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- variant_id: variant_UkLWZg9DAJ
- created_at: '2026-06-05T13:12:54.236Z'
- updated_at: '2026-06-05T13:12:54.236Z'
- original_price:
- status: active
- metadata: {}
- deleted_at:
- created_at: '2026-06-05T13:12:54.226Z'
- updated_at: '2026-06-05T13:12:54.241Z'
- tax_category_id: taxcat_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/Product"
- '404':
- description: product not found
+ description: products deleted
content:
application/json:
example:
- error:
- code: record_not_found
- message: Product not found
+ product_count: 1
schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update a product
+ type: object
+ properties:
+ product_count:
+ type: integer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - ids
+ properties:
+ ids:
+ type: array
+ items:
+ type: string
+ "/api/v3/admin/promotions/{promotion_id}/coupon_codes":
+ parameters:
+ - name: promotion_id
+ in: path
+ required: true
+ schema:
+ type: string
+ get:
+ summary: List coupon codes for a promotion
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Updates a product. Only provided fields are updated.
+ 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.
- **Required scope:** `write_products` (for API-key authentication).
+ **Required scope:** `read_promotions` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -11997,11 +11995,7 @@ paths:
secretKey: 'sk_xxx',
})
- const product = await client.products.update('prod_86Rf07xd4z', {
- name: 'Updated Name',
- status: 'active',
- tags: ['eco', 'sale'],
- })
+ const { data: coupons } = await client.promotions.couponCodes.list('promo_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -12011,193 +12005,54 @@ paths:
- 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:
- example:
- id: prod_UkLWZg9DAJ
- name: Updated Name
- slug: product-632707
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 0
- available_on:
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: Soluta praesentium earum assumenda commodi illo voluptatibus
- necessitatibus. Tempore nobis cum quaerat expedita. Ipsa labore
- nisi odio non eveniet quae aperiam nesciunt. Impedit non expedita
- inventore odio veritatis voluptas aliquid quia. Officia repudiandae
- suscipit impedit ipsam provident illo nobis. Ad magnam a at temporibus
- molestias exercitationem esse. Repellat facilis aliquid eligendi
- nulla molestiae officia error deleniti. Repellat dicta natus voluptates
- incidunt labore qui. Illo maiores illum nostrum voluptatibus perferendis.
- Maxime nihil iste inventore provident. Voluptas ab assumenda quisquam
- fugiat non magnam laudantium. Eum vitae sed incidunt ad repellat
- atque sint exercitationem. Quam saepe sint nulla atque.
- description_html: |-
- Soluta praesentium earum assumenda commodi illo voluptatibus necessitatibus. Tempore nobis cum quaerat expedita. Ipsa labore nisi odio non eveniet quae aperiam nesciunt. Impedit non expedita inventore odio veritatis voluptas aliquid quia. Officia repudiandae suscipit impedit ipsam provident illo nobis.
- Ad magnam a at temporibus molestias exercitationem esse. Repellat facilis aliquid eligendi nulla molestiae officia error deleniti. Repellat dicta natus voluptates incidunt labore qui. Illo maiores illum nostrum voluptatibus perferendis. Maxime nihil iste inventore provident.
- Voluptas ab assumenda quisquam fugiat non magnam laudantium. Eum vitae sed incidunt ad repellat atque sint exercitationem. Quam saepe sint nulla atque.
- default_variant_id: variant_UkLWZg9DAJ
- thumbnail_url:
- tags: []
- price:
- id: price_UkLWZg9DAJ
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- variant_id: variant_UkLWZg9DAJ
- created_at: '2026-06-05T13:12:54.904Z'
- updated_at: '2026-06-05T13:12:54.904Z'
- original_price:
- status: active
- metadata: {}
- deleted_at:
- created_at: '2026-06-05T13:12:54.891Z'
- updated_at: '2026-06-05T13:12:55.197Z'
- tax_category_id: taxcat_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/Product"
- '422':
- description: validation error
+ description: coupon codes found
content:
- application/json:
- example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- variants:
- type: array
- description: Array of variant payloads. Variants can declare multiple
- option pairs via `options:` and per-currency prices via `prices:`.
- Stock counts go in `stock_items:` (per stock location).
- items:
- type: object
- properties:
- sku:
- type: string
- options:
- type: array
- description: One pair per option type the variant participates
- in (e.g. size + color). Option types and values are auto-created
- if missing.
- items:
- type: object
- required:
- - name
- - value
- properties:
- name:
- type: string
- 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: number
- example: 29.99
- compare_at_amount:
- type: number
- example: 39.99
- stock_items:
- type: array
- description: Per-stock-location inventory. Upserted by stock_location_id.
- items:
- type: object
- required:
- - stock_location_id
- - count_on_hand
- properties:
- stock_location_id:
- type: string
- description: Stock location ID (e.g. sloc_xxx)
- count_on_hand:
- type: integer
- example: 50
- backorderable:
- type: boolean
- delete:
- summary: Delete a product
+ application/json:
+ example:
+ data:
+ - id: coupon_UkLWZg9DAJ
+ code: AAA111
+ state: unused
+ created_at: '2026-06-08T10:56:40.010Z'
+ updated_at: '2026-06-08T10:56:40.010Z'
+ promotion_id: promo_UkLWZg9DAJ
+ order_id:
+ - id: coupon_gbHJdmfrXB
+ code: BBB222
+ state: unused
+ created_at: '2026-06-08T10:56:40.011Z'
+ updated_at: '2026-06-08T10:56:40.011Z'
+ promotion_id: promo_UkLWZg9DAJ
+ order_id:
+ meta:
+ page: 1
+ limit: 25
+ count: 2
+ pages: 1
+ from: 1
+ to: 2
+ in: 2
+ previous:
+ next:
+ "/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:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
- description: |-
- Soft-deletes a product.
-
- **Required scope:** `write_products` (for API-key authentication).
+ description: "**Required scope:** `read_promotions` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -12209,7 +12064,7 @@ paths:
secretKey: 'sk_xxx',
})
- await client.products.delete('prod_86Rf07xd4z')
+ const { data: actions } = await client.promotions.actions.list('promo_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -12219,32 +12074,60 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
- schema:
- type: string
- - name: id
- in: path
- required: true
- description: Product ID
schema:
type: string
responses:
- '204':
- description: product deleted
- "/api/v3/admin/products/bulk_status_update":
+ '200':
+ description: actions found
+ content:
+ application/json:
+ example:
+ data:
+ - id: pact_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:54.179Z'
+ updated_at: '2026-06-08T10:57:54.179Z'
+ type: free_shipping
+ promotion_id: promo_UkLWZg9DAJ
+ preferences: {}
+ preference_schema: []
+ label: Free shipping
+ calculator:
+ line_items:
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
post:
- summary: Bulk-update product status
+ summary: Create an action on a promotion
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Sets `status` on each product in `ids`. Reindexes the affected products
- for search. Cross-store IDs are silently dropped. Returns counts.
+ Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.
+ **Required scope:** `write_promotions` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
- **Required scope:** `write_products` (for API-key authentication).
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const action = await client.promotions.actions.create('promo_UkLWZg9DAJ', {
+ type: 'free_shipping',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -12257,66 +12140,63 @@ paths:
schema:
type: string
responses:
- '200':
- description: cross-store products silently dropped
+ '201':
+ description: action created
content:
application/json:
example:
- product_count: 0
- status: archived
- schema:
- type: object
- properties:
- product_count:
- type: integer
- status:
- type: string
+ id: pact_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:54.745Z'
+ updated_at: '2026-06-08T10:57:54.745Z'
+ type: free_shipping
+ promotion_id: promo_UkLWZg9DAJ
+ preferences: {}
+ preference_schema: []
+ label: Free shipping
+ calculator:
+ line_items:
'422':
- description: invalid status
+ description: unknown action type
content:
application/json:
example:
error:
- code: invalid_status
- message: Invalid status
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ code: unknown_promotion_action_type
+ message: Unknown type
requestBody:
content:
application/json:
schema:
type: object
- required:
- - ids
- - status
properties:
- ids:
- type: array
- items:
- type: string
- example:
- - prod_UkLWZg9DAJ
- status:
+ type:
type: string
- enum:
- - draft
- - active
- - archived
- example: archived
- "/api/v3/admin/products/bulk_add_to_categories":
- post:
- summary: Bulk-add products to categories
+ example: free_shipping
+ 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:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
- description: |-
- Attaches each product in `ids` to every category (taxon) in `category_ids`.
- Categories from sibling stores are silently ignored.
-
-
- **Required scope:** `write_products` (for API-key authentication).
+ description: "**Required scope:** `write_promotions` (for API-key authentication)."
parameters:
- name: x-spree-api-key
in: header
@@ -12329,49 +12209,35 @@ paths:
schema:
type: string
responses:
- '200':
- description: products added to categories
- content:
- application/json:
- example:
- product_count: 1
- category_count: 1
- 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
+ '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:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
- description: |-
- Detaches each product in `ids` from every category in `category_ids`.
+ description: "**Required scope:** `read_promotions` (for API-key authentication)."
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
- **Required scope:** `write_products` (for API-key authentication).
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: rules } = await client.promotions.rules.list('promo_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -12385,44 +12251,62 @@ paths:
type: string
responses:
'200':
- description: products removed from categories
+ description: rules found
content:
application/json:
example:
- product_count: 1
- category_count: 1
- requestBody:
- content:
- application/json:
- schema:
- type: object
- required:
- - ids
- - category_ids
- properties:
- ids:
- type: array
- items:
- type: string
- category_ids:
- type: array
- items:
+ data:
+ - id: prorule_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:55.356Z'
+ updated_at: '2026-06-08T10:57:55.356Z'
+ type: currency
+ promotion_id: promo_UkLWZg9DAJ
+ preferences:
+ currency: USD
+ preference_schema:
+ - key: currency
type: string
- "/api/v3/admin/products/bulk_add_to_channels":
+ default:
+ label: Currency
+ product_ids:
+ category_ids:
+ customer_ids:
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
post:
- summary: Bulk-add products to channels
+ summary: Create a rule on a promotion
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —
- re-publishing on an existing channel is a no-op. Channels from sibling stores
- are silently ignored.
+ Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.
+
+ **Required scope:** `write_promotions` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
- **Required scope:** `write_products` (for API-key authentication).
+ const rule = await client.promotions.rules.create('promo_UkLWZg9DAJ', {
+ type: 'currency',
+ preferences: { currency: 'EUR' },
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -12435,49 +12319,68 @@ paths:
schema:
type: string
responses:
- '200':
- description: products published on channels
+ '201':
+ description: rule created with preferences
content:
application/json:
example:
- product_count: 1
- channel_count: 1
- schema:
- type: object
- properties:
- product_count:
- type: integer
- channel_count:
- type: integer
+ id: prorule_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:55.935Z'
+ updated_at: '2026-06-08T10:57:55.935Z'
+ type: currency
+ promotion_id: promo_UkLWZg9DAJ
+ preferences:
+ currency: EUR
+ preference_schema:
+ - key: currency
+ type: string
+ default:
+ label: Currency
+ product_ids:
+ category_ids:
+ customer_ids:
+ '422':
+ description: unknown rule type
+ content:
+ application/json:
+ example:
+ error:
+ code: unknown_promotion_rule_type
+ message: Unknown type
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
+ type:
+ type: string
+ example: currency
+ 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:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
- description: |-
- Unpublishes each product in `ids` from every channel in `channel_ids`.
-
- **Required scope:** `write_products` (for API-key authentication).
+ description: "**Required scope:** `write_promotions` (for API-key authentication)."
parameters:
- name: x-spree-api-key
in: header
@@ -12491,51 +12394,42 @@ paths:
type: string
responses:
'200':
- description: products unpublished from channels
+ description: rule updated
content:
application/json:
example:
- product_count: 1
- channel_count: 1
- removed: 1
- schema:
- type: object
- properties:
- product_count:
- type: integer
- channel_count:
- type: integer
- removed:
- type: integer
+ id: prorule_UkLWZg9DAJ
+ created_at: '2026-06-08T10:57:56.238Z'
+ updated_at: '2026-06-08T10:57:56.638Z'
+ type: currency
+ promotion_id: promo_UkLWZg9DAJ
+ preferences:
+ currency: GBP
+ preference_schema:
+ - key: currency
+ type: string
+ default:
+ label: Currency
+ product_ids:
+ category_ids:
+ customer_ids:
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
+ preferences:
+ type: object
+ additionalProperties: true
+ delete:
+ summary: Delete a rule from a promotion
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
- description: |-
- Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.
-
- **Required scope:** `write_products` (for API-key authentication).
+ description: "**Required scope:** `write_promotions` (for API-key authentication)."
parameters:
- name: x-spree-api-key
in: header
@@ -12548,52 +12442,32 @@ paths:
schema:
type: string
responses:
- '200':
- description: tags added
- content:
- application/json:
- example:
- product_count: 1
- tag_count: 2
- 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
- example:
- - summer
- - sale
- "/api/v3/admin/products/bulk_remove_tags":
- post:
- summary: Bulk-remove tags from products
+ '204':
+ description: rule deleted
+ "/api/v3/admin/promotions":
+ get:
+ summary: List promotions
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Removes each tag in `tags` from every product in `ids`.
+ Returns the store's promotions, including manual coupon and automatic promotions.
- **Required scope:** `write_products` (for API-key authentication).
+ **Required scope:** `read_promotions` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: promotions } = await client.promotions.list()
parameters:
- name: x-spree-api-key
in: header
@@ -12607,41 +12481,110 @@ paths:
type: string
responses:
'200':
- description: tags removed
+ description: promotions found
content:
- application/json:
- example:
- product_count: 1
- tag_count: 1
- 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
+ application/json:
+ example:
+ data:
+ - id: promo_UkLWZg9DAJ
+ name: Summer Sale
+ description:
+ code: summer
+ starts_at: '2026-06-08T10:57:57.000Z'
+ expires_at:
+ usage_limit:
+ match_policy: all
+ path:
+ kind: coupon_code
+ multi_codes: false
+ number_of_codes:
+ code_prefix:
+ promotion_category_id:
+ metadata: {}
+ created_at: '2026-06-08T10:57:57.003Z'
+ updated_at: '2026-06-08T10:57:57.004Z'
+ action_ids: []
+ rule_ids: []
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ post:
+ summary: Create a promotion
tags:
- - Product Catalog
+ - Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Soft-deletes each product in `ids`. Returns the count actually destroyed.
+ Creates a new promotion. `code` is required for single-code coupon promotions;
+ pass `multi_codes: true` with `number_of_codes` to auto-generate a batch.
- **Required scope:** `write_products` (for API-key authentication).
+ Rules and actions can be created in the same request by passing arrays of
+ `{ type, preferences, ... }` rows. The server reconciles to the desired set:
+ new rows are built, existing rows (by `id`) are updated, omitted rows are removed.
+
+
+ **Required scope:** `write_promotions` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ // Single coupon code, no rules/actions
+ const promotion = await client.promotions.create({
+ name: 'Black Friday',
+ code: 'BLACKFRIDAY',
+ starts_at: '2026-11-29T00:00:00Z',
+ expires_at: '2026-12-01T00:00:00Z',
+ })
+
+ // One-shot: promotion + rules + actions in a single request
+ const blackFriday = await client.promotions.create({
+ name: 'Black Friday',
+ code: 'BLACKFRIDAY',
+ kind: 'coupon_code',
+ starts_at: '2026-11-29T00:00:00Z',
+ expires_at: '2026-12-01T00:00:00Z',
+ match_policy: 'all',
+ rules: [
+ {
+ type: 'currency',
+ preferences: { currency: 'USD' },
+ },
+ {
+ type: 'item_total',
+ preferences: { amount_min: 100, operator_min: 'gte' },
+ },
+ {
+ type: 'product',
+ preferences: { match_policy: 'any' },
+ product_ids: ['prod_abc123', 'prod_def456'],
+ },
+ ],
+ actions: [
+ {
+ type: 'create_item_adjustments',
+ calculator: {
+ type: 'percent_on_line_item',
+ preferences: { percent: 25 },
+ },
+ },
+ { type: 'free_shipping' },
+ ],
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -12654,56 +12597,152 @@ paths:
schema:
type: string
responses:
- '200':
- description: products deleted
+ '201':
+ description: promotion created with rules and actions
content:
application/json:
example:
- product_count: 1
- schema:
- type: object
- properties:
- product_count:
- type: integer
+ id: promo_gbHJdmfrXB
+ name: Black Friday
+ description:
+ code: blackfriday-os
+ starts_at: '2026-06-08T10:57:58.125Z'
+ expires_at:
+ usage_limit:
+ match_policy: all
+ path:
+ kind: coupon_code
+ multi_codes: false
+ number_of_codes:
+ code_prefix:
+ promotion_category_id:
+ metadata: {}
+ created_at: '2026-06-08T10:57:58.126Z'
+ updated_at: '2026-06-08T10:57:58.145Z'
+ action_ids:
+ - pact_UkLWZg9DAJ
+ - pact_gbHJdmfrXB
+ rule_ids:
+ - prorule_UkLWZg9DAJ
+ - prorule_gbHJdmfrXB
+ - prorule_EfhxLZ9ck8
+ '422':
+ description: invalid params
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Name can't be blank and Code can't be blank
+ details:
+ name:
+ - can't be blank
+ code:
+ - can't be blank
requestBody:
content:
application/json:
schema:
type: object
- required:
- - ids
properties:
- ids:
+ 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: string
- "/api/v3/admin/promotions/{promotion_id}/promotion_actions":
- parameters:
- - name: promotion_id
- in: path
- required: true
- schema:
- type: string
+ 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
+ "/api/v3/admin/promotions/{id}":
get:
- summary: List actions for a promotion
+ summary: Show a promotion
tags:
- Promotions
security:
- api_key: []
bearer_auth: []
description: "**Required scope:** `read_promotions` (for API-key authentication)."
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- const { data: actions } = await client.promotions.actions.list('promo_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -12715,42 +12754,49 @@ paths:
required: true
schema:
type: string
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
responses:
'200':
- description: actions found
+ description: promotion found
content:
application/json:
example:
- data:
- - id: pact_UkLWZg9DAJ
- created_at: '2026-06-05T13:12:59.224Z'
- updated_at: '2026-06-05T13:12:59.224Z'
- type: free_shipping
- promotion_id: promo_UkLWZg9DAJ
- preferences: {}
- preference_schema: []
- label: Free shipping
- calculator:
- line_items:
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- post:
- summary: Create an action on a promotion
+ id: promo_UkLWZg9DAJ
+ name: Summer Sale
+ description:
+ code: summer
+ starts_at: '2026-06-08T10:57:58.456Z'
+ expires_at:
+ usage_limit:
+ match_policy: all
+ path:
+ kind: coupon_code
+ multi_codes: false
+ number_of_codes:
+ code_prefix:
+ promotion_category_id:
+ metadata: {}
+ created_at: '2026-06-08T10:57:58.457Z'
+ updated_at: '2026-06-08T10:57:58.460Z'
+ action_ids: []
+ rule_ids: []
+ patch:
+ summary: Update a promotion
tags:
- Promotions
security:
- api_key: []
bearer_auth: []
description: |-
- Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.
+ Updates a promotion. The `rules` and `actions` arrays are treated as
+ a *desired set* — rows with `id` update in place, rows without `id` are
+ built fresh, and any existing row not present in the array is destroyed.
+ Pass `rules: []` or `actions: []` to clear them.
+
**Required scope:** `write_promotions` (for API-key authentication).
x-codeSamples:
@@ -12764,8 +12810,44 @@ paths:
secretKey: 'sk_xxx',
})
- const action = await client.promotions.actions.create('promo_UkLWZg9DAJ', {
- type: 'free_shipping',
+ // Basic field update
+ await client.promotions.update(promotionId, {
+ description: 'Updated description',
+ })
+
+ // One-shot: rewrite rules + actions in a single request
+ await client.promotions.update(promotionId, {
+ name: 'Holiday Sale',
+ rules: [
+ // Update an existing rule by id — `preferences` overwrite the prior set
+ {
+ id: 'prorule_existing',
+ type: 'currency',
+ preferences: { currency: 'EUR' },
+ },
+ // Add a new rule
+ {
+ type: 'item_total',
+ preferences: { amount_min: 50, operator_min: 'gte' },
+ },
+ ],
+ actions: [
+ // Swap calculator type on an existing action
+ {
+ id: 'proaction_existing',
+ type: 'create_item_adjustments',
+ calculator: {
+ type: 'percent_on_line_item',
+ preferences: { percent: 15 },
+ },
+ },
+ ],
+ })
+
+ // Remove all rules/actions
+ await client.promotions.update(promotionId, {
+ rules: [],
+ actions: [],
})
parameters:
- name: x-spree-api-key
@@ -12778,64 +12860,180 @@ paths:
required: true
schema:
type: string
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
responses:
- '201':
- description: action created
- content:
- application/json:
- example:
- id: pact_UkLWZg9DAJ
- created_at: '2026-06-05T13:12:59.785Z'
- updated_at: '2026-06-05T13:12:59.785Z'
- type: free_shipping
- promotion_id: promo_UkLWZg9DAJ
- preferences: {}
- preference_schema: []
- label: Free shipping
- calculator:
- line_items:
- '422':
- description: unknown action type
+ '200':
+ description: rules and actions cleared with empty arrays
content:
application/json:
example:
- error:
- code: unknown_promotion_action_type
- message: Unknown type
+ id: promo_UkLWZg9DAJ
+ name: Summer Sale
+ description:
+ code: summer
+ starts_at: '2026-06-08T10:57:59.375Z'
+ expires_at:
+ usage_limit:
+ match_policy: all
+ path:
+ kind: coupon_code
+ multi_codes: false
+ number_of_codes:
+ code_prefix:
+ promotion_category_id:
+ metadata: {}
+ created_at: '2026-06-08T10:57:59.376Z'
+ updated_at: '2026-06-08T10:57:59.658Z'
+ action_ids: []
+ rule_ids: []
requestBody:
content:
application/json:
schema:
type: object
properties:
- type:
+ name:
type: string
- example: free_shipping
- 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
+ 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
delete:
- summary: Delete an action from a promotion
+ 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: "**Required scope:** `write_promotions` (for API-key authentication)."
+ 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.
+
+ **Required scope:** `read_promotions` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: actionTypes } = await client.promotionActions.types()
parameters:
- name: x-spree-api-key
in: header
@@ -12848,23 +13046,40 @@ paths:
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
+ '200':
+ description: action types found
+ content:
+ application/json:
+ example:
+ data:
+ - type: create_line_items
+ label: Create line items
+ description:
+ preference_schema: []
+ - type: create_item_adjustments
+ label: Create per-line-item adjustment
+ description:
+ preference_schema: []
+ - type: create_adjustment
+ label: Create whole-order adjustment
+ description:
+ preference_schema: []
+ - type: free_shipping
+ label: Free shipping
+ description:
+ preference_schema: []
+ "/api/v3/admin/promotion_rules/types":
get:
- summary: List rules for a promotion
+ summary: List available promotion rule types
tags:
- Promotions
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `read_promotions` (for API-key authentication)."
+ description: |-
+ Returns the registered Spree::PromotionRule subclasses with their preference schemas.
+
+ **Required scope:** `read_promotions` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -12876,7 +13091,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: rules } = await client.promotions.rules.list('promo_UkLWZg9DAJ')
+ const { data: ruleTypes } = await client.promotionRules.types()
parameters:
- name: x-spree-api-key
in: header
@@ -12890,47 +13105,106 @@ paths:
type: string
responses:
'200':
- description: rules found
+ description: rule types found
content:
application/json:
example:
data:
- - id: prorule_UkLWZg9DAJ
- created_at: '2026-06-05T13:13:00.378Z'
- updated_at: '2026-06-05T13:13:00.378Z'
- type: currency
- promotion_id: promo_UkLWZg9DAJ
- preferences:
- currency: USD
+ - type: category
+ label: Categories
+ description:
preference_schema:
- - key: currency
+ - key: match_policy
+ type: string
+ default: any
+ - type: country
+ label: Country
+ description:
+ preference_schema:
+ - key: country_isos
+ type: array
+ default: []
+ - key: country_id
+ type: integer
+ default:
+ - key: country_iso
type: string
default:
+ - type: currency
label: Currency
- product_ids:
- category_ids:
- customer_ids:
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- post:
- summary: Create a rule on a promotion
+ description:
+ preference_schema:
+ - key: currency
+ type: string
+ default:
+ - type: customer_group
+ label: Customer Group(s)
+ description:
+ preference_schema:
+ - key: customer_group_ids
+ type: array
+ default: []
+ - type: customer
+ label: Customers
+ description:
+ preference_schema: []
+ - type: first_order
+ label: First order
+ description:
+ preference_schema: []
+ - type: item_total
+ label: Item total
+ description:
+ preference_schema:
+ - key: amount_min
+ type: decimal
+ default: 100.0
+ - key: operator_min
+ type: string
+ default: ">"
+ - key: amount_max
+ type: decimal
+ default:
+ - key: operator_max
+ type: string
+ default: "<"
+ - type: one_use_per_user
+ label: One Use Per User
+ description:
+ preference_schema: []
+ - type: customer_logged_in
+ label: Only logged in customers
+ description:
+ preference_schema: []
+ - type: option_value
+ label: Option Value(s)
+ description:
+ preference_schema:
+ - key: match_policy
+ type: string
+ default: any
+ - key: eligible_values
+ type: array
+ default: []
+ - type: product
+ label: Product(s)
+ description:
+ preference_schema:
+ - key: match_policy
+ type: string
+ default: any
+ "/api/v3/admin/orders/{order_id}/refunds":
+ get:
+ summary: List refunds
tags:
- - Promotions
+ - Refunds
security:
- api_key: []
bearer_auth: []
description: |-
- Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.
+ Returns all refunds for an order.
- **Required scope:** `write_promotions` (for API-key authentication).
+ **Required scope:** `read_refunds` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -12942,10 +13216,7 @@ paths:
secretKey: 'sk_xxx',
})
- const rule = await client.promotions.rules.create('promo_UkLWZg9DAJ', {
- type: 'currency',
- preferences: { currency: 'EUR' },
- })
+ const { data: refunds } = await client.orders.refunds.list('or_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -12955,71 +13226,73 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
+ schema:
+ type: string
+ - name: order_id
+ in: path
+ required: true
+ description: Order ID
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (e.g., payment, refund_reason).
+ Use dot notation for nested expand (max 4 levels).
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., amount,reason,transaction_id).
+ id is always included.
schema:
type: string
responses:
- '201':
- description: rule created with preferences
- content:
- application/json:
- example:
- id: prorule_UkLWZg9DAJ
- created_at: '2026-06-05T13:13:00.940Z'
- updated_at: '2026-06-05T13:13:00.940Z'
- type: currency
- promotion_id: promo_UkLWZg9DAJ
- preferences:
- currency: EUR
- preference_schema:
- - key: currency
- type: string
- default:
- label: Currency
- product_ids:
- category_ids:
- customer_ids:
- '422':
- description: unknown rule type
+ '200':
+ description: refunds found
content:
application/json:
example:
- error:
- code: unknown_promotion_rule_type
- message: Unknown type
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- type:
- type: string
- example: currency
- 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
+ data: []
+ meta:
+ page: 1
+ limit: 25
+ count: 0
+ pages: 1
+ from: 0
+ to: 0
+ in: 0
+ previous:
+ next:
+ post:
+ summary: Create a refund
tags:
- - Promotions
+ - Refunds
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `write_promotions` (for API-key authentication)."
+ description: |-
+ Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.
+
+ **Required scope:** `write_refunds` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const refund = await client.orders.refunds.create('or_UkLWZg9DAJ', {
+ payment_id: 'pay_UkLWZg9DAJ',
+ amount: 5.00,
+ refund_reason_id: 'refrsn_UkLWZg9DAJ',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -13029,72 +13302,65 @@ paths:
- 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:
- '200':
- description: rule updated
+ '201':
+ description: refund created
content:
application/json:
example:
- id: prorule_UkLWZg9DAJ
- created_at: '2026-06-05T13:13:01.231Z'
- updated_at: '2026-06-05T13:13:01.523Z'
- type: currency
- promotion_id: promo_UkLWZg9DAJ
- preferences:
- currency: GBP
- preference_schema:
- - key: currency
- type: string
- default:
- label: Currency
- product_ids:
- category_ids:
- customer_ids:
+ id: re_UkLWZg9DAJ
+ transaction_id: BGS-cfd82a13871d
+ amount: '5.0'
+ payment_id: py_UkLWZg9DAJ
+ refund_reason_id: rr_UkLWZg9DAJ
+ reimbursement_id:
+ metadata: {}
+ created_at: '2026-06-08T10:57:26.844Z'
+ updated_at: '2026-06-08T10:57:26.844Z'
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - payment_id
+ - amount
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":
+ payment_id:
+ type: string
+ description: Payment ID
+ amount:
+ type: number
+ example: 10.0
+ refund_reason_id:
+ type: string
+ description: Refund reason ID
+ "/api/v3/admin/store_credit_categories":
get:
- summary: List promotions
+ summary: List store credit categories
tags:
- - Promotions
+ - Settings
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the store's promotions, including manual coupon and automatic promotions.
+ Returns the configured store credit categories. Categories classify
+ store credits (e.g., "Goodwill", "Gift Card", "Refund") and surface
+ in the admin UI as a dropdown when issuing or editing a store
+ credit. Category names matching `Spree::Config[:non_expiring_credit_types]`
+ are flagged via `non_expiring: true`.
- **Required scope:** `read_promotions` (for API-key authentication).
+
+ **Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -13106,7 +13372,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: promotions } = await client.promotions.list()
+ const { data: categories } = await client.storeCreditCategories.list()
parameters:
- name: x-spree-api-key
in: header
@@ -13116,34 +13382,51 @@ paths:
- name: Authorization
in: header
required: true
+ description: Bearer token for admin authentication
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ description: Page number
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ description: Number of records per page
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ description: Filter by name (contains)
+ schema:
+ type: string
+ - name: sort
+ in: query
+ required: false
+ description: Sort by field. Prefix with `-` for descending (e.g., `-created_at`).
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include. id is always included.
schema:
type: string
responses:
'200':
- description: promotions found
+ description: store credit categories found
content:
application/json:
example:
data:
- - id: promo_UkLWZg9DAJ
- name: Summer Sale
- description:
- code: summer
- starts_at: '2026-06-05T13:13:01.832Z'
- expires_at:
- usage_limit:
- match_policy: all
- path:
- kind: coupon_code
- multi_codes: false
- number_of_codes:
- code_prefix:
- promotion_category_id:
- metadata: {}
- created_at: '2026-06-05T13:13:01.833Z'
- updated_at: '2026-06-05T13:13:01.835Z'
- action_ids: []
- rule_ids: []
+ - id: sccat_UkLWZg9DAJ
+ name: Goodwill
+ created_at: '2026-06-08T10:58:03.244Z'
+ updated_at: '2026-06-08T10:58:03.244Z'
+ non_expiring: false
meta:
page: 1
limit: 25
@@ -13154,76 +13437,59 @@ paths:
in: 1
previous:
next:
- 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;
- pass `multi_codes: true` with `number_of_codes` to auto-generate a batch.
-
- Rules and actions can be created in the same request by passing arrays of
- `{ type, preferences, ... }` rows. The server reconciles to the desired set:
- new rows are built, existing rows (by `id`) are updated, omitted rows are removed.
-
-
- **Required scope:** `write_promotions` (for API-key authentication).
- x-codeSamples:
- - lang: javascript
- label: Spree Admin SDK
- source: |-
- import { createAdminClient } from '@spree/admin-sdk'
-
- const client = createAdminClient({
- baseUrl: 'https://your-store.com',
- secretKey: 'sk_xxx',
- })
-
- // Single coupon code, no rules/actions
- const promotion = await client.promotions.create({
- name: 'Black Friday',
- code: 'BLACKFRIDAY',
- starts_at: '2026-11-29T00:00:00Z',
- expires_at: '2026-12-01T00:00:00Z',
- })
-
- // One-shot: promotion + rules + actions in a single request
- const blackFriday = await client.promotions.create({
- name: 'Black Friday',
- code: 'BLACKFRIDAY',
- kind: 'coupon_code',
- starts_at: '2026-11-29T00:00:00Z',
- expires_at: '2026-12-01T00:00:00Z',
- match_policy: 'all',
- rules: [
- {
- type: 'currency',
- preferences: { currency: 'USD' },
- },
- {
- type: 'item_total',
- preferences: { amount_min: 100, operator_min: 'gte' },
- },
- {
- type: 'product',
- preferences: { match_policy: 'any' },
- product_ids: ['prod_abc123', 'prod_def456'],
- },
- ],
- actions: [
- {
- type: 'create_item_adjustments',
- calculator: {
- type: 'percent_on_line_item',
- preferences: { percent: 25 },
- },
- },
- { type: 'free_shipping' },
- ],
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/StoreCreditCategory"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ required:
+ - data
+ - meta
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/admin/store_credit_categories/{id}":
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: Store credit category ID
+ schema:
+ type: string
+ get:
+ summary: Get a store credit category
+ tags:
+ - Settings
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: |-
+ Returns a single store credit category by prefixed ID.
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
})
+
+ const category = await client.storeCreditCategories.get('sccat_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -13233,155 +13499,62 @@ paths:
- 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:
- '201':
- description: promotion created with rules and actions
+ '200':
+ description: store credit category found
content:
application/json:
example:
- id: promo_gbHJdmfrXB
- name: Black Friday
- description:
- code: blackfriday-os
- starts_at: '2026-06-05T13:13:02.777Z'
- expires_at:
- usage_limit:
- match_policy: all
- path:
- kind: coupon_code
- multi_codes: false
- number_of_codes:
- code_prefix:
- promotion_category_id:
- metadata: {}
- created_at: '2026-06-05T13:13:02.779Z'
- updated_at: '2026-06-05T13:13:02.797Z'
- action_ids:
- - pact_UkLWZg9DAJ
- - pact_gbHJdmfrXB
- rule_ids:
- - prorule_UkLWZg9DAJ
- - prorule_gbHJdmfrXB
- - prorule_EfhxLZ9ck8
- '422':
- description: invalid params
+ id: sccat_UkLWZg9DAJ
+ name: Goodwill
+ created_at: '2026-06-08T10:58:03.544Z'
+ updated_at: '2026-06-08T10:58:03.544Z'
+ non_expiring: false
+ schema:
+ "$ref": "#/components/schemas/StoreCreditCategory"
+ '404':
+ description: store credit category not found
content:
application/json:
example:
error:
- code: validation_error
- message: Name can't be blank and Code can't be blank
- details:
- name:
- - can't be blank
- code:
- - can't be blank
- 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
- 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
- "/api/v3/admin/promotions/{id}":
+ code: record_not_found
+ message: Store credit category not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/admin/store":
get:
- summary: Show a promotion
+ summary: Get the current store
tags:
- - Promotions
+ - Settings
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `read_promotions` (for API-key authentication)."
+ description: |-
+ Returns the current store configuration. The store is resolved from the request context (host or admin selection); there is no `id` parameter.
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const store = await client.store.get()
parameters:
- name: x-spree-api-key
in: header
@@ -13391,53 +13564,60 @@ paths:
- name: Authorization
in: header
required: true
- schema:
- type: string
- - name: id
- in: path
- required: true
+ description: Bearer token for admin authentication
schema:
type: string
responses:
'200':
- description: promotion found
+ description: current store
content:
application/json:
example:
- id: promo_UkLWZg9DAJ
- name: Summer Sale
- description:
- code: summer
- starts_at: '2026-06-05T13:13:03.094Z'
- expires_at:
- usage_limit:
- match_policy: all
- path:
- kind: coupon_code
- multi_codes: false
- number_of_codes:
- code_prefix:
- promotion_category_id:
+ id: store_UkLWZg9DAJ
metadata: {}
- created_at: '2026-06-05T13:13:03.096Z'
- updated_at: '2026-06-05T13:13:03.097Z'
- action_ids: []
- rule_ids: []
+ name: Spree Test Store
+ default_currency: USD
+ default_locale: en
+ mail_from_address: [email protected]
+ customer_support_email: [email protected]
+ new_order_notifications_email: [email protected]
+ preferred_send_consumer_transactional_emails: true
+ preferred_admin_locale:
+ preferred_timezone: UTC
+ preferred_weight_unit: lb
+ preferred_unit_system: imperial
+ created_at: '2026-06-08T10:56:29.978Z'
+ updated_at: '2026-06-08T10:58:04.145Z'
+ url: http://www.example.com:3000
+ supported_currencies:
+ - USD
+ supported_locales:
+ - en
+ logo_url:
+ mailer_logo_url:
+ schema:
+ "$ref": "#/components/schemas/Store"
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
patch:
- summary: Update a promotion
+ summary: Update the current store
tags:
- - Promotions
+ - Settings
security:
- api_key: []
bearer_auth: []
description: |-
- Updates a promotion. The `rules` and `actions` arrays are treated as
- a *desired set* — rows with `id` update in place, rows without `id` are
- built fresh, and any existing row not present in the array is destroyed.
- Pass `rules: []` or `actions: []` to clear them.
-
+ Updates the current store configuration.
- **Required scope:** `write_promotions` (for API-key authentication).
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -13449,44 +13629,8 @@ paths:
secretKey: 'sk_xxx',
})
- // Basic field update
- await client.promotions.update(promotionId, {
- description: 'Updated description',
- })
-
- // One-shot: rewrite rules + actions in a single request
- await client.promotions.update(promotionId, {
- name: 'Holiday Sale',
- rules: [
- // Update an existing rule by id — `preferences` overwrite the prior set
- {
- id: 'prorule_existing',
- type: 'currency',
- preferences: { currency: 'EUR' },
- },
- // Add a new rule
- {
- type: 'item_total',
- preferences: { amount_min: 50, operator_min: 'gte' },
- },
- ],
- actions: [
- // Swap calculator type on an existing action
- {
- id: 'proaction_existing',
- type: 'create_item_adjustments',
- calculator: {
- type: 'percent_on_line_item',
- preferences: { percent: 15 },
- },
- },
- ],
- })
-
- // Remove all rules/actions
- await client.promotions.update(promotionId, {
- rules: [],
- actions: [],
+ const store = await client.store.update({
+ name: 'My Store'
})
parameters:
- name: x-spree-api-key
@@ -13497,38 +13641,52 @@ paths:
- name: Authorization
in: header
required: true
- schema:
- type: string
- - name: id
- in: path
- required: true
+ description: Bearer token for admin authentication
schema:
type: string
responses:
'200':
- description: rules and actions cleared with empty arrays
+ description: store updated
content:
application/json:
example:
- id: promo_UkLWZg9DAJ
- name: Summer Sale
- description:
- code: summer
- starts_at: '2026-06-05T13:13:03.976Z'
- expires_at:
- usage_limit:
- match_policy: all
- path:
- kind: coupon_code
- multi_codes: false
- number_of_codes:
- code_prefix:
- promotion_category_id:
+ id: store_UkLWZg9DAJ
metadata: {}
- created_at: '2026-06-05T13:13:03.977Z'
- updated_at: '2026-06-05T13:13:04.254Z'
- action_ids: []
- rule_ids: []
+ name: Renamed Store
+ default_currency: USD
+ default_locale: en
+ mail_from_address: [email protected]
+ customer_support_email: [email protected]
+ new_order_notifications_email: [email protected]
+ preferred_send_consumer_transactional_emails: true
+ preferred_admin_locale:
+ preferred_timezone: UTC
+ preferred_weight_unit: lb
+ preferred_unit_system: imperial
+ created_at: '2026-06-08T10:56:29.978Z'
+ updated_at: '2026-06-08T10:58:04.762Z'
+ url: http://www.example.com:3000
+ supported_currencies:
+ - USD
+ supported_locales:
+ - en
+ logo_url:
+ mailer_logo_url:
+ schema:
+ "$ref": "#/components/schemas/Store"
+ '422':
+ description: validation error
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Site Name can't be blank
+ details:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
@@ -13537,99 +13695,109 @@ paths:
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:
+ example: My Store
+ preferred_admin_locale:
type: string
- format: date-time
- nullable: true
- usage_limit:
- type: integer
- nullable: true
- match_policy:
+ example: en
+ preferred_timezone:
type: string
- enum:
- - all
- - any
- kind:
+ example: UTC
+ preferred_weight_unit:
type: string
- enum:
- - coupon_code
- - automatic
- promotion_category_id:
+ example: kg
+ preferred_unit_system:
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
- delete:
- summary: Delete a promotion
+ example: metric
+ "/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.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: tags } = await client.tags.list({
+ taggable_type: 'Spree::User',
+ q: 'vip',
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: taggable_type
+ in: query
+ required: true
+ description: Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)
+ schema:
+ type: string
+ - name: q
+ in: query
+ required: false
+ description: Optional case-insensitive substring filter
+ schema:
+ type: string
+ responses:
+ '200':
+ description: tags found
+ content:
+ application/json:
+ example:
+ data:
+ - name: vip
+ - name: wholesale
+ '422':
+ description: invalid taggable type
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_taggable_type
+ message: taggable_type must be one of Spree::Product, Spree::Order,
+ Spree::LegacyUser
+ "/api/v3/admin/admin_users":
+ get:
+ summary: List staff
tags:
- - Promotions
+ - Staff
security:
- api_key: []
bearer_auth: []
- description: "**Required scope:** `write_promotions` (for API-key authentication)."
+ description: |-
+ Returns admin users with at least one role assignment on the current store.
+
+ **Required scope:** `read_settings` (for API-key authentication).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree Admin SDK
+ source: |-
+ import { createAdminClient } from '@spree/admin-sdk'
+
+ const client = createAdminClient({
+ baseUrl: 'https://your-store.com',
+ secretKey: 'sk_xxx',
+ })
+
+ const { data: staff } = await client.adminUsers.list()
parameters:
- name: x-spree-api-key
in: header
@@ -13641,26 +13809,42 @@ paths:
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":
+ '200':
+ description: staff found
+ content:
+ application/json:
+ example:
+ data:
+ - id: admin_UkLWZg9DAJ
+ first_name: Harrison
+ last_name: Parisian
+ full_name: Harrison Parisian
+ created_at: '2026-06-08T10:56:30.306Z'
+ updated_at: '2026-06-08T10:56:30.306Z'
+ roles:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ "/api/v3/admin/admin_users/{id}":
get:
- summary: List available promotion action types
+ summary: Show a staff member
tags:
- - Promotions
+ - Staff
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.
-
- **Required scope:** `read_promotions` (for API-key authentication).
+ description: "**Required scope:** `read_settings` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -13672,7 +13856,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: actionTypes } = await client.promotionActions.types()
+ const staff = await client.adminUsers.get('admin_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -13684,41 +13868,38 @@ paths:
required: true
schema:
type: string
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
responses:
'200':
- description: action types found
+ description: staff member found
content:
application/json:
example:
- data:
- - type: create_line_items
- label: Create line items
- description:
- preference_schema: []
- - type: create_item_adjustments
- label: Create per-line-item adjustment
- description:
- preference_schema: []
- - type: create_adjustment
- label: Create whole-order adjustment
- description:
- preference_schema: []
- - type: free_shipping
- label: Free shipping
- description:
- preference_schema: []
- "/api/v3/admin/promotion_rules/types":
- get:
- summary: List available promotion rule types
+ id: admin_UkLWZg9DAJ
+ first_name: Burt
+ last_name: Cole
+ full_name: Burt Cole
+ created_at: '2026-06-08T10:56:30.644Z'
+ updated_at: '2026-06-08T10:56:30.644Z'
+ roles:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ patch:
+ summary: Update a staff member
tags:
- - Promotions
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the registered Spree::PromotionRule subclasses with their preference schemas.
+ 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.
- **Required scope:** `read_promotions` (for API-key authentication).
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -13730,7 +13911,10 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: ruleTypes } = await client.promotionRules.types()
+ const staff = await client.adminUsers.update('admin_xxx', {
+ first_name: 'Ada',
+ role_ids: ['role_xxx']
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -13742,108 +13926,54 @@ paths:
required: true
schema:
type: string
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
responses:
'200':
- description: rule types found
+ description: staff member updated
content:
application/json:
example:
- data:
- - type: category
- label: Categories
- description:
- preference_schema:
- - key: match_policy
- type: string
- default: any
- - type: country
- label: Country
- description:
- preference_schema:
- - key: country_isos
- type: array
- default: []
- - key: country_id
- type: integer
- default:
- - key: country_iso
- type: string
- default:
- - type: currency
- label: Currency
- description:
- preference_schema:
- - key: currency
- type: string
- default:
- - type: customer_group
- label: Customer Group(s)
- description:
- preference_schema:
- - key: customer_group_ids
- type: array
- default: []
- - type: customer
- label: Customers
- description:
- preference_schema: []
- - type: first_order
- label: First order
- description:
- preference_schema: []
- - type: item_total
- label: Item total
- description:
- preference_schema:
- - key: amount_min
- type: decimal
- default: 100.0
- - key: operator_min
- type: string
- default: ">"
- - key: amount_max
- type: decimal
- default:
- - key: operator_max
- type: string
- default: "<"
- - type: one_use_per_user
- label: One Use Per User
- description:
- preference_schema: []
- - type: customer_logged_in
- label: Only logged in customers
- description:
- preference_schema: []
- - type: option_value
- label: Option Value(s)
- description:
- preference_schema:
- - key: match_policy
- type: string
- default: any
- - key: eligible_values
- type: array
- default: []
- - type: product
- label: Product(s)
- description:
- preference_schema:
- - key: match_policy
+ id: admin_UkLWZg9DAJ
+ first_name: Renamed
+ last_name: Rodriguez
+ full_name: Renamed Rodriguez
+ created_at: '2026-06-08T10:56:30.927Z'
+ updated_at: '2026-06-08T10:56:30.946Z'
+ roles:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ requestBody:
+ 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
- default: any
- "/api/v3/admin/roles":
- get:
- summary: List roles
+ delete:
+ summary: Remove a staff member from this store
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the roles available for staff role pickers. Roles are global, not per-store.
+ Removes the user's role assignments on the current store. The account is preserved — the user keeps access to any other stores.
- **Required scope:** `read_settings` (for API-key authentication).
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -13855,7 +13985,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: roles } = await client.roles.list()
+ await client.adminUsers.delete('admin_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -13867,47 +13997,24 @@ paths:
required: true
schema:
type: string
- responses:
- '200':
- description: roles found
- content:
- application/json:
- example:
- data:
- - id: role_UkLWZg9DAJ
- name: admin
- created_at: '2026-06-05T13:13:05.141Z'
- updated_at: '2026-06-05T13:13:05.141Z'
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- "/api/v3/admin/stock_locations":
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ '204':
+ description: staff removed from store
+ "/api/v3/admin/invitations":
get:
- summary: List stock locations
+ summary: List invitations
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the configured stock locations. Stock locations are global
- (shared across stores). Filter with Ransack predicates such as
- `q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or
- `q[name_cont]`.
-
- Pickup-related attributes (`kind`, `pickup_enabled`,
- `pickup_stock_policy`, `pickup_ready_in_minutes`,
- `pickup_instructions`) drive merchant pickup support at checkout —
- customers can collect orders from any active location with
- `pickup_enabled: true`.
-
+ Returns invitations for the current store, including pending and accepted.
**Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
@@ -13921,7 +14028,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: stockLocations } = await client.stockLocations.list()
+ const { data: invitations } = await client.invitations.list()
parameters:
- name: x-spree-api-key
in: header
@@ -13931,89 +14038,29 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
- schema:
- type: string
- - name: page
- in: query
- required: false
- description: Page number
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: Number of records per page
- schema:
- type: integer
- - name: q[name_cont]
- in: query
- required: false
- description: Filter by name (contains)
- schema:
- type: string
- - name: q[active_eq]
- in: query
- required: false
- description: Filter by active status
- schema:
- type: boolean
- - name: q[kind_eq]
- in: query
- required: false
- description: 'Filter by kind (built-in: ''warehouse'', ''store'', ''fulfillment_center'')'
- schema:
- type: string
- - name: q[pickup_enabled_eq]
- in: query
- required: false
- description: Filter by pickup-enabled flag
- schema:
- type: boolean
- - name: sort
- in: query
- required: false
- description: Sort by field. Prefix with `-` for descending (e.g., `-created_at`).
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include. id is always included.
schema:
type: string
responses:
'200':
- description: stock locations found
+ description: invitations found
content:
application/json:
example:
data:
- - id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_47
- name: Brooklyn warehouse
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_47
- admin_name:
- address2:
- state_name:
- phone: "(202) 456-1111"
- company:
- active: true
- default: false
- backorderable_default: true
- propagate_all_variants: false
- kind: warehouse
- pickup_enabled: false
- pickup_stock_policy: local
- pickup_ready_in_minutes:
- pickup_instructions:
- created_at: '2026-06-05T13:13:05.424Z'
- updated_at: '2026-06-05T13:13:05.424Z'
+ - id: inv_UkLWZg9DAJ
+ status: pending
+ created_at: '2026-06-08T10:57:05.016Z'
+ updated_at: '2026-06-08T10:57:05.016Z'
+ expires_at: '2026-06-22T10:57:05.014Z'
+ role_id: role_UkLWZg9DAJ
+ role_name: admin
+ inviter_email: [email protected]
+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=YJnLJxUSrtebeM9iYcT2mb9P"
+ invitee_exists: false
+ store:
+ id: store_UkLWZg9DAJ
+ name: Spree Test Store
meta:
page: 1
limit: 25
@@ -14024,41 +14071,15 @@ paths:
in: 1
previous:
next:
- 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:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
post:
- summary: Create a stock location
+ summary: Create an invitation
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Creates a new stock location.
-
- Setting `default: true` automatically demotes the previous default
- location.
-
+ 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.
**Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
@@ -14072,16 +14093,9 @@ paths:
secretKey: 'sk_xxx',
})
- const stockLocation = await client.stockLocations.create({
- name: 'Brooklyn warehouse',
- kind: 'warehouse',
- country_iso: 'US',
- state_abbr: 'NY',
- city: 'Brooklyn',
- zipcode: '11201',
- pickup_enabled: true,
- pickup_stock_policy: 'local',
- pickup_ready_in_minutes: 60,
+ const invitation = await client.invitations.create({
+ email: '[email protected]',
+ role_id: 'role_xxx'
})
parameters:
- name: x-spree-api-key
@@ -14092,154 +14106,52 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
schema:
type: string
responses:
'201':
- description: stock location created
- content:
- application/json:
- example:
- id: sloc_gbHJdmfrXB
- state_abbr:
- name: Manhattan store
- address1:
- city:
- zipcode:
- country_iso:
- country_name:
- state_text:
- admin_name:
- address2:
- state_name:
- phone:
- company:
- active: true
- default: false
- backorderable_default: false
- propagate_all_variants: false
- kind: store
- pickup_enabled: true
- pickup_stock_policy: local
- pickup_ready_in_minutes: 30
- pickup_instructions:
- created_at: '2026-06-05T13:13:05.993Z'
- updated_at: '2026-06-05T13:13:05.993Z'
- schema:
- "$ref": "#/components/schemas/StockLocation"
- '422':
- description: validation error
+ description: invitation created
content:
application/json:
example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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_iso:
- type: string
- nullable: true
- description: ISO-3166 alpha-2 country code (e.g. "US").
- state_abbr:
- type: string
- nullable: true
- description: State / province abbreviation (e.g. "NY"). Resolved
- against the selected country.
- state_name:
- type: string
- nullable: true
- description: Free-text state for countries without a states list.
- pickup_enabled:
- type: boolean
- pickup_stock_policy:
+ id: inv_gbHJdmfrXB
+ status: pending
+ created_at: '2026-06-08T10:57:05.335Z'
+ updated_at: '2026-06-08T10:57:05.335Z'
+ expires_at: '2026-06-22T10:57:05.333Z'
+ role_id: role_UkLWZg9DAJ
+ role_name: admin
+ inviter_email: [email protected]
+ acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=ttUpsLEE1U6sfGhhu1bU7G62"
+ invitee_exists: false
+ store:
+ id: store_UkLWZg9DAJ
+ name: Spree Test Store
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - email
+ - role_id
+ properties:
+ email:
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:
+ role_id:
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
+ example: role_xxx
+ "/api/v3/admin/invitations/{id}":
+ delete:
+ summary: Revoke an invitation
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
- description: |-
- Returns a single stock location by prefixed ID.
-
- **Required scope:** `read_settings` (for API-key authentication).
+ description: "**Required scope:** `write_settings` (for API-key authentication)."
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -14251,7 +14163,7 @@ paths:
secretKey: 'sk_xxx',
})
- const stockLocation = await client.stockLocations.get('sloc_UkLWZg9DAJ')
+ await client.invitations.delete('inv_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -14261,71 +14173,26 @@ paths:
- 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.
+ - name: id
+ in: path
+ required: true
schema:
type: string
responses:
- '200':
- description: stock location found
- content:
- application/json:
- example:
- id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_51
- name: Brooklyn warehouse
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_51
- admin_name:
- address2:
- state_name:
- phone: "(202) 456-1111"
- company:
- active: true
- default: false
- backorderable_default: true
- propagate_all_variants: false
- kind: warehouse
- pickup_enabled: false
- pickup_stock_policy: local
- pickup_ready_in_minutes:
- pickup_instructions:
- created_at: '2026-06-05T13:13:06.281Z'
- updated_at: '2026-06-05T13:13:06.281Z'
- schema:
- "$ref": "#/components/schemas/StockLocation"
- '404':
- description: stock location not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Stock location not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ '204':
+ description: invitation revoked
+ "/api/v3/admin/invitations/{id}/resend":
patch:
- summary: Update a stock location
+ summary: Resend an invitation
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Updates an existing stock location. Same address-field conventions as
- the create endpoint.
-
- Setting `default: true` automatically demotes the previous default.
-
+ Issues a fresh token and dispatches the invitation email again.
**Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
@@ -14339,11 +14206,7 @@ paths:
secretKey: 'sk_xxx',
})
- const stockLocation = await client.stockLocations.update('sloc_UkLWZg9DAJ', {
- pickup_enabled: true,
- pickup_ready_in_minutes: 45,
- pickup_instructions: 'Enter through the back door, ring the bell.',
- })
+ const invitation = await client.invitations.resend('inv_xxx')
parameters:
- name: x-spree-api-key
in: header
@@ -14353,135 +14216,45 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer token for admin authentication
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
schema:
type: string
responses:
'200':
- description: stock location updated
- content:
- application/json:
- example:
- id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_53
- name: Renamed warehouse
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_53
- admin_name:
- address2:
- state_name:
- phone: "(202) 456-1111"
- company:
- active: true
- default: false
- backorderable_default: true
- propagate_all_variants: false
- kind: warehouse
- pickup_enabled: true
- pickup_stock_policy: local
- pickup_ready_in_minutes: 45
- pickup_instructions:
- created_at: '2026-06-05T13:13:06.840Z'
- updated_at: '2026-06-05T13:13:07.113Z'
- schema:
- "$ref": "#/components/schemas/StockLocation"
- '422':
- description: validation error
+ description: invitation resent
content:
application/json:
example:
- error:
- code: validation_error
- message: Pickup stock policy is not included in the list
- details:
- pickup_stock_policy:
- - is not included in the list
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- name:
- type: string
- admin_name:
- type: string
- nullable: true
- active:
- type: boolean
- default:
- type: boolean
- kind:
- type: string
- enum:
- - warehouse
- - store
- - fulfillment_center
- propagate_all_variants:
- type: boolean
- backorderable_default:
- type: boolean
- address1:
- type: string
- nullable: true
- address2:
- type: string
- nullable: true
- city:
- type: string
- nullable: true
- zipcode:
- type: string
- nullable: true
- phone:
- type: string
- nullable: true
- company:
- type: string
- nullable: true
- country_iso:
- type: string
- nullable: true
- state_abbr:
- type: string
- nullable: true
- state_name:
- type: string
- nullable: true
- pickup_enabled:
- type: boolean
- pickup_stock_policy:
- type: string
- enum:
- - local
- - any
- pickup_ready_in_minutes:
- type: number
- nullable: true
- minimum: 0
- pickup_instructions:
- type: string
- nullable: true
- delete:
- summary: Delete a stock location
+ id: inv_UkLWZg9DAJ
+ status: pending
+ created_at: '2026-06-08T10:57:05.902Z'
+ updated_at: '2026-06-08T10:57:05.902Z'
+ expires_at: '2026-06-22T10:57:05.900Z'
+ role_id: role_UkLWZg9DAJ
+ role_name: admin
+ inviter_email: [email protected]
+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=GZQipgFcLGqh5JQj54ouvodx"
+ invitee_exists: false
+ store:
+ id: store_UkLWZg9DAJ
+ name: Spree Test Store
+ "/api/v3/admin/roles":
+ get:
+ summary: List roles
tags:
- - Configuration
+ - Staff
security:
- api_key: []
bearer_auth: []
description: |-
- Soft-deletes the stock location (sets `deleted_at`). Existing
- fulfillments that referenced it keep the historical record via
- `Spree::StockLocation.with_deleted`.
-
+ Returns the roles available for staff role pickers. Roles are global, not per-store.
- **Required scope:** `write_settings` (for API-key authentication).
+ **Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -14493,7 +14266,7 @@ paths:
secretKey: 'sk_xxx',
})
- await client.stockLocations.delete('sloc_UkLWZg9DAJ')
+ const { data: roles } = await client.roles.list()
parameters:
- name: x-spree-api-key
in: header
@@ -14503,26 +14276,48 @@ paths:
- 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_credit_categories":
+ responses:
+ '200':
+ description: roles found
+ content:
+ application/json:
+ example:
+ data:
+ - id: role_UkLWZg9DAJ
+ name: admin
+ created_at: '2026-06-08T10:58:00.563Z'
+ updated_at: '2026-06-08T10:58:00.563Z'
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
+ "/api/v3/admin/stock_locations":
get:
- summary: List store credit categories
+ summary: List stock locations
tags:
- - Configuration
+ - Stock Locations
security:
- api_key: []
bearer_auth: []
description: |-
- Returns the configured store credit categories. Categories classify
- store credits (e.g., "Goodwill", "Gift Card", "Refund") and surface
- in the admin UI as a dropdown when issuing or editing a store
- credit. Category names matching `Spree::Config[:non_expiring_credit_types]`
- are flagged via `non_expiring: true`.
+ Returns the configured stock locations. Stock locations are global
+ (shared across stores). Filter with Ransack predicates such as
+ `q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or
+ `q[name_cont]`.
+
+ Pickup-related attributes (`kind`, `pickup_enabled`,
+ `pickup_stock_policy`, `pickup_ready_in_minutes`,
+ `pickup_instructions`) drive merchant pickup support at checkout —
+ customers can collect orders from any active location with
+ `pickup_enabled: true`.
**Required scope:** `read_settings` (for API-key authentication).
@@ -14537,7 +14332,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: categories } = await client.storeCreditCategories.list()
+ const { data: stockLocations } = await client.stockLocations.list()
parameters:
- name: x-spree-api-key
in: header
@@ -14568,6 +14363,24 @@ paths:
description: Filter by name (contains)
schema:
type: string
+ - name: q[active_eq]
+ in: query
+ required: false
+ description: Filter by active status
+ schema:
+ type: boolean
+ - name: q[kind_eq]
+ in: query
+ required: false
+ description: 'Filter by kind (built-in: ''warehouse'', ''store'', ''fulfillment_center'')'
+ schema:
+ type: string
+ - name: q[pickup_enabled_eq]
+ in: query
+ required: false
+ description: Filter by pickup-enabled flag
+ schema:
+ type: boolean
- name: sort
in: query
required: false
@@ -14582,16 +14395,36 @@ paths:
type: string
responses:
'200':
- description: store credit categories found
+ description: stock locations found
content:
application/json:
example:
data:
- - id: sccat_UkLWZg9DAJ
- name: Goodwill
- created_at: '2026-06-05T13:13:07.692Z'
- updated_at: '2026-06-05T13:13:07.692Z'
- non_expiring: false
+ - id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_47
+ name: Brooklyn warehouse
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_47
+ admin_name:
+ address2:
+ state_name:
+ phone: "(202) 456-1111"
+ company:
+ active: true
+ default: false
+ backorderable_default: true
+ propagate_all_variants: false
+ kind: warehouse
+ pickup_enabled: false
+ pickup_stock_policy: local
+ pickup_ready_in_minutes:
+ pickup_instructions:
+ created_at: '2026-06-08T10:58:00.850Z'
+ updated_at: '2026-06-08T10:58:00.850Z'
meta:
page: 1
limit: 25
@@ -14608,7 +14441,7 @@ paths:
data:
type: array
items:
- "$ref": "#/components/schemas/StoreCreditCategory"
+ "$ref": "#/components/schemas/StockLocation"
meta:
"$ref": "#/components/schemas/PaginationMeta"
required:
@@ -14624,25 +14457,21 @@ paths:
message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/admin/store_credit_categories/{id}":
- parameters:
- - name: id
- in: path
- required: true
- description: Store credit category ID
- schema:
- type: string
- get:
- summary: Get a store credit category
+ post:
+ summary: Create a stock location
tags:
- - Configuration
+ - Stock Locations
security:
- api_key: []
bearer_auth: []
description: |-
- Returns a single store credit category by prefixed ID.
+ Creates a new stock location.
- **Required scope:** `read_settings` (for API-key authentication).
+ Setting `default: true` automatically demotes the previous default
+ location.
+
+
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -14654,7 +14483,17 @@ paths:
secretKey: 'sk_xxx',
})
- const category = await client.storeCreditCategories.get('sccat_UkLWZg9DAJ')
+ const stockLocation = await client.stockLocations.create({
+ name: 'Brooklyn warehouse',
+ kind: 'warehouse',
+ country_iso: 'US',
+ state_abbr: 'NY',
+ city: 'Brooklyn',
+ zipcode: '11201',
+ pickup_enabled: true,
+ pickup_stock_policy: 'local',
+ pickup_ready_in_minutes: 60,
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -14667,45 +14506,149 @@ paths:
description: Bearer token for admin authentication
schema:
type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include. id is always included.
- schema:
- type: string
responses:
- '200':
- description: store credit category found
+ '201':
+ description: stock location created
content:
application/json:
example:
- id: sccat_UkLWZg9DAJ
- name: Goodwill
- created_at: '2026-06-05T13:13:08.000Z'
- updated_at: '2026-06-05T13:13:08.000Z'
- non_expiring: false
+ id: sloc_gbHJdmfrXB
+ state_abbr:
+ name: Manhattan store
+ address1:
+ city:
+ zipcode:
+ country_iso:
+ country_name:
+ state_text:
+ admin_name:
+ address2:
+ state_name:
+ phone:
+ company:
+ active: true
+ default: false
+ backorderable_default: false
+ propagate_all_variants: false
+ kind: store
+ pickup_enabled: true
+ pickup_stock_policy: local
+ pickup_ready_in_minutes: 30
+ pickup_instructions:
+ created_at: '2026-06-08T10:58:01.432Z'
+ updated_at: '2026-06-08T10:58:01.432Z'
schema:
- "$ref": "#/components/schemas/StoreCreditCategory"
- '404':
- description: store credit category not found
+ "$ref": "#/components/schemas/StockLocation"
+ '422':
+ description: validation error
content:
application/json:
example:
error:
- code: record_not_found
- message: Store credit category not found
+ code: validation_error
+ message: Name can't be blank
+ details:
+ name:
+ - can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/admin/store":
+ requestBody:
+ 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_iso:
+ type: string
+ nullable: true
+ description: ISO-3166 alpha-2 country code (e.g. "US").
+ state_abbr:
+ type: string
+ nullable: true
+ description: State / province abbreviation (e.g. "NY"). Resolved
+ against the selected country.
+ state_name:
+ type: string
+ nullable: true
+ description: Free-text state for countries without a states list.
+ pickup_enabled:
+ type: boolean
+ pickup_stock_policy:
+ type: string
+ enum:
+ - local
+ - any
+ description: "'local' = items at this location only; 'any' = transfer-eligible
+ (ship-to-store)."
+ pickup_ready_in_minutes:
+ type: number
+ nullable: true
+ minimum: 0
+ pickup_instructions:
+ type: string
+ nullable: true
+ required:
+ - name
+ "/api/v3/admin/stock_locations/{id}":
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: Stock location ID
+ schema:
+ type: string
get:
- summary: Get the current store
+ summary: Get a stock location
tags:
- - Configuration
+ - Stock Locations
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.
+ Returns a single stock location by prefixed ID.
**Required scope:** `read_settings` (for API-key authentication).
x-codeSamples:
@@ -14719,7 +14662,7 @@ paths:
secretKey: 'sk_xxx',
})
- const store = await client.store.get()
+ const stockLocation = await client.stockLocations.get('sloc_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -14732,55 +14675,68 @@ paths:
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: current store
+ description: stock location found
content:
application/json:
example:
- id: store_UkLWZg9DAJ
- metadata: {}
- name: Spree Test Store
- default_currency: USD
- default_locale: en
- mail_from_address: [email protected]
- customer_support_email: [email protected]
- new_order_notifications_email: [email protected]
- preferred_send_consumer_transactional_emails: true
- preferred_admin_locale:
- preferred_timezone: UTC
- preferred_weight_unit: lb
- preferred_unit_system: imperial
- created_at: '2026-06-05T13:11:36.359Z'
- updated_at: '2026-06-05T13:13:08.602Z'
- url: http://www.example.com:3000
- supported_currencies:
- - USD
- supported_locales:
- - en
- logo_url:
- mailer_logo_url:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_51
+ name: Brooklyn warehouse
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_51
+ admin_name:
+ address2:
+ state_name:
+ phone: "(202) 456-1111"
+ company:
+ active: true
+ default: false
+ backorderable_default: true
+ propagate_all_variants: false
+ kind: warehouse
+ pickup_enabled: false
+ pickup_stock_policy: local
+ pickup_ready_in_minutes:
+ pickup_instructions:
+ created_at: '2026-06-08T10:58:01.761Z'
+ updated_at: '2026-06-08T10:58:01.761Z'
schema:
- "$ref": "#/components/schemas/Store"
- '401':
- description: unauthorized
+ "$ref": "#/components/schemas/StockLocation"
+ '404':
+ description: stock location not found
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: record_not_found
+ message: Stock location not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
patch:
- summary: Update the current store
+ summary: Update a stock location
tags:
- - Configuration
+ - Stock Locations
security:
- api_key: []
bearer_auth: []
description: |-
- Updates the current store configuration.
+ Updates an existing stock location. Same address-field conventions as
+ the create endpoint.
+
+ Setting `default: true` automatically demotes the previous default.
+
**Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
@@ -14794,8 +14750,10 @@ paths:
secretKey: 'sk_xxx',
})
- const store = await client.store.update({
- name: 'My Store'
+ const stockLocation = await client.stockLocations.update('sloc_UkLWZg9DAJ', {
+ pickup_enabled: true,
+ pickup_ready_in_minutes: 45,
+ pickup_instructions: 'Enter through the back door, ring the bell.',
})
parameters:
- name: x-spree-api-key
@@ -14811,34 +14769,37 @@ paths:
type: string
responses:
'200':
- description: store updated
+ description: stock location updated
content:
application/json:
example:
- id: store_UkLWZg9DAJ
- metadata: {}
- name: Renamed Store
- default_currency: USD
- default_locale: en
- mail_from_address: [email protected]
- customer_support_email: [email protected]
- new_order_notifications_email: [email protected]
- preferred_send_consumer_transactional_emails: true
- preferred_admin_locale:
- preferred_timezone: UTC
- preferred_weight_unit: lb
- preferred_unit_system: imperial
- created_at: '2026-06-05T13:11:36.359Z'
- updated_at: '2026-06-05T13:13:09.214Z'
- url: http://www.example.com:3000
- supported_currencies:
- - USD
- supported_locales:
- - en
- logo_url:
- mailer_logo_url:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_53
+ name: Renamed warehouse
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_53
+ admin_name:
+ address2:
+ state_name:
+ phone: "(202) 456-1111"
+ company:
+ active: true
+ default: false
+ backorderable_default: true
+ propagate_all_variants: false
+ kind: warehouse
+ pickup_enabled: true
+ pickup_stock_policy: local
+ pickup_ready_in_minutes: 45
+ pickup_instructions:
+ created_at: '2026-06-08T10:58:02.382Z'
+ updated_at: '2026-06-08T10:58:02.663Z'
schema:
- "$ref": "#/components/schemas/Store"
+ "$ref": "#/components/schemas/StockLocation"
'422':
description: validation error
content:
@@ -14846,10 +14807,10 @@ paths:
example:
error:
code: validation_error
- message: Site Name can't be blank
+ message: Pickup stock policy is not included in the list
details:
- name:
- - can't be blank
+ pickup_stock_policy:
+ - is not included in the list
schema:
"$ref": "#/components/schemas/ErrorResponse"
requestBody:
@@ -14860,29 +14821,78 @@ paths:
properties:
name:
type: string
- example: My Store
- preferred_admin_locale:
+ admin_name:
type: string
- example: en
- preferred_timezone:
+ nullable: true
+ active:
+ type: boolean
+ default:
+ type: boolean
+ kind:
type: string
- example: UTC
- preferred_weight_unit:
+ enum:
+ - warehouse
+ - store
+ - fulfillment_center
+ propagate_all_variants:
+ type: boolean
+ backorderable_default:
+ type: boolean
+ address1:
type: string
- example: kg
- preferred_unit_system:
+ nullable: true
+ address2:
type: string
- example: metric
- "/api/v3/admin/tags":
- get:
- summary: List tags
+ nullable: true
+ city:
+ type: string
+ nullable: true
+ zipcode:
+ type: string
+ nullable: true
+ phone:
+ type: string
+ nullable: true
+ company:
+ type: string
+ nullable: true
+ country_iso:
+ type: string
+ nullable: true
+ state_abbr:
+ type: string
+ nullable: true
+ state_name:
+ type: string
+ nullable: true
+ pickup_enabled:
+ type: boolean
+ pickup_stock_policy:
+ type: string
+ enum:
+ - local
+ - any
+ pickup_ready_in_minutes:
+ type: number
+ nullable: true
+ minimum: 0
+ pickup_instructions:
+ type: string
+ nullable: true
+ delete:
+ summary: Delete a stock location
tags:
- - Configuration
+ - Stock Locations
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.
+ description: |-
+ Soft-deletes the stock location (sets `deleted_at`). Existing
+ fulfillments that referenced it keep the historical record via
+ `Spree::StockLocation.with_deleted`.
+
+
+ **Required scope:** `write_settings` (for API-key authentication).
x-codeSamples:
- lang: javascript
label: Spree Admin SDK
@@ -14894,10 +14904,7 @@ paths:
secretKey: 'sk_xxx',
})
- const { data: tags } = await client.tags.list({
- taggable_type: 'Spree::User',
- q: 'vip',
- })
+ await client.stockLocations.delete('sloc_UkLWZg9DAJ')
parameters:
- name: x-spree-api-key
in: header
@@ -14907,43 +14914,17 @@ paths:
- name: Authorization
in: header
required: true
- schema:
- type: string
- - name: taggable_type
- in: query
- required: true
- description: Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)
- schema:
- type: string
- - name: q
- in: query
- required: false
- description: Optional case-insensitive substring filter
+ description: Bearer token for admin authentication
schema:
type: string
responses:
- '200':
- description: tags found
- content:
- application/json:
- example:
- data:
- - name: vip
- - name: wholesale
- '422':
- description: invalid taggable type
- content:
- application/json:
- example:
- error:
- code: invalid_taggable_type
- message: taggable_type must be one of Spree::Product, Spree::Order,
- Spree::LegacyUser
+ '204':
+ description: stock location deleted
"/api/v3/admin/products/{product_id}/variants":
get:
summary: List product variants
tags:
- - Product Catalog
+ - Variants
security:
- api_key: []
bearer_auth: []
@@ -15050,13 +15031,13 @@ paths:
weight_unit: lb
dimensions_unit:
deleted_at:
- created_at: '2026-06-05T13:13:10.660Z'
- updated_at: '2026-06-05T13:13:10.670Z'
+ created_at: '2026-06-08T10:58:06.223Z'
+ updated_at: '2026-06-08T10:58:06.232Z'
tax_category_id: taxcat_UkLWZg9DAJ
available_stock: 0
reserved_quantity: 0
total_on_hand: 0
- product_name: Product 791516
+ product_name: Product 791409
- id: variant_gbHJdmfrXB
product_id: prod_UkLWZg9DAJ
sku: SKU-98
@@ -15067,10 +15048,10 @@ paths:
purchasable: true
in_stock: false
backorderable: true
- weight: 126.85
- height: 146.34
- width: 142.5
- depth: 131.31
+ weight: 92.25
+ height: 22.97
+ width: 108.5
+ depth: 180.4
price:
id: price_gbHJdmfrXB
amount: '19.99'
@@ -15093,8 +15074,8 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:13:10.695Z'
- updated_at: '2026-06-05T13:13:10.695Z'
+ created_at: '2026-06-08T10:58:06.245Z'
+ updated_at: '2026-06-08T10:58:06.245Z'
metadata: {}
position: 2
cost_price: '17.0'
@@ -15103,13 +15084,13 @@ paths:
weight_unit: lb
dimensions_unit:
deleted_at:
- created_at: '2026-06-05T13:13:10.692Z'
- updated_at: '2026-06-05T13:13:10.708Z'
+ created_at: '2026-06-08T10:58:06.242Z'
+ updated_at: '2026-06-08T10:58:06.252Z'
tax_category_id: taxcat_UkLWZg9DAJ
available_stock: 0
reserved_quantity: 0
total_on_hand: 0
- product_name: Product 791516
+ product_name: Product 791409
meta:
page: 1
limit: 25
@@ -15123,7 +15104,7 @@ paths:
post:
summary: Create a variant
tags:
- - Product Catalog
+ - Variants
security:
- api_key: []
bearer_auth: []
@@ -15220,8 +15201,8 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:13:11.398Z'
- updated_at: '2026-06-05T13:13:11.398Z'
+ created_at: '2026-06-08T10:58:06.920Z'
+ updated_at: '2026-06-08T10:58:06.920Z'
metadata: {}
position: 3
cost_price:
@@ -15230,13 +15211,13 @@ paths:
weight_unit: lb
dimensions_unit:
deleted_at:
- created_at: '2026-06-05T13:13:11.402Z'
- updated_at: '2026-06-05T13:13:11.404Z'
+ created_at: '2026-06-08T10:58:06.924Z'
+ updated_at: '2026-06-08T10:58:06.925Z'
tax_category_id: taxcat_UkLWZg9DAJ
available_stock: 0
reserved_quantity: 0
total_on_hand: 0
- product_name: Product 806635
+ product_name: Product 802281
'422':
description: validation error
content:
@@ -15347,7 +15328,7 @@ paths:
get:
summary: Get a variant
tags:
- - Product Catalog
+ - Variants
security:
- api_key: []
bearer_auth: []
@@ -15423,10 +15404,10 @@ paths:
purchasable: true
in_stock: false
backorderable: true
- weight: 93.41
- height: 11.74
- width: 180.52
- depth: 114.88
+ weight: 188.6
+ height: 96.46
+ width: 19.96
+ depth: 26.58
price:
id: price_gbHJdmfrXB
amount: '19.99'
@@ -15449,8 +15430,8 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:13:11.790Z'
- updated_at: '2026-06-05T13:13:11.790Z'
+ created_at: '2026-06-08T10:58:07.349Z'
+ updated_at: '2026-06-08T10:58:07.349Z'
metadata: {}
position: 2
cost_price: '17.0'
@@ -15459,13 +15440,13 @@ paths:
weight_unit: lb
dimensions_unit:
deleted_at:
- created_at: '2026-06-05T13:13:11.788Z'
- updated_at: '2026-06-05T13:13:11.797Z'
+ created_at: '2026-06-08T10:58:07.347Z'
+ updated_at: '2026-06-08T10:58:07.368Z'
tax_category_id: taxcat_UkLWZg9DAJ
available_stock: 0
reserved_quantity: 0
total_on_hand: 0
- product_name: Product 826512
+ product_name: Product 826595
'404':
description: variant not found
content:
@@ -15479,7 +15460,7 @@ paths:
patch:
summary: Update a variant
tags:
- - Product Catalog
+ - Variants
security:
- api_key: []
bearer_auth: []
@@ -15544,10 +15525,10 @@ paths:
purchasable: true
in_stock: false
backorderable: true
- weight: 198.83
- height: 53.66
- width: 153.45
- depth: 63.96
+ weight: 10.18
+ height: 91.91
+ width: 190.0
+ depth: 145.3
price:
id: price_gbHJdmfrXB
amount: '19.99'
@@ -15570,8 +15551,8 @@ paths:
option_type_label: Size
image_url:
metadata: {}
- created_at: '2026-06-05T13:13:12.465Z'
- updated_at: '2026-06-05T13:13:12.465Z'
+ created_at: '2026-06-08T10:58:08.060Z'
+ updated_at: '2026-06-08T10:58:08.060Z'
metadata: {}
position: 2
cost_price: '17.0'
@@ -15580,13 +15561,13 @@ paths:
weight_unit: lb
dimensions_unit:
deleted_at:
- created_at: '2026-06-05T13:13:12.462Z'
- updated_at: '2026-06-05T13:13:12.750Z'
+ created_at: '2026-06-08T10:58:08.058Z'
+ updated_at: '2026-06-08T10:58:08.365Z'
tax_category_id: taxcat_UkLWZg9DAJ
available_stock: 0
reserved_quantity: 0
total_on_hand: 0
- product_name: Product 842857
+ product_name: Product 843476
requestBody:
content:
application/json:
@@ -15673,7 +15654,7 @@ paths:
delete:
summary: Delete a variant
tags:
- - Product Catalog
+ - Variants
security:
- api_key: []
bearer_auth: []
@@ -15731,7 +15712,7 @@ paths:
get:
summary: List webhook deliveries
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -15824,9 +15805,9 @@ paths:
event: order.created
data:
id: 1
- created_at: '2026-06-05T13:13:13.136Z'
- updated_at: '2026-06-05T13:13:13.136Z'
- delivered_at: '2026-06-05T13:13:13.136Z'
+ created_at: '2026-06-08T10:58:08.780Z'
+ updated_at: '2026-06-08T10:58:08.780Z'
+ delivered_at: '2026-06-08T10:58:08.780Z'
webhook_endpoint_id: whe_UkLWZg9DAJ
webhook_endpoint_url: https://shop.example.com/webhooks
- id: whd_UkLWZg9DAJ
@@ -15842,9 +15823,9 @@ paths:
event: order.created
data:
id: 1
- created_at: '2026-06-05T13:13:13.135Z'
- updated_at: '2026-06-05T13:13:13.135Z'
- delivered_at: '2026-06-05T13:13:13.135Z'
+ created_at: '2026-06-08T10:58:08.779Z'
+ updated_at: '2026-06-08T10:58:08.779Z'
+ delivered_at: '2026-06-08T10:58:08.779Z'
webhook_endpoint_id: whe_UkLWZg9DAJ
webhook_endpoint_url: https://shop.example.com/webhooks
meta:
@@ -15884,7 +15865,7 @@ paths:
get:
summary: Get a webhook delivery
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -15944,9 +15925,9 @@ paths:
event: order.created
data:
id: 1
- created_at: '2026-06-05T13:13:13.753Z'
- updated_at: '2026-06-05T13:13:13.753Z'
- delivered_at: '2026-06-05T13:13:13.753Z'
+ created_at: '2026-06-08T10:58:09.417Z'
+ updated_at: '2026-06-08T10:58:09.417Z'
+ delivered_at: '2026-06-08T10:58:09.417Z'
webhook_endpoint_id: whe_UkLWZg9DAJ
webhook_endpoint_url: https://shop.example.com/webhooks
'404':
@@ -15976,7 +15957,7 @@ paths:
post:
summary: Redeliver a webhook delivery
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16031,8 +16012,8 @@ paths:
event: order.created
data:
id: 1
- created_at: '2026-06-05T13:13:14.655Z'
- updated_at: '2026-06-05T13:13:14.655Z'
+ created_at: '2026-06-08T10:58:10.346Z'
+ updated_at: '2026-06-08T10:58:10.346Z'
delivered_at:
webhook_endpoint_id: whe_UkLWZg9DAJ
webhook_endpoint_url: https://shop.example.com/webhooks
@@ -16040,7 +16021,7 @@ paths:
get:
summary: List webhook endpoints
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16128,8 +16109,8 @@ paths:
- order.completed
- product.created
disabled_reason:
- created_at: '2026-06-05T13:13:14.683Z'
- updated_at: '2026-06-05T13:13:14.683Z'
+ created_at: '2026-06-08T10:58:10.400Z'
+ updated_at: '2026-06-08T10:58:10.400Z'
disabled_at:
secret_key:
last_delivery_at:
@@ -16161,7 +16142,7 @@ paths:
post:
summary: Create a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16221,10 +16202,10 @@ paths:
subscriptions:
- order.completed
disabled_reason:
- created_at: '2026-06-05T13:13:15.322Z'
- updated_at: '2026-06-05T13:13:15.322Z'
+ created_at: '2026-06-08T10:58:11.114Z'
+ updated_at: '2026-06-08T10:58:11.114Z'
disabled_at:
- secret_key: 81a1cd93ff52f5e579fa149c0621ca1f15817eead13ebdd8f807f5a71ec43353
+ secret_key: 5ad2424be15f9d7e024dd5e7fcd8d36ed1845791aa2dcaa51b58498eca77c37c
last_delivery_at:
recent_delivery_count: 0
recent_failure_count: 0
@@ -16291,7 +16272,7 @@ paths:
get:
summary: Get a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16344,8 +16325,8 @@ paths:
- order.completed
- product.created
disabled_reason:
- created_at: '2026-06-05T13:13:15.645Z'
- updated_at: '2026-06-05T13:13:15.645Z'
+ created_at: '2026-06-08T10:58:11.626Z'
+ updated_at: '2026-06-08T10:58:11.626Z'
disabled_at:
secret_key:
last_delivery_at:
@@ -16367,7 +16348,7 @@ paths:
patch:
summary: Update a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16420,8 +16401,8 @@ paths:
- order.completed
- product.created
disabled_reason:
- created_at: '2026-06-05T13:13:16.252Z'
- updated_at: '2026-06-05T13:13:16.530Z'
+ created_at: '2026-06-08T10:58:12.303Z'
+ updated_at: '2026-06-08T10:58:12.587Z'
disabled_at:
secret_key:
last_delivery_at:
@@ -16474,7 +16455,7 @@ paths:
delete:
summary: Delete a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16520,7 +16501,7 @@ paths:
post:
summary: Send a test delivery
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16573,15 +16554,15 @@ paths:
response_body:
success:
payload:
- id: 9ac8d08d-e321-4228-98c1-5e4bd30d7e16
+ id: a948973d-8e57-4e1e-86bc-c8cdeb435e70
name: webhook.test
- created_at: '2026-06-05T13:13:17Z'
+ created_at: '2026-06-08T10:58:13Z'
data:
message: This is a test webhook from Spree.
metadata:
spree_version: 5.5.0.beta
- created_at: '2026-06-05T13:13:17.450Z'
- updated_at: '2026-06-05T13:13:17.450Z'
+ created_at: '2026-06-08T10:58:13.620Z'
+ updated_at: '2026-06-08T10:58:13.620Z'
delivered_at:
webhook_endpoint_id: whe_UkLWZg9DAJ
webhook_endpoint_url: https://shop.example.com/webhooks/orders
@@ -16596,7 +16577,7 @@ paths:
patch:
summary: Re-enable a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16644,8 +16625,8 @@ paths:
- order.completed
- product.created
disabled_reason:
- created_at: '2026-06-05T13:13:17.480Z'
- updated_at: '2026-06-05T13:13:17.770Z'
+ created_at: '2026-06-08T10:58:13.678Z'
+ updated_at: '2026-06-08T10:58:13.960Z'
disabled_at:
secret_key:
last_delivery_at:
@@ -16665,7 +16646,7 @@ paths:
patch:
summary: Disable a webhook endpoint
tags:
- - Configuration
+ - Webhooks
security:
- api_key: []
bearer_auth: []
@@ -16718,9 +16699,9 @@ paths:
- order.completed
- product.created
disabled_reason: Investigating
- created_at: '2026-06-05T13:13:17.803Z'
- updated_at: '2026-06-05T13:13:18.094Z'
- disabled_at: '2026-06-05T13:13:18.094Z'
+ created_at: '2026-06-08T10:58:14.003Z'
+ updated_at: '2026-06-08T10:58:14.290Z'
+ disabled_at: '2026-06-08T10:58:14.290Z'
secret_key:
last_delivery_at:
recent_delivery_count: 0
@@ -16744,32 +16725,101 @@ servers:
default: localhost:3000
tags:
- name: Authentication
- description: Admin user authentication
-- name: Product Catalog
- description: Products, variants, and option types
-- name: Orders
- description: Order management — orders, items, payments, fulfillments, refunds,
- gift cards, store credits
+ description: Admin user login, logout, token refresh, and current user profile
+- name: Allowed Origins
+ description: CORS allowlist for storefront and admin client origins
+- name: API Keys
+ description: Secret and publishable API keys
+- name: Channels
+ description: Sales channels and product publication across channels
+- name: Custom Fields
+ description: Custom field definitions for products, variants, customers, and other
+ resources
+- name: Customer Groups
+ description: Customer groups for segmenting customers (e.g. wholesale, VIP) used
+ by pricing and promotions
- name: Customers
- description: Customer management — profiles, addresses, store credits, credit cards
-- name: Configuration
- description: Store configuration — payment methods, tag autocomplete
+ description: Customer profiles, addresses, credit cards, and store credits
+- name: Exports
+ description: Async CSV exports of admin resources
+- name: Fulfillments
+ description: Order fulfillments — shipments, fulfill, cancel, resume, split
+- name: Gift Cards
+ description: Gift cards and gift card batches
+- name: Markets
+ description: Markets — geographic groupings of countries used for pricing, tax,
+ and fulfillment rules
+- name: Option Types
+ description: Option types and option values used to build product variants (e.g.
+ Size, Color)
+- name: Orders
+ description: Orders, order items, applied gift cards, and applied store credits
+- name: Payment Methods
+ description: Configured payment providers and their available types
+- name: Payments
+ description: Order payments — list, capture, void
+- name: Pricing
+ description: Prices and price lists for currency-, market-, and customer-group-specific
+ pricing
+- name: Products
+ description: Products, taxons/categories, product custom field values, and bulk
+ product operations
+- name: Promotions
+ description: Promotions, promotion rules, promotion actions, and coupon codes
+- name: Refunds
+ description: Order refunds
+- name: Settings
+ description: Store-level settings — store profile, tags, store credit categories
+- name: Staff
+ description: Admin users, roles, and invitations to the store
+- name: Stock Locations
+ description: Warehouses and physical fulfillment locations
+- name: Variants
+ description: Product variants — the individual SKUs (size/color combinations) sold
+ under a product
+- name: Webhooks
+ description: Webhook endpoints and webhook delivery history
x-tagGroups:
- name: Authentication
tags:
- Authentication
-- name: Product Catalog
+- name: Products & Catalog
tags:
- - Product Catalog
-- name: Orders
+ - Products
+ - Variants
+ - Option Types
+ - Custom Fields
+ - Channels
+- name: Pricing
+ tags:
+ - Pricing
+ - Markets
+- name: Orders & Fulfillment
tags:
- Orders
+ - Payments
+ - Fulfillments
+ - Refunds
- name: Customers
tags:
- Customers
+ - Customer Groups
+- name: Promotions & Gift Cards
+ tags:
+ - Promotions
+ - Gift Cards
+- name: Data
+ tags:
+ - Exports
- name: Configuration
tags:
- - Configuration
+ - Settings
+ - Stock Locations
+ - Payment Methods
+ - Staff
+ - API Keys
+ - Allowed Origins
+ - Webhooks
components:
securitySchemes:
api_key:
diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yaml
index aabae41f93..32a419c7e5 100644
--- a/docs/api-reference/store.yaml
+++ b/docs/api-reference/store.yaml
@@ -40,15 +40,26 @@ info:
```
version: v3
paths:
- "/api/v3/store/customers/me/addresses":
- get:
- summary: List customer addresses
+ "/api/v3/store/auth/login":
+ post:
+ summary: Login
tags:
- - Customers
+ - Authentication
security:
- api_key: []
- bearer_auth: []
- description: Returns all addresses in the customer address book
+ description: |
+ Authenticates a customer and returns a JWT access token + refresh token.
+
+ Dispatches by the `provider` field to a strategy registered in
+ `Spree.store_authentication_strategies`. When `provider` is omitted it
+ defaults to `email`, which uses the built-in email/password strategy.
+
+ To plug in a third-party identity provider (Auth0, Okta, Firebase, a
+ custom JWT issuer, SAML, etc.), register a `Spree::Authentication::Strategies::BaseStrategy`
+ subclass under a provider key, then send `{ "provider": "<your_key>", ... }`
+ with the fields your strategy requires. The endpoint returns the same
+ Spree-issued JWT + refresh token regardless of which strategy authenticated
+ the request.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -60,8 +71,9 @@ paths:
publishableKey: '<api-key>',
})
- const addresses = await client.customer.addresses.list({}, {
- token: '<token>',
+ const auth = await client.auth.login({
+ email: '[email protected]',
+ password: 'password123',
})
parameters:
- name: x-spree-api-key
@@ -69,126 +81,91 @@ paths:
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
- schema:
- type: string
responses:
'200':
- description: addresses found
+ description: login successful
content:
application/json:
example:
- data:
- - id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 72 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- - id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 71 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: true
- is_default_shipping: false
- state_name: New York
- - id: addr_UkLWZg9DAJ
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 70 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: true
- state_name: New York
- meta:
- page: 1
- limit: 25
- count: 3
- pages: 1
- from: 1
- to: 3
- in: 3
- previous:
- next:
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjY0NjcwM2Q0LWY5ZjAtNDlmMi05ZmZkLTA3YTZhY2I5YWZkZiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjE1fQ.jlz2KHxYkB1Dd9ucl26zy6E5M7dFB5q9g-Qw0YjsX50
+ refresh_token: MQ9QZ1ToR8QocZoDd4ggC8yN
+ user:
+ id: cus_UkLWZg9DAJ
+ first_name: Colette
+ last_name: Hegmann
+ phone:
+ accepts_email_marketing: false
+ full_name: Colette Hegmann
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses: []
+ default_billing_address:
+ default_shipping_address:
schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Address"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
+ "$ref": "#/components/schemas/AuthResponse"
'401':
- description: unauthorized
+ description: missing API key
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: invalid_token
+ message: Valid API key required
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
+ example: password123
+ required:
+ - email
+ - password
+ - title: ProviderLogin
+ description: |
+ Provider-dispatched login. The `provider` key selects a registered
+ strategy class; the remaining fields are forwarded to the strategy's
+ `authenticate` method. Required fields depend on the registered strategy
+ — consult its documentation.
+ type: object
+ properties:
+ provider:
+ type: string
+ example: auth0
+ description: Registered provider key (anything other than `email`).
+ not:
+ enum:
+ - email
+ required:
+ - provider
+ additionalProperties: true
+ "/api/v3/store/auth/refresh":
post:
- summary: Create an address
+ summary: Refresh token
tags:
- - Customers
+ - Authentication
security:
- api_key: []
- bearer_auth: []
- description: Adds a new address to the customer address book
+ description: Exchanges a refresh token for a new access JWT and rotated refresh
+ token. No Authorization header needed.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -200,17 +177,8 @@ paths:
publishableKey: '<api-key>',
})
- const address = await client.customer.addresses.create({
- first_name: 'John',
- last_name: 'Doe',
- address1: '123 Main St',
- city: 'New York',
- postal_code: '10001',
- country_iso: 'US',
- state_abbr: 'NY',
- phone: '+1 555 123 4567',
- }, {
- token: '<token>',
+ const auth = await client.auth.refresh({
+ refresh_token: 'rt_xxx',
})
parameters:
- name: x-spree-api-key
@@ -218,60 +186,37 @@ paths:
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
responses:
- '201':
- description: address created
+ '200':
+ description: token refreshed
content:
application/json:
example:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 123 Main St
- address2:
- postal_code: '10001'
- city: New York
- phone: "+1 555 123 4567"
- company:
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjNmZjU3NWU0LTVmNmItNDVjOC04MzIzLTIzMDMyMzVjZTkzMiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjE2fQ.OuCk-UNe-asA8DvK2yKMkp94BQz9PN_Z7_SnReeIRYE
+ refresh_token: qLuZDRo8LqywXFThqPM5V2Ug
+ user:
+ id: cus_UkLWZg9DAJ
+ first_name: Debi
+ last_name: Tillman
+ phone:
+ accepts_email_marketing: false
+ full_name: Debi Tillman
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses: []
+ default_billing_address:
+ default_shipping_address:
schema:
- "$ref": "#/components/schemas/Address"
- '422':
- description: validation error
+ "$ref": "#/components/schemas/AuthResponse"
+ '401':
+ description: missing or invalid refresh token
content:
application/json:
example:
error:
- code: validation_error
- message: First Name can't be blank, Last Name can't be blank, Address
- can't be blank, City can't be blank, Country can't be blank, and
- Zip Code can't be blank
- details:
- firstname:
- - can't be blank
- lastname:
- - can't be blank
- address1:
- - can't be blank
- city:
- - can't be blank
- country:
- - can't be blank
- zipcode:
- - can't be blank
+ code: invalid_refresh_token
+ message: Invalid or expired refresh token
schema:
"$ref": "#/components/schemas/ErrorResponse"
requestBody:
@@ -280,66 +225,21 @@ paths:
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_iso:
- type: string
- example: US
- description: ISO 3166-1 alpha-2 country code (e.g., "US", "DE")
- state_abbr:
- type: string
- example: NY
- description: ISO 3166-2 subdivision code without country prefix
- (e.g., "CA", "NY")
- state_name:
+ refresh_token:
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
+ description: Refresh token from login response
required:
- - first_name
- - last_name
- - address1
- - city
- - postal_code
- - country_iso
- "/api/v3/store/customers/me/addresses/{id}":
- get:
- summary: Get an address
+ - refresh_token
+ "/api/v3/store/auth/logout":
+ post:
+ summary: Logout
tags:
- - Customers
+ - Authentication
security:
- api_key: []
- bearer_auth: []
+ description: Revokes the submitted refresh token. The refresh token itself is
+ the credential — no Authorization header is required, so a client with an
+ expired access JWT can still log out.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -351,8 +251,8 @@ paths:
publishableKey: '<api-key>',
})
- const address = await client.customer.addresses.get('addr_abc123', {
- token: '<token>',
+ await client.auth.logout({
+ refresh_token: 'rt_xxx',
})
parameters:
- name: x-spree-api-key
@@ -360,66 +260,99 @@ paths:
required: true
schema:
type: string
- - name: Authorization
+ responses:
+ '204':
+ description: logout without refresh token (no-op)
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ refresh_token:
+ type: string
+ description: Refresh token to revoke
+ "/api/v3/store/password_resets":
+ post:
+ summary: Request a password reset
+ tags:
+ - Authentication
+ security:
+ - api_key: []
+ description: Sends a password reset email if an account exists for the given
+ email address. Always returns 202 Accepted to prevent email enumeration.
+ 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.passwordResets.create({
+ email: '[email protected]',
+ redirect_url: 'https://myshop.com/reset-password',
+ })
+ parameters:
+ - name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: id
- in: path
- required: true
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
- schema:
- type: string
responses:
- '200':
- description: address found
+ '202':
+ description: email not found (same response to prevent enumeration)
content:
application/json:
example:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 84 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
+ message: If an account exists for that email, password reset instructions
+ have been sent.
schema:
- "$ref": "#/components/schemas/Address"
- '404':
- description: address not found
+ type: object
+ properties:
+ message:
+ type: string
+ '401':
+ description: missing API key
content:
application/json:
example:
error:
- code: record_not_found
- message: Address not found
+ code: invalid_token
+ message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ format: email
+ 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:
+ - email
+ "/api/v3/store/password_resets/{token}":
patch:
- summary: Update an address
+ summary: Reset password with token
tags:
- - Customers
+ - Authentication
security:
- api_key: []
- bearer_auth: []
+ description: Resets the password using a token received via email. Returns a
+ JWT token on success (auto-login).
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -431,86 +364,95 @@ paths:
publishableKey: '<api-key>',
})
- const address = await client.customer.addresses.update('addr_abc123', {
- city: 'Los Angeles',
- }, {
- token: '<token>',
- })
+ const auth = await client.passwordResets.update(
+ 'reset-token-from-email',
+ {
+ password: 'newsecurepassword',
+ password_confirmation: 'newsecurepassword',
+ }
+ )
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: id
+ - name: token
in: path
required: true
+ description: Password reset token from the email
schema:
type: string
responses:
'200':
- description: address updated
+ description: password reset successful
content:
application/json:
example:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 90 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: Los Angeles
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- schema:
- "$ref": "#/components/schemas/Address"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- first_name:
- type: string
- example: John
- last_name:
- type: string
- example: Doe
- address1:
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjU1YjA5Yzc4LTUzMTYtNDRjYy05ZjJiLThmN2E2MzViMmRlNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjI4fQ.FX2Te4WfdAu3kN_fvvfHsH92_axvIZTI1d8Zmw8R1mE
+ refresh_token: Be2HUCjiJVRjgidFuYU7GRRh
+ user:
+ id: cus_UkLWZg9DAJ
+ first_name: Randa
+ last_name: O'Hara
+ phone:
+ accepts_email_marketing: false
+ full_name: Randa O'Hara
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses: []
+ default_billing_address:
+ default_shipping_address:
+ schema:
+ "$ref": "#/components/schemas/AuthResponse"
+ '422':
+ description: password confirmation mismatch
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Password confirmation doesn't match Password
+ details:
+ password_confirmation:
+ - doesn't match Password
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ '401':
+ description: missing API key
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ password:
type: string
- example: 456 Oak Ave
- city:
+ minLength: 6
+ example: newsecurepassword
+ password_confirmation:
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
- delete:
- summary: Delete an address
+ example: newsecurepassword
+ required:
+ - password
+ - password_confirmation
+ "/api/v3/store/categories":
+ get:
+ summary: List categories
tags:
- - Customers
+ - Product Catalog
security:
- api_key: []
- bearer_auth: []
+ description: Returns a paginated list of categories for the current store
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -522,8 +464,9 @@ paths:
publishableKey: '<api-key>',
})
- await client.customer.addresses.delete('addr_abc123', {
- token: '<token>',
+ const categories = await client.categories.list({
+ page: 1,
+ limit: 25,
})
parameters:
- name: x-spree-api-key
@@ -531,49 +474,124 @@ paths:
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ description: Filter by name
schema:
type: string
- - name: id
- in: path
- required: true
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
- '204':
- description: address deleted
- '404':
- description: address not found
+ '200':
+ description: categories found
+ content:
+ application/json:
+ example:
+ data:
+ - id: ctg_UkLWZg9DAJ
+ name: taxonomy_3
+ permalink: taxonomy-3
+ position: 0
+ depth: 0
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 1
+ parent_id:
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: true
+ is_child: false
+ is_leaf: false
+ - id: ctg_gbHJdmfrXB
+ name: taxon_3
+ permalink: taxonomy-3/taxon-3
+ position: 0
+ depth: 1
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 1
+ parent_id: ctg_UkLWZg9DAJ
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: false
+ - id: ctg_EfhxLZ9ck8
+ name: taxon_4
+ permalink: taxonomy-3/taxon-3/taxon-4
+ position: 0
+ depth: 2
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ parent_id: ctg_gbHJdmfrXB
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: true
+ meta:
+ page: 1
+ limit: 25
+ count: 3
+ pages: 1
+ from: 1
+ to: 3
+ in: 3
+ previous:
+ next:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Category"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized
content:
application/json:
example:
error:
- code: record_not_found
- message: Address not found
+ code: invalid_token
+ message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/auth/login":
- post:
- summary: Login
+ "/api/v3/store/categories/{id}":
+ get:
+ summary: Get a category
tags:
- - Authentication
+ - Product Catalog
security:
- api_key: []
- description: |
- Authenticates a customer and returns a JWT access token + refresh token.
-
- Dispatches by the `provider` field to a strategy registered in
- `Spree.store_authentication_strategies`. When `provider` is omitted it
- defaults to `email`, which uses the built-in email/password strategy.
-
- To plug in a third-party identity provider (Auth0, Okta, Firebase, a
- custom JWT issuer, SAML, etc.), register a `Spree::Authentication::Strategies::BaseStrategy`
- subclass under a provider key, then send `{ "provider": "<your_key>", ... }`
- with the fields your strategy requires. The endpoint returns the same
- Spree-issued JWT + refresh token regardless of which strategy authenticated
- the request.
+ description: Returns a single category by permalink or prefix ID
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -585,9 +603,8 @@ paths:
publishableKey: '<api-key>',
})
- const auth = await client.auth.login({
- email: '[email protected]',
- password: 'password123',
+ const category = await client.categories.get('categories/clothing/shirts', {
+ expand: ['children'],
})
parameters:
- name: x-spree-api-key
@@ -595,206 +612,79 @@ paths:
required: true
schema:
type: string
+ - name: id
+ in: path
+ required: true
+ description: Category permalink (e.g., clothing/shirts) or prefix ID (e.g.,
+ ctg_abc123)
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Expand associations (children, parent, ancestors, custom_fields)
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
responses:
'200':
- description: login successful
+ description: category found by prefix ID
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjY0NjcwM2Q0LWY5ZjAtNDlmMi05ZmZkLTA3YTZhY2I5YWZkZiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjE1fQ.jlz2KHxYkB1Dd9ucl26zy6E5M7dFB5q9g-Qw0YjsX50
- refresh_token: MQ9QZ1ToR8QocZoDd4ggC8yN
- user:
- id: cus_UkLWZg9DAJ
- first_name: Colette
- last_name: Hegmann
- phone:
- accepts_email_marketing: false
- full_name: Colette Hegmann
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses: []
- default_billing_address:
- default_shipping_address:
+ id: ctg_gbHJdmfrXB
+ name: taxon_12
+ permalink: taxonomy-9/taxon-12
+ position: 0
+ depth: 1
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 1
+ parent_id: ctg_UkLWZg9DAJ
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: false
schema:
- "$ref": "#/components/schemas/AuthResponse"
- '401':
- description: missing API key
+ "$ref": "#/components/schemas/Category"
+ '404':
+ description: category from other store not accessible
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: record_not_found
+ message: Category not found
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
- example: password123
- required:
- - email
- - password
- - title: ProviderLogin
- description: |
- Provider-dispatched login. The `provider` key selects a registered
- strategy class; the remaining fields are forwarded to the strategy's
- `authenticate` method. Required fields depend on the registered strategy
- — consult its documentation.
- type: object
- properties:
- provider:
- type: string
- example: auth0
- description: Registered provider key (anything other than `email`).
- not:
- enum:
- - email
- required:
- - provider
- additionalProperties: true
- "/api/v3/store/auth/refresh":
- post:
- summary: Refresh token
- tags:
- - Authentication
- security:
- - api_key: []
- description: Exchanges a refresh token for a new access JWT and rotated refresh
- token. No Authorization header needed.
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const auth = await client.auth.refresh({
- refresh_token: 'rt_xxx',
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- responses:
- '200':
- description: token refreshed
- content:
- application/json:
- example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjNmZjU3NWU0LTVmNmItNDVjOC04MzIzLTIzMDMyMzVjZTkzMiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjE2fQ.OuCk-UNe-asA8DvK2yKMkp94BQz9PN_Z7_SnReeIRYE
- refresh_token: qLuZDRo8LqywXFThqPM5V2Ug
- user:
- id: cus_UkLWZg9DAJ
- first_name: Debi
- last_name: Tillman
- phone:
- accepts_email_marketing: false
- full_name: Debi Tillman
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses: []
- default_billing_address:
- default_shipping_address:
- schema:
- "$ref": "#/components/schemas/AuthResponse"
'401':
- description: missing or invalid refresh token
+ description: unauthorized
content:
application/json:
example:
error:
- code: invalid_refresh_token
- message: Invalid or expired refresh token
+ code: invalid_token
+ message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- refresh_token:
- type: string
- description: Refresh token from login response
- required:
- - refresh_token
- "/api/v3/store/auth/logout":
- post:
- summary: Logout
- tags:
- - Authentication
- security:
- - api_key: []
- description: Revokes the submitted refresh token. The refresh token itself is
- the credential — no Authorization header is required, so a client with an
- expired access JWT can still log out.
- 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.auth.logout({
- refresh_token: 'rt_xxx',
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- responses:
- '204':
- description: logout without refresh token (no-op)
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- refresh_token:
- type: string
- description: Refresh token to revoke
- "/api/v3/store/carts":
+ "/api/v3/store/products":
get:
- summary: List active carts
+ summary: List products
tags:
- - Carts
+ - Product Catalog
security:
- api_key: []
- bearer_auth: []
- description: Returns all active (incomplete) carts for the authenticated user.
+ description: Returns a paginated list of active products for the current store
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -806,18 +696,21 @@ paths:
publishableKey: '<api-key>',
})
- const carts = await client.carts.list({
- token: '<token>',
+ const products = await client.products.list({
+ page: 1,
+ limit: 25,
+ sort: 'price',
+ name_cont: 'shirt',
+ price_gte: 20,
+ price_lte: 100,
+ with_option_value_ids: ['optval_abc', 'optval_def'],
+ expand: ['variants', 'media'],
})
parameters:
- name: x-spree-api-key
in: header
required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
+ description: Publishable API key
schema:
type: string
- name: page
@@ -829,1089 +722,201 @@ paths:
- name: limit
in: query
required: false
- description: 'Number of results per page (default: 25, max: 100)'
+ description: 'Number of items per page (default: 25, max: 100)'
schema:
type: integer
- name: sort
in: query
required: false
- description: 'Sort order. Prefix with - for descending. Values: created_at,
- -created_at, updated_at, -updated_at'
+ description: 'Sort order. Prefix with - for descending. Values: price, -price,
+ best_selling, name, -name, -available_on, available_on'
schema:
type: string
- - name: q[created_at_gt]
+ - name: q[name_cont]
in: query
required: false
- description: Filter by created after date (ISO 8601)
+ description: Filter by name containing string
schema:
type: string
- - name: q[updated_at_gt]
+ - name: q[in_category]
in: query
required: false
- description: Filter by updated after date (ISO 8601)
+ description: Filter by category prefixed ID (includes descendants)
schema:
type: string
- - name: expand
+ - name: q[in_categories][]
in: query
required: false
- description: Comma-separated associations to expand (items, fulfillments,
- payments, discounts, billing_address, shipping_address, gift_card, payment_methods).
- Use "none" to skip associations.
+ description: Filter by multiple category prefixed IDs (OR logic, includes
+ descendants)
schema:
type: string
- - name: fields
+ - name: q[price_gte]
in: query
required: false
- description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
- id is always included.
+ description: Filter by minimum price
+ schema:
+ type: number
+ - name: q[price_lte]
+ in: query
+ required: false
+ description: Filter by maximum price
+ schema:
+ type: number
+ - name: q[with_option_value_ids][]
+ in: query
+ required: false
+ description: Filter by option value prefix IDs (e.g., optval_abc). Pass multiple
+ values for OR logic.
schema:
type: string
- responses:
- '200':
- description: carts listed
- content:
- application/json:
- example:
- data:
- - id: cart_gbHJdmfrXB
- market_id:
- number: R537347983
- token: yasKz5u5Uc9LkM8L2qFcbBRhWQzwP1nNUBe
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- quantity: 1
- currency: USD
- name: Product 832050
- slug: product-832050
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_gbHJdmfrXB
- number: H02359090617
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- quantity: 1
- delivery_method:
- id: dm_gbHJdmfrXB
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Blair Moore
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_gbHJdmfrXB
- delivery_method_id: dm_gbHJdmfrXB
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_gbHJdmfrXB
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_uw2YK1rnl0
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 101 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_OIJLhNcSbf
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 102 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
- - id: cart_UkLWZg9DAJ
- market_id:
- number: R807784030
- token: nXX7y8d9LZ1UXEmP8CxfE2vvLYZH9s6K9Y3
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 821901
- slug: product-821901
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H10388427867
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Blair Moore
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 99 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 100 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- post:
- summary: Create a new cart
- tags:
- - Carts
- security:
- - api_key: []
- description: |
- Creates a new shopping cart. Can be created by guests or authenticated customers.
- Returns a `token` that must be used for guest access to the cart.
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- // Create an empty cart
- const cart = await client.carts.create()
-
- // Create a cart with items
- const cartWithItems = await client.carts.create({
- items: [
- { variant_id: 'variant_abc123', quantity: 2 },
- ],
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: false
- description: Bearer JWT token (optional - for authenticated customers)
- schema:
- type: string
- - name: Idempotency-Key
- in: header
- required: false
- description: Unique key for request idempotency.
- schema:
- type: string
- responses:
- '201':
- description: cart created
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R386894669
- token: AFTUr4LVpnRaQVPntcz4FE5S8AuFqksEEGH
- email:
- customer_note:
- currency: USD
- locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: cart
- field: line_items
- message: Add at least one item to your cart
- - step: address
- field: email
- message: Email address is required
- - step: address
- field: ship_address
- message: Shipping address is required
- - step: delivery
- field: shipping_method
- message: Select a shipping method for all shipments
- shipping_eq_billing_address: true
- discounts: []
- items: []
- fulfillments: []
- payments: []
- billing_address:
- shipping_address:
- payment_methods: []
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Cart"
- requestBody:
- 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
- "/api/v3/store/carts/{id}":
- get:
- summary: Get a cart
- tags:
- - Carts
- security:
- - api_key: []
- bearer_auth: []
- description: |
- Returns a shopping cart by prefixed ID.
- Authorize via x-spree-token header (guest) or JWT Bearer token (authenticated user).
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const cart = await client.carts.get('cart_abc123', {
- token: '<token>',
- })
- 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
- - name: id
- in: path
- required: true
- description: Cart prefixed ID (e.g., cart_abc123)
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (items, fulfillments,
- payments, discounts, billing_address, shipping_address, gift_card, payment_methods).
- Use "none" to skip associations.
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
- id is always included.
- schema:
- type: string
- responses:
- '200':
- description: cart with out-of-stock item removed (warnings returned)
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R929020865
- token: XrTGYYzWrW8pPm2d5SNuJgjFeHQ8MNN6Ufr
- customer_note:
- currency: USD
- locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- warnings:
- - code: line_item_removed
- message: Product 874599 was removed because it was sold out
- line_item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: cart
- field: line_items
- message: Add at least one item to your cart
- - step: delivery
- field: shipping_method
- message: Select a shipping method for all shipments
- shipping_eq_billing_address: false
- discounts: []
- items: []
- fulfillments: []
- payments: []
- billing_address:
- id: addr_UkLWZg9DAJ
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 109 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 110 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Cart"
- '404':
- description: cart not found
- content:
- application/json:
- example:
- error:
- code: cart_not_found
- message: Cart not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update a cart
- tags:
- - Carts
- security:
- - api_key: []
- bearer_auth: []
- description: Updates cart info (email, addresses, customer note). When addresses
- change, the order state is reverted to address to ensure shipments are recalculated.
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const cart = await client.carts.update('cart_abc123', {
- email: '[email protected]',
- shipping_address: {
- first_name: 'John',
- last_name: 'Doe',
- address1: '123 Main St',
- city: 'New York',
- postal_code: '10001',
- country_iso: 'US',
- state_abbr: 'NY',
- },
- }, {
- token: '<token>',
- })
- 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
- - name: Idempotency-Key
- in: header
- required: false
- schema:
- type: string
- - name: id
- in: path
- required: true
- description: Cart prefixed ID
- schema:
- type: string
- responses:
- '200':
- description: cart updated
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R179766659
- token: LwvBFt69BRKiAP4yjrdydKDiefspHrgEEWV
- customer_note: Leave at door
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '19.99'
- display_item_total: "$19.99"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '29.99'
- display_total: "$29.99"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '29.99'
- display_amount_due: "$29.99"
- delivery_total: '10.0'
- display_delivery_total: "$10.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: payment
- completed_steps:
- - address
- - delivery
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 888308
- slug: product-888308
- options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '19.99'
- display_total: "$19.99"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '19.99'
- display_pre_tax_amount: "$19.99"
- discounted_amount: '19.99'
- display_discounted_amount: "$19.99"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_gbHJdmfrXB
- number: H67729784924
- tracking:
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Corazon Luettgen
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_gbHJdmfrXB
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '10.0'
- total: '10.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$10.00"
- display_total: "$10.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 113 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 114 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Cart"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- format: email
- 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_iso:
- type: string
- state_abbr:
- 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_iso:
- type: string
- state_abbr:
- type: string
- delete:
- summary: Delete a cart
- tags:
- - Carts
- security:
- - api_key: []
- bearer_auth: []
- description: Deletes/abandons the cart.
- 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.carts.delete('cart_abc123', {
- token: '<token>',
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
+ - name: q[in_stock]
+ in: query
required: false
+ description: Filter to only in-stock products
schema:
- type: string
- - name: x-spree-token
- in: header
+ type: boolean
+ - name: expand
+ in: query
required: false
+ description: Comma-separated associations to expand (variants, media, categories,
+ option_types)
schema:
type: string
- - name: id
- in: path
- required: true
- description: Cart prefixed ID
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
- '204':
- description: cart deleted
- "/api/v3/store/carts/{id}/associate":
- patch:
- summary: Associate guest cart with authenticated user
+ '200':
+ description: products found
+ content:
+ application/json:
+ example:
+ data:
+ - id: prod_UkLWZg9DAJ
+ name: Product 1421251
+ slug: product-1421251
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 1
+ available_on: '2025-05-26T16:14:22.402Z'
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: A comfortable cotton t-shirt.
+ description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"
+ default_variant_id: variant_gbHJdmfrXB
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_gbHJdmfrXB
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ original_price:
+ - id: prod_gbHJdmfrXB
+ name: Product 1435220
+ slug: product-1435220
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 0
+ available_on: '2025-05-26T16:14:22.472Z'
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: Architecto dignissimos nemo inventore incidunt enim.
+ Odit accusamus repellat error saepe culpa unde eius. Cupiditate
+ officiis voluptatem autem perferendis qui vitae omnis sunt. Debitis
+ dolor tempore ad impedit itaque reprehenderit delectus. Doloremque
+ laudantium iure recusandae iusto debitis laborum consequuntur.
+ Impedit eum optio commodi tempora cum quidem. Facere voluptatum
+ nam possimus veritatis nostrum explicabo dolore ex. Adipisci iure
+ unde nobis itaque amet nesciunt voluptatibus impedit. Numquam
+ in accusantium magni itaque exercitationem. Quas vero maxime voluptatem
+ rem impedit inventore. Esse perferendis asperiores ea expedita
+ aut tenetur soluta. Enim accusantium dolor adipisci impedit. Error
+ maxime neque accusamus facere provident eum. Cum officia velit
+ asperiores quod cupiditate fugiat. Possimus tenetur aut consequuntur
+ iusto cumque quas. Ab velit ullam qui pariatur veritatis omnis.
+ Accusantium vero occaecati explicabo neque animi commodi. Necessitatibus
+ perspiciatis iste culpa totam quibusdam voluptate distinctio.
+ Quod aliquam ut et autem. Saepe ut asperiores et quisquam perspiciatis
+ molestiae. Vel recusandae sunt nemo et accusamus veniam ducimus.
+ Laborum modi quasi perferendis culpa laboriosam quaerat magnam.
+ Facere at tempora iusto ex magni aliquam modi debitis.
+ description_html: |-
+ Architecto dignissimos nemo inventore incidunt enim. Odit accusamus repellat error saepe culpa unde eius. Cupiditate officiis voluptatem autem perferendis qui vitae omnis sunt. Debitis dolor tempore ad impedit itaque reprehenderit delectus. Doloremque laudantium iure recusandae iusto debitis laborum consequuntur.
+ Impedit eum optio commodi tempora cum quidem. Facere voluptatum nam possimus veritatis nostrum explicabo dolore ex. Adipisci iure unde nobis itaque amet nesciunt voluptatibus impedit. Numquam in accusantium magni itaque exercitationem. Quas vero maxime voluptatem rem impedit inventore.
+ Esse perferendis asperiores ea expedita aut tenetur soluta. Enim accusantium dolor adipisci impedit. Error maxime neque accusamus facere provident eum. Cum officia velit asperiores quod cupiditate fugiat. Possimus tenetur aut consequuntur iusto cumque quas.
+ Ab velit ullam qui pariatur veritatis omnis. Accusantium vero occaecati explicabo neque animi commodi. Necessitatibus perspiciatis iste culpa totam quibusdam voluptate distinctio. Quod aliquam ut et autem. Saepe ut asperiores et quisquam perspiciatis molestiae.
+ Vel recusandae sunt nemo et accusamus veniam ducimus. Laborum modi quasi perferendis culpa laboriosam quaerat magnam. Facere at tempora iusto ex magni aliquam modi debitis.
+ default_variant_id: variant_EfhxLZ9ck8
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_EfhxLZ9ck8
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ original_price:
+ meta:
+ page: 1
+ limit: 25
+ count: 2
+ pages: 1
+ from: 1
+ to: 2
+ in: 2
+ previous:
+ next:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Product"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ required:
+ - data
+ - meta
+ '401':
+ description: unauthorized - invalid or missing API key
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/products/{id}":
+ get:
+ summary: Get a product
tags:
- - Carts
+ - Product Catalog
security:
- api_key: []
- bearer_auth: []
- description: |
- Associates a guest cart with the currently authenticated user.
- Requires JWT authentication. The cart must not belong to another user.
+ description: Returns a single product by slug or prefix ID
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -1923,223 +928,233 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.associate('cart_abc123', {
- token: '<token>',
+ const product = await client.products.get('spree-tote', {
+ expand: ['variants', 'media'],
})
parameters:
- name: x-spree-api-key
in: header
required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
+ description: Publishable API key
schema:
type: string
- name: id
in: path
required: true
- description: Cart prefixed ID
+ description: Product slug (e.g., spree-tote) or prefix ID (e.g., product_abc123)
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
'200':
- description: cart associated successfully
+ description: product without prior_price expanded does not include field
content:
application/json:
example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R741424210
- token: BjQx3Mm7YsM51uEQTvTjE4Jkc9QKpdQ57A4
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 907994
- slug: product-907994
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
+ id: prod_UkLWZg9DAJ
+ name: Product 1702106
+ slug: product-1702106
+ meta_title:
+ meta_description:
+ meta_keywords:
+ variant_count: 1
+ available_on: '2025-05-26T16:14:24.749Z'
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ available: true
+ description: A comfortable cotton t-shirt.
+ description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"
+ default_variant_id: variant_gbHJdmfrXB
+ thumbnail_url:
+ tags: []
+ price:
+ id: price_gbHJdmfrXB
+ amount: '19.99'
+ amount_in_cents: 1999
compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H95245243522
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Agatha Hoppe
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_UkLWZg9DAJ
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 119 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 120 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ original_price:
+ prior_price:
+ id: _AXs1igzRC6
+ amount: '9.99'
+ amount_in_cents: 999
+ currency: USD
+ display_amount: "$9.99"
+ recorded_at: '2026-05-11T16:14:24Z'
+ schema:
+ "$ref": "#/components/schemas/Product"
+ '404':
+ description: draft product not visible
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Product not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/products/filters":
+ get:
+ summary: Get product filters
+ tags:
+ - Product Catalog
+ security:
+ - api_key: []
+ description: |
+ Returns available filters for products with their options and counts.
+ Use this endpoint to build filter UIs for product listing pages.
+
+ The filters are context-aware - when a category_id is provided, only filters
+ relevant to products in that category are returned.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const filters = await client.products.filters({
+ category_id: 'ctg_abc123',
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ description: Publishable API key
+ schema:
+ type: string
+ - name: category_id
+ in: query
+ required: false
+ description: Scope filters to products in this category (prefix ID)
+ schema:
+ type: string
+ - name: q[name_cont]
+ in: query
+ required: false
+ description: Filter by name containing string
+ schema:
+ type: string
+ responses:
+ '200':
+ description: filters scoped to category
+ content:
+ application/json:
+ example:
+ filters:
+ - id: price
+ type: price_range
+ min: 19.99
+ max: 19.99
+ currency: USD
+ - id: availability
+ type: availability
+ options:
+ - id: in_stock
+ count: 2
+ - id: out_of_stock
+ count: 0
+ - id: opt_UkLWZg9DAJ
+ type: option
+ name: size
+ label: Size
+ kind: dropdown
+ options:
+ - id: optval_UkLWZg9DAJ
+ name: small
+ label: S
+ position: 1
+ color_code:
+ image_url:
+ count: 1
+ - id: categories
+ type: category
+ options:
+ - id: ctg_EfhxLZ9ck8
+ name: Shirts
+ permalink: taxonomy-27/taxon-34/shirts
+ count: 2
+ sort_options:
+ - id: manual
+ - id: best_selling
+ - id: price
+ - id: "-price"
+ - id: "-available_on"
+ - id: available_on
+ - id: name
+ - id: "-name"
+ default_sort: manual
+ total_count: 2
schema:
- "$ref": "#/components/schemas/Cart"
+ type: object
+ properties:
+ filters:
+ type: array
+ description: Available filters (price_range, availability, option,
+ category)
+ items:
+ type: object
+ sort_options:
+ type: array
+ description: Available sort options
+ items:
+ type: object
+ properties:
+ id:
+ type: string
+ required:
+ - id
+ default_sort:
+ type: string
+ description: Default sort option ID
+ total_count:
+ type: integer
+ description: Total products matching current filters
+ required:
+ - filters
+ - sort_options
+ - default_sort
+ - total_count
'401':
- description: unauthorized - JWT required
+ description: unauthorized - invalid or missing API key
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: invalid_token
+ message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{id}/complete":
- post:
- summary: Complete cart
+ "/api/v3/store/carts":
+ get:
+ summary: List active carts
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: Completes the cart and finalizes the purchase. Returns an Order
- (not Cart).
+ description: Returns all active (incomplete) carts for the authenticated user.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2151,7 +1166,7 @@ paths:
publishableKey: '<api-key>',
})
- const order = await client.carts.complete('cart_abc123', {
+ const carts = await client.carts.list({
token: '<token>',
})
parameters:
@@ -2162,373 +1177,429 @@ paths:
type: string
- name: Authorization
in: header
+ required: true
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ description: 'Page number (default: 1)'
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ description: 'Number of results per page (default: 25, max: 100)'
+ schema:
+ type: integer
+ - name: sort
+ in: query
required: false
+ description: 'Sort order. Prefix with - for descending. Values: created_at,
+ -created_at, updated_at, -updated_at'
schema:
type: string
- - name: x-spree-token
- in: header
+ - name: q[created_at_gt]
+ in: query
required: false
+ description: Filter by created after date (ISO 8601)
schema:
type: string
- - name: id
- in: path
- required: true
- description: Cart prefixed ID
+ - name: q[updated_at_gt]
+ in: query
+ required: false
+ description: Filter by updated after date (ISO 8601)
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (items, fulfillments,
+ payments, discounts, billing_address, shipping_address, gift_card, payment_methods).
+ Use "none" to skip associations.
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
+ id is always included.
schema:
type: string
responses:
'200':
- description: cart completed
+ description: carts listed
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R464982887
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '19.99'
- display_item_total: "$19.99"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '29.99'
- display_total: "$29.99"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '10.0'
- display_delivery_total: "$10.00"
- fulfillment_status: backorder
- payment_status: paid
- completed_at: '2026-05-26T16:13:41.957Z'
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
+ data:
+ - id: cart_gbHJdmfrXB
+ market_id:
+ number: R537347983
+ token: yasKz5u5Uc9LkM8L2qFcbBRhWQzwP1nNUBe
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts: []
+ items:
+ - id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
+ quantity: 1
+ currency: USD
+ name: Product 832050
+ slug: product-832050
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_gbHJdmfrXB
+ number: H02359090617
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
+ quantity: 1
+ delivery_method:
+ id: dm_gbHJdmfrXB
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Blair Moore
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_gbHJdmfrXB
+ delivery_method_id: dm_gbHJdmfrXB
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_gbHJdmfrXB
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_uw2YK1rnl0
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 101 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_OIJLhNcSbf
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 102 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
+ - id: cart_UkLWZg9DAJ
+ market_id:
+ number: R807784030
+ token: nXX7y8d9LZ1UXEmP8CxfE2vvLYZH9s6K9Y3
+ customer_note:
currency: USD
- name: Product 924411
- slug: product-924411
- options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '19.99'
- display_total: "$19.99"
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '19.99'
- display_pre_tax_amount: "$19.99"
- discounted_amount: '19.99'
- display_discounted_amount: "$19.99"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_gbHJdmfrXB
- number: H02978405768
- tracking:
- tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
- total: '10.0'
- display_total: "$10.00"
discount_total: '0.0'
display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
tax_total: '0.0'
display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts: []
items:
- - item_id: li_UkLWZg9DAJ
+ - id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Zachery Smith
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_gbHJdmfrXB
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '10.0'
+ currency: USD
+ name: Product 821901
+ slug: product-821901
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$10.00"
- display_total: "$10.00"
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H10388427867
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
display_included_tax_total: "$0.00"
+ tax_total: '0.0'
display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
delivery_method:
id: dm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
- payments:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: BGS-176dea87fe0d
- number: PYQMKAGA
- amount: '29.99'
- display_amount: "$29.99"
- status: completed
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: check
- session_required: false
- source_required: false
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 127 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 128 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Order"
- '422':
- description: cannot complete
- content:
- application/json:
- example:
- error:
- code: cart_cannot_complete
- message: No payment found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/categories":
- get:
- summary: List categories
- tags:
- - Product Catalog
- security:
- - api_key: []
- description: Returns a paginated list of categories for the current store
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const categories = await client.categories.list({
- page: 1,
- limit: 25,
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- - name: q[name_cont]
- in: query
- required: false
- description: Filter by name
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
- schema:
- type: string
- responses:
- '200':
- description: categories found
- content:
- application/json:
- example:
- data:
- - id: ctg_UkLWZg9DAJ
- name: taxonomy_3
- permalink: taxonomy-3
- position: 0
- depth: 0
- meta_title:
- meta_description:
- meta_keywords:
- children_count: 1
- parent_id:
- description: ''
- description_html: ''
- image_url:
- square_image_url:
- is_root: true
- is_child: false
- is_leaf: false
- - id: ctg_gbHJdmfrXB
- name: taxon_3
- permalink: taxonomy-3/taxon-3
- position: 0
- depth: 1
- meta_title:
- meta_description:
- meta_keywords:
- children_count: 1
- parent_id: ctg_UkLWZg9DAJ
- description: ''
- description_html: ''
- image_url:
- square_image_url:
- is_root: false
- is_child: true
- is_leaf: false
- - id: ctg_EfhxLZ9ck8
- name: taxon_4
- permalink: taxonomy-3/taxon-3/taxon-4
- position: 0
- depth: 2
- meta_title:
- meta_description:
- meta_keywords:
- children_count: 0
- parent_id: ctg_gbHJdmfrXB
- description: ''
- description_html: ''
- image_url:
- square_image_url:
- is_root: false
- is_child: true
- is_leaf: true
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Blair Moore
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 99 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 100 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
meta:
page: 1
limit: 25
- count: 3
+ count: 2
pages: 1
from: 1
- to: 3
- in: 3
+ to: 2
+ in: 2
previous:
next:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Category"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
'401':
description: unauthorized
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/categories/{id}":
- get:
- summary: Get a category
+ post:
+ summary: Create a new cart
tags:
- - Product Catalog
+ - Carts
security:
- api_key: []
- description: Returns a single category by permalink or prefix ID
+ description: |
+ Creates a new shopping cart. Can be created by guests or authenticated customers.
+ Returns a `token` that must be used for guest access to the cart.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2540,8 +1611,14 @@ paths:
publishableKey: '<api-key>',
})
- const category = await client.categories.get('categories/clothing/shirts', {
- expand: ['children'],
+ // Create an empty cart
+ const cart = await client.carts.create()
+
+ // Create a cart with items
+ const cartWithItems = await client.carts.create({
+ items: [
+ { variant_id: 'variant_abc123', quantity: 2 },
+ ],
})
parameters:
- name: x-spree-api-key
@@ -2549,150 +1626,123 @@ paths:
required: true
schema:
type: string
- - name: id
- in: path
- required: true
- description: Category permalink (e.g., clothing/shirts) or prefix ID (e.g.,
- ctg_abc123)
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Expand associations (children, parent, ancestors, custom_fields)
- schema:
- type: string
- - name: fields
- in: query
+ - name: Authorization
+ in: header
required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ description: Bearer JWT token (optional - for authenticated customers)
schema:
type: string
- responses:
- '200':
- description: category found by prefix ID
- content:
- application/json:
- example:
- id: ctg_gbHJdmfrXB
- name: taxon_12
- permalink: taxonomy-9/taxon-12
- position: 0
- depth: 1
- meta_title:
- meta_description:
- meta_keywords:
- children_count: 1
- parent_id: ctg_UkLWZg9DAJ
- description: ''
- description_html: ''
- image_url:
- square_image_url:
- is_root: false
- is_child: true
- is_leaf: false
- schema:
- "$ref": "#/components/schemas/Category"
- '404':
- description: category from other store not accessible
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Category not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: invalid_token
- message: Valid API key required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/countries":
- get:
- summary: List countries
- tags:
- - Markets
- security:
- - api_key: []
- description: Returns countries available in the store. Use ?expand=market to
- include market details (currency, locale, tax_inclusive).
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const countries = await client.countries.list()
- parameters:
- - name: x-spree-api-key
+ - name: Idempotency-Key
in: header
- required: true
- schema:
- type: string
- - name: fields
- in: query
required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ description: Unique key for request idempotency.
schema:
type: string
responses:
- '200':
- description: countries found
- content:
- application/json:
- example:
- data:
- - iso: DE
- iso3: IS39
- name: Germany
- states_required: false
- zipcode_required: true
- - iso: US
- iso3: USA
- name: United States of America
- states_required: true
- zipcode_required: true
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Country"
- required:
- - data
- '401':
- description: unauthorized
+ '201':
+ description: cart created
content:
application/json:
example:
- error:
- code: invalid_token
- message: Valid API key required
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R386894669
+ token: AFTUr4LVpnRaQVPntcz4FE5S8AuFqksEEGH
+ email:
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: cart
+ field: line_items
+ message: Add at least one item to your cart
+ - step: address
+ field: email
+ message: Email address is required
+ - step: address
+ field: ship_address
+ message: Shipping address is required
+ - step: delivery
+ field: shipping_method
+ message: Select a shipping method for all shipments
+ shipping_eq_billing_address: true
+ discounts: []
+ items: []
+ fulfillments: []
+ payments: []
+ billing_address:
+ shipping_address:
+ payment_methods: []
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/countries/{iso}":
+ "$ref": "#/components/schemas/Cart"
+ requestBody:
+ 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
+ "/api/v3/store/carts/{id}":
get:
- summary: Get a country
+ summary: Get a cart
tags:
- - Markets
+ - Carts
security:
- api_key: []
- description: Returns a single country by ISO code. Supports ?expand=states for
- address forms and ?expand=market for market details.
+ bearer_auth: []
+ description: |
+ Returns a shopping cart by prefixed ID.
+ Authorize via x-spree-token header (guest) or JWT Bearer token (authenticated user).
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2704,75 +1754,165 @@ paths:
publishableKey: '<api-key>',
})
- const country = await client.countries.get('US')
+ const cart = await client.carts.get('cart_abc123', {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: iso
+ - name: Authorization
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: id
in: path
required: true
- description: Country ISO 3166-1 alpha-2 code (e.g., "US", "DE")
+ description: Cart prefixed ID (e.g., cart_abc123)
+ schema:
+ type: string
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (items, fulfillments,
+ payments, discounts, billing_address, shipping_address, gift_card, payment_methods).
+ Use "none" to skip associations.
schema:
type: string
- name: fields
in: query
required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
+ description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
id is always included.
schema:
type: string
responses:
'200':
- description: country found
+ description: cart with out-of-stock item removed (warnings returned)
content:
application/json:
example:
- iso: US
- iso3: USA
- name: United States of America
- states_required: true
- zipcode_required: true
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R929020865
+ token: XrTGYYzWrW8pPm2d5SNuJgjFeHQ8MNN6Ufr
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ warnings:
+ - code: line_item_removed
+ message: Product 874599 was removed because it was sold out
+ line_item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: cart
+ field: line_items
+ message: Add at least one item to your cart
+ - step: delivery
+ field: shipping_method
+ message: Select a shipping method for all shipments
+ shipping_eq_billing_address: false
+ discounts: []
+ items: []
+ fulfillments: []
+ payments: []
+ billing_address:
+ id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 109 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 110 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- type: object
- properties:
- iso:
- type: string
- iso3:
- type: string
- name:
- type: string
- states_required:
- type: boolean
- zipcode_required:
- type: boolean
- required:
- - iso
- - iso3
- - name
- - states_required
- - zipcode_required
+ "$ref": "#/components/schemas/Cart"
'404':
- description: country not found
+ description: cart not found
content:
application/json:
example:
error:
- code: record_not_found
- message: Country not found
+ code: cart_not_found
+ message: Cart not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/credit_cards":
- get:
- summary: List saved credit cards
+ patch:
+ summary: Update a cart
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Returns all saved credit cards for the authenticated customer
+ description: Updates cart info (email, addresses, customer note). When addresses
+ change, the order state is reverted to address to ensure shipments are recalculated.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2784,7 +1924,18 @@ paths:
publishableKey: '<api-key>',
})
- const cards = await client.customer.creditCards.list({}, {
+ const cart = await client.carts.update('cart_abc123', {
+ email: '[email protected]',
+ shipping_address: {
+ first_name: 'John',
+ last_name: 'Doe',
+ address1: '123 Main St',
+ city: 'New York',
+ postal_code: '10001',
+ country_iso: 'US',
+ state_abbr: 'NY',
+ },
+ }, {
token: '<token>',
})
parameters:
@@ -2795,79 +1946,282 @@ paths:
type: string
- name: Authorization
in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
required: false
schema:
- type: integer
- - name: limit
- in: query
+ type: string
+ - name: x-spree-token
+ in: header
required: false
schema:
- type: integer
- - name: fields
- in: query
+ type: string
+ - name: Idempotency-Key
+ in: header
required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
schema:
type: string
- responses:
- '200':
- description: credit cards found
- content:
- application/json:
- example:
- data:
- - id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/CreditCard"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
- '401':
- description: unauthorized
+ - name: id
+ in: path
+ required: true
+ description: Cart prefixed ID
+ schema:
+ type: string
+ responses:
+ '200':
+ description: cart updated
content:
application/json:
example:
- error:
- code: authentication_required
- message: Authentication required
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R179766659
+ token: LwvBFt69BRKiAP4yjrdydKDiefspHrgEEWV
+ customer_note: Leave at door
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '19.99'
+ display_item_total: "$19.99"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '29.99'
+ display_total: "$29.99"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '29.99'
+ display_amount_due: "$29.99"
+ delivery_total: '10.0'
+ display_delivery_total: "$10.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: payment
+ completed_steps:
+ - address
+ - delivery
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 888308
+ slug: product-888308
+ options_text: ''
+ price: '19.99'
+ display_price: "$19.99"
+ total: '19.99'
+ display_total: "$19.99"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '19.99'
+ display_pre_tax_amount: "$19.99"
+ discounted_amount: '19.99'
+ display_discounted_amount: "$19.99"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_gbHJdmfrXB
+ number: H67729784924
+ tracking:
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Corazon Luettgen
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_gbHJdmfrXB
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '10.0'
+ total: '10.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$10.00"
+ display_total: "$10.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 113 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 114 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/credit_cards/{id}":
- get:
- summary: Get a credit card
+ "$ref": "#/components/schemas/Cart"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ format: email
+ 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_iso:
+ type: string
+ state_abbr:
+ 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_iso:
+ type: string
+ state_abbr:
+ type: string
+ delete:
+ summary: Delete a cart
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Returns a saved credit card by its ID
+ description: Deletes/abandons the cart.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2879,7 +2233,7 @@ paths:
publishableKey: '<api-key>',
})
- const card = await client.customer.creditCards.get('card_abc123', {
+ await client.carts.delete('cart_abc123', {
token: '<token>',
})
parameters:
@@ -2890,55 +2244,34 @@ paths:
type: string
- name: Authorization
in: header
- required: true
+ required: false
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
schema:
type: string
- name: id
in: path
required: true
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ description: Cart prefixed ID
schema:
type: string
responses:
- '200':
- description: credit card found
- content:
- application/json:
- example:
- id: card_UkLWZg9DAJ
- brand: visa
- last4: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: false
- gateway_payment_profile_id:
- schema:
- "$ref": "#/components/schemas/CreditCard"
- '404':
- description: credit card not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Credit card not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- delete:
- summary: Delete a credit card
+ '204':
+ description: cart deleted
+ "/api/v3/store/carts/{id}/associate":
+ patch:
+ summary: Associate guest cart with authenticated user
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Removes a saved credit card from the customer account
+ description: |
+ Associates a guest cart with the currently authenticated user.
+ Requires JWT authentication. The cart must not belong to another user.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -2950,7 +2283,7 @@ paths:
publishableKey: '<api-key>',
})
- await client.customer.creditCards.delete('card_abc123', {
+ const cart = await client.carts.associate('cart_abc123', {
token: '<token>',
})
parameters:
@@ -2967,95 +2300,206 @@ paths:
- name: id
in: path
required: true
- schema:
- type: string
- responses:
- '204':
- description: credit card deleted
- '404':
- description: credit card not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Credit card not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/currencies":
- get:
- summary: List supported currencies
- tags:
- - Markets
- security:
- - api_key: []
- description: Returns currencies supported by the store (derived from markets)
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const currencies = await client.currencies.list()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ description: Cart prefixed ID
schema:
type: string
responses:
'200':
- description: currencies found
+ description: cart associated successfully
content:
application/json:
example:
- data:
- - iso_code: USD
- name: United States Dollar
- symbol: "$"
- - iso_code: EUR
- name: Euro
- symbol: "€"
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R741424210
+ token: BjQx3Mm7YsM51uEQTvTjE4Jkc9QKpdQ57A4
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 907994
+ slug: product-907994
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H95245243522
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Agatha Hoppe
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 119 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 120 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Currency"
- required:
- - data
+ "$ref": "#/components/schemas/Cart"
'401':
- description: unauthorized
+ description: unauthorized - JWT required
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/password_resets":
+ "/api/v3/store/carts/{id}/complete":
post:
- summary: Request a password reset
+ summary: Complete cart
tags:
- - Authentication
+ - Carts
security:
- api_key: []
- description: Sends a password reset email if an account exists for the given
- email address. Always returns 202 Accepted to prevent email enumeration.
+ bearer_auth: []
+ description: Completes the cart and finalizes the purchase. Returns an Order
+ (not Cart).
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -3067,9 +2511,8 @@ paths:
publishableKey: '<api-key>',
})
- await client.passwordResets.create({
- email: '[email protected]',
- redirect_url: 'https://myshop.com/reset-password',
+ const order = await client.carts.complete('cart_abc123', {
+ token: '<token>',
})
parameters:
- name: x-spree-api-key
@@ -3077,159 +2520,240 @@ paths:
required: true
schema:
type: string
- responses:
- '202':
- description: email not found (same response to prevent enumeration)
- content:
- application/json:
- example:
- message: If an account exists for that email, password reset instructions
- have been sent.
- schema:
- type: object
- properties:
- message:
- type: string
- '401':
- description: missing API key
- content:
- application/json:
- example:
- error:
- code: invalid_token
- message: Valid API key required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- format: email
- 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:
- - email
- "/api/v3/store/password_resets/{token}":
- patch:
- summary: Reset password with token
- tags:
- - Authentication
- security:
- - api_key: []
- description: Resets the password using a token received via email. Returns a
- JWT token on success (auto-login).
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const auth = await client.passwordResets.update(
- 'reset-token-from-email',
- {
- password: 'newsecurepassword',
- password_confirmation: 'newsecurepassword',
- }
- )
- parameters:
- - name: x-spree-api-key
+ - name: Authorization
in: header
- required: true
+ required: false
schema:
type: string
- - name: token
+ - name: x-spree-token
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: id
in: path
required: true
- description: Password reset token from the email
+ description: Cart prefixed ID
schema:
type: string
responses:
'200':
- description: password reset successful
+ description: cart completed
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjU1YjA5Yzc4LTUzMTYtNDRjYy05ZjJiLThmN2E2MzViMmRlNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjI4fQ.FX2Te4WfdAu3kN_fvvfHsH92_axvIZTI1d8Zmw8R1mE
- refresh_token: Be2HUCjiJVRjgidFuYU7GRRh
- user:
- id: cus_UkLWZg9DAJ
- first_name: Randa
- last_name: O'Hara
- phone:
- accepts_email_marketing: false
- full_name: Randa O'Hara
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses: []
- default_billing_address:
- default_shipping_address:
+ id: or_UkLWZg9DAJ
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R464982887
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '19.99'
+ display_item_total: "$19.99"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '29.99'
+ display_total: "$29.99"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '10.0'
+ display_delivery_total: "$10.00"
+ fulfillment_status: backorder
+ payment_status: paid
+ completed_at: '2026-05-26T16:13:41.957Z'
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 924411
+ slug: product-924411
+ options_text: ''
+ price: '19.99'
+ display_price: "$19.99"
+ total: '19.99'
+ display_total: "$19.99"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '19.99'
+ display_pre_tax_amount: "$19.99"
+ discounted_amount: '19.99'
+ display_discounted_amount: "$19.99"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_gbHJdmfrXB
+ number: H02978405768
+ tracking:
+ tracking_url:
+ cost: '10.0'
+ display_cost: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Zachery Smith
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_gbHJdmfrXB
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '10.0'
+ total: '10.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$10.00"
+ display_total: "$10.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: BGS-176dea87fe0d
+ number: PYQMKAGA
+ amount: '29.99'
+ display_amount: "$29.99"
+ status: completed
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: check
+ session_required: false
+ source_required: false
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 127 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 128 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/AuthResponse"
+ "$ref": "#/components/schemas/Order"
'422':
- description: password confirmation mismatch
- content:
- application/json:
- example:
- error:
- code: validation_error
- message: Password confirmation doesn't match Password
- details:
- password_confirmation:
- - doesn't match Password
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- '401':
- description: missing API key
+ description: cannot complete
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: cart_cannot_complete
+ message: No payment found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- password:
- type: string
- minLength: 6
- example: newsecurepassword
- password_confirmation:
- type: string
- example: newsecurepassword
- required:
- - password
- - password_confirmation
- "/api/v3/store/customers/me/orders":
- get:
- summary: List orders
+ "/api/v3/store/carts/{cart_id}/discount_codes":
+ post:
+ summary: Apply discount code
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Returns a paginated list of completed orders for the authenticated
- customer.
+ description: |
+ Applies a promotion discount code to the cart. The code is matched case-insensitively.
+
+ For gift cards, use the dedicated `POST /carts/{cart_id}/gift_cards` endpoint instead.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -3241,13 +2765,9 @@ paths:
publishableKey: '<api-key>',
})
- const orders = await client.customer.orders.list(
- {
- completed_at_gt: '2026-01-01',
- sort: '-completed_at',
- },
- { token: '<token>' },
- )
+ const cart = await client.carts.discountCodes.apply('cart_abc123', 'SAVE10', {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
@@ -3256,297 +2776,244 @@ paths:
type: string
- name: Authorization
in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- description: 'Page number (default: 1)'
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: 'Number of results per page (default: 25, max: 100)'
- schema:
- type: integer
- - name: sort
- in: query
- required: false
- description: 'Sort order. Prefix with - for descending. Values: completed_at,
- -completed_at, total, -total, number, -number'
- schema:
- type: string
- - name: q[completed_at_gt]
- in: query
- required: false
- description: Filter by completed after date (ISO 8601)
- schema:
- type: string
- - name: q[completed_at_lt]
- in: query
- required: false
- description: Filter by completed before date (ISO 8601)
- schema:
- type: string
- - name: q[number_eq]
- in: query
- required: false
- description: Filter by exact order number (e.g., R123456)
- schema:
- type: string
- - name: q[state_eq]
- in: query
required: false
- description: Filter by order state (complete, returned, canceled)
+ description: Bearer token for authenticated customers
schema:
type: string
- - name: q[payment_state_eq]
- in: query
+ - name: x-spree-token
+ in: header
required: false
- description: Filter by payment state (paid, balance_due, credit_owed, void,
- failed)
+ description: Order token for guest access
schema:
type: string
- - name: q[total_gteq]
- in: query
- required: false
- description: Filter by minimum total
- schema:
- type: number
- - name: q[total_lteq]
- in: query
- required: false
- description: Filter by maximum total
- schema:
- type: number
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (items, fulfillments,
- payments, discounts, billing_address, shipping_address, gift_card). Use
- "none" to skip associations.
+ - name: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID (e.g., cart_abc123)
schema:
type: string
- - name: fields
- in: query
+ - name: Idempotency-Key
+ in: header
required: false
- description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
- id is always included.
+ description: Unique key for request idempotency.
schema:
type: string
responses:
- '200':
- description: orders listed
+ '201':
+ description: discount code applied
content:
application/json:
example:
- data:
- - id: or_UkLWZg9DAJ
- market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R096824993
- customer_note:
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R549797108
+ token: dtJjZuWMLKEesDsMRZvLQQgWuYY9MuUwL2U
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: "-10.0"
+ display_adjustment_total: "-$10.00"
+ discount_total: "-10.0"
+ display_discount_total: "-$10.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '100.0'
+ display_total: "$100.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '100.0'
+ display_amount_due: "$100.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts:
+ - id: discount_UkLWZg9DAJ
+ promotion_id: promo_UkLWZg9DAJ
+ name: Promo
+ description:
+ code: save10
+ amount: "-10.0"
+ display_amount: "-$10.00"
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
+ name: Product 1111931
+ slug: product-1111931
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '0.0'
+ display_total: "$0.00"
+ adjustment_total: "-10.0"
+ display_adjustment_total: "-$10.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
+ discount_total: "-10.0"
+ display_discount_total: "-$10.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '0.0'
+ display_discounted_amount: "$0.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H10253682077
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- fulfillment_status:
- payment_status:
- completed_at: '2026-05-26T16:13:49.079Z'
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- discounts: []
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
items:
- - id: li_UkLWZg9DAJ
+ - item_id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- currency: USD
- name: Product 1016128
- slug: product-1016128
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H70742962050
- tracking: U10000
- tracking_url:
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Clark Gerlach
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
cost: '100.0'
- display_cost: "$100.00"
total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Britany Halvorson
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_gbHJdmfrXB
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '10.0'
- total: '10.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$10.00"
- display_total: "$10.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 147 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 148 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- gift_card:
- market:
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 179 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 180 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Order"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
- required:
- - data
- - meta
- '401':
- description: unauthorized
+ "$ref": "#/components/schemas/Cart"
+ '422':
+ description: invalid discount code
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: processing_error
+ message: The coupon code you entered doesn't exist. Please try again.
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/orders/{id}":
- get:
- summary: Get an order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ code:
+ type: string
+ example: SAVE10
+ description: Promotion discount code to apply
+ required:
+ - code
+ "/api/v3/store/carts/{cart_id}/discount_codes/{id}":
+ delete:
+ summary: Remove discount code
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Returns a single completed order for the authenticated customer.
+ description: Removes a previously applied discount code from the cart. The ID
+ is the discount code string itself.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -3558,7 +3025,7 @@ paths:
publishableKey: '<api-key>',
})
- const order = await client.customer.orders.get('or_abc123', {}, {
+ const cart = await client.carts.discountCodes.remove('cart_abc123', 'SAVE10', {
token: '<token>',
})
parameters:
@@ -3569,41 +3036,39 @@ paths:
type: string
- name: Authorization
in: header
- required: true
+ required: false
+ description: Bearer token for authenticated customers
schema:
type: string
- - name: id
+ - name: cart_id
in: path
required: true
- description: Order prefixed ID
+ description: Cart prefixed ID
schema:
type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (items, fulfillments,
- payments, discounts, billing_address, shipping_address, gift_card). Use
- "none" to skip associations.
+ - name: id
+ in: path
+ required: true
+ description: The discount code string to remove (e.g., SAVE10)
schema:
type: string
- - name: fields
- in: query
+ - name: x-spree-token
+ in: header
required: false
- description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
- id is always included.
+ description: Order token for guest access
schema:
type: string
responses:
'200':
- description: order found
+ description: discount code removed
content:
application/json:
example:
- id: or_UkLWZg9DAJ
+ id: cart_UkLWZg9DAJ
market_id:
- channel_id: ch_UkLWZg9DAJ
- number: R695830260
+ number: R750836348
+ token: uesByPtiBKoM7CoRrEKxrNXDHDLP4WQHVEg
customer_note:
currency: USD
locale: en
@@ -3628,20 +3093,25 @@ paths:
display_amount_due: "$110.00"
delivery_total: '100.0'
display_delivery_total: "$100.00"
- fulfillment_status:
- payment_status:
- completed_at: '2026-05-26T16:13:49.771Z'
+ warnings: []
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
discounts: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1033099
- slug: product-1033099
+ name: Product 1136391
+ slug: product-1136391
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3666,7 +3136,7 @@ paths:
digital_links: []
fulfillments:
- id: ful_UkLWZg9DAJ
- number: H08221240082
+ number: H71965274390
tracking: U10000
tracking_url:
cost: '100.0'
@@ -3695,7 +3165,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: NY
- name: Aleen Reynolds
+ name: Drusilla Greenfelder
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3703,17 +3173,17 @@ paths:
country_name: United States of America
state_text: NY
delivery_rates:
- - id: dr_gbHJdmfrXB
+ - id: dr_UkLWZg9DAJ
delivery_method_id: dm_UkLWZg9DAJ
name: UPS Ground
selected: true
- cost: '10.0'
- total: '10.0'
+ cost: '100.0'
+ total: '100.0'
additional_tax_total: '0.0'
included_tax_total: '0.0'
tax_total: '0.0'
- display_cost: "$10.00"
- display_total: "$10.00"
+ display_cost: "$100.00"
+ display_total: "$100.00"
display_additional_tax_total: "$0.00"
display_included_tax_total: "$0.00"
display_tax_total: "$0.00"
@@ -3722,174 +3192,69 @@ paths:
name: UPS Ground
code: UPS_GROUND
payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 153 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 154 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Order"
- '404':
- description: order belongs to another user
- content:
- application/json:
- example:
- error:
- code: order_not_found
- message: Order not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers":
- post:
- summary: Register a new customer
- tags:
- - Customers
- security:
- - api_key: []
- description: Creates a new customer account and returns a JWT token
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const auth = await client.customers.create({
- email: '[email protected]',
- password: 'password123',
- password_confirmation: 'password123',
- first_name: 'John',
- last_name: 'Doe',
- phone: '+1234567890',
- accepts_email_marketing: true,
- metadata: { source: 'storefront' },
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- responses:
- '201':
- description: registration successful
- content:
- application/json:
- example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjlmZGNlNTdjLTY2NGQtNGZkNy1hOTU2LWQ1MjEzZjdhMjljYSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjMwfQ.vLRThKiR034rnZQYwpQGrIOeQSdrYNKnFVJZ86pCuUo
- refresh_token: GVssZP2L5Zk7uKQzTmwSQ4i5
- user:
- id: cus_UkLWZg9DAJ
+ billing_address:
+ id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
- phone: "+1234567890"
- accepts_email_marketing: true
full_name: John Doe
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses: []
- default_billing_address:
- default_shipping_address:
+ address1: 187 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 188 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/AuthResponse"
+ "$ref": "#/components/schemas/Cart"
'422':
- description: email already taken
+ description: discount code not found on cart
content:
application/json:
example:
error:
- code: validation_error
- message: Email has already been taken
- details:
- email:
- - has already been taken
+ code: processing_error
+ message: The coupon code you entered doesn't exist. Please try again.
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- format: email
- 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:
- - email
- - password
- "/api/v3/store/customers/me":
- get:
- summary: Get current customer profile
+ "/api/v3/store/carts/{cart_id}/fulfillments/{id}":
+ patch:
+ summary: Select delivery rate for fulfillment
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Returns the profile of the currently authenticated customer
+ description: Selects a delivery rate for a specific fulfillment and auto-advances
+ checkout.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -3901,7 +3266,9 @@ paths:
publishableKey: '<api-key>',
})
- const customer = await client.customer.get({
+ const cart = await client.carts.fulfillments.update('cart_abc123', 'ful_abc123', {
+ selected_delivery_rate_id: 'dr_abc123',
+ }, {
token: '<token>',
})
parameters:
@@ -3912,56 +3279,169 @@ paths:
type: string
- name: Authorization
in: header
+ required: false
+ schema:
+ type: string
+ - name: cart_id
+ in: path
required: true
- description: Bearer JWT token
+ description: Cart prefixed ID
schema:
type: string
- - name: fields
- in: query
+ - name: id
+ in: path
+ required: true
+ description: Fulfillment ID
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ description: Order token for guest access
schema:
type: string
responses:
'200':
- description: profile found
+ description: delivery rate selected, returns updated cart
content:
application/json:
example:
- id: cus_UkLWZg9DAJ
- first_name: Catarina
- last_name: Padberg
- phone: 555-555-0199
- accepts_email_marketing: false
- full_name: Catarina Padberg
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses:
- - id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 160 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: true
- is_default_shipping: false
- state_name: New York
- - id: addr_UkLWZg9DAJ
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R495333435
+ token: vr5NsDydPesecXCDNmvqdhrE1FH96kV3K9s
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: payment
+ completed_steps:
+ - address
+ - delivery
+ requirements:
+ - step: payment
+ field: payment
+ message: Add a payment method
+ shipping_eq_billing_address: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 1159495
+ slug: product-1159495
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H32451339376
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Danika Wiza
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 159 Lovely Street
+ address1: 195 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -3973,33 +3453,14 @@ paths:
state_abbr: NY
quick_checkout: false
is_default_billing: false
- is_default_shipping: true
- state_name: New York
- default_billing_address:
- id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 160 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: true
is_default_shipping: false
state_name: New York
- default_shipping_address:
- id: addr_UkLWZg9DAJ
+ shipping_address:
+ id: addr_VqXmZF31wY
first_name: John
last_name: Doe
full_name: John Doe
- address1: 159 Lovely Street
+ address1: 196 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4011,28 +3472,48 @@ paths:
state_abbr: NY
quick_checkout: false
is_default_billing: false
- is_default_shipping: true
+ is_default_shipping: false
state_name: New York
+ payment_methods: []
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/Customer"
- '401':
- description: unauthorized - invalid token
+ "$ref": "#/components/schemas/Cart"
+ '404':
+ description: delivery rate not found
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: record_not_found
+ message: Shipping rate not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update current customer profile
+ requestBody:
+ 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
+ "/api/v3/store/carts/{cart_id}/gift_cards":
+ post:
+ summary: Apply gift card
tags:
- - Customers
+ - Carts
security:
- api_key: []
bearer_auth: []
- description: Updates the profile of the currently authenticated customer
+ description: |
+ Applies a gift card to the cart. Gift cards are treated as a payment method, not a discount —
+ the cart `total` remains unchanged while `amount_due` is reduced.
+
+ For promotion discount codes, use the `POST /carts/{cart_id}/discount_codes` endpoint instead.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -4044,11 +3525,7 @@ paths:
publishableKey: '<api-key>',
})
- const customer = await client.customer.update({
- first_name: 'John',
- last_name: 'Doe',
- metadata: { preferred_contact: 'email' },
- }, {
+ const cart = await client.carts.giftCards.apply('cart_abc123', 'GC-ABCD-1234', {
token: '<token>',
})
parameters:
@@ -4059,48 +3536,190 @@ paths:
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
+ - name: cart_id
+ in: path
required: true
+ description: Cart prefixed ID (e.g., cart_abc123)
+ schema:
+ type: string
+ - name: Idempotency-Key
+ in: header
+ required: false
+ description: Unique key for request idempotency.
schema:
type: string
responses:
- '200':
- description: profile updated
+ '201':
+ description: gift card applied
content:
application/json:
example:
- id: cus_UkLWZg9DAJ
- first_name: Updated
- last_name: Name
- phone: 555-555-0199
- accepts_email_marketing: false
- full_name: Updated Name
- available_store_credit_total: '0'
- display_available_store_credit_total: "$0.00"
- addresses:
- - id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 162 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: true
- is_default_shipping: false
- state_name: New York
- - id: addr_UkLWZg9DAJ
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R144554045
+ token: RuTHka2EQdEPmHa7PXXzb8EAr5c9vSivWun
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '50.0'
+ display_gift_card_total: "$50.00"
+ amount_due: '60.0'
+ display_amount_due: "$60.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ warnings: []
+ store_credit_total: '50.0'
+ display_store_credit_total: "-$50.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements: []
+ shipping_eq_billing_address: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 1174034
+ slug: product-1174034
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H20393389861
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Gordon Pfeffer
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: 1-SC-20260526161400395109
+ number: PGO55NWN
+ amount: '50.0'
+ display_amount: "$50.00"
+ status: checkout
+ source_type: store_credit
+ source_id: credit_UkLWZg9DAJ
+ source:
+ id: credit_UkLWZg9DAJ
+ amount: '50.0'
+ amount_used: '0.0'
+ amount_remaining: '50.0'
+ display_amount: "$50.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$50.00"
+ currency: USD
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description:
+ type: store_credit
+ session_required: false
+ source_required: true
+ billing_address:
+ id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 161 Lovely Street
+ address1: 203 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4112,33 +3731,14 @@ paths:
state_abbr: NY
quick_checkout: false
is_default_billing: false
- is_default_shipping: true
- state_name: New York
- default_billing_address:
- id: addr_gbHJdmfrXB
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 162 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: true
is_default_shipping: false
state_name: New York
- default_shipping_address:
- id: addr_UkLWZg9DAJ
+ shipping_address:
+ id: addr_VqXmZF31wY
first_name: John
last_name: Doe
full_name: John Doe
- address1: 161 Lovely Street
+ address1: 204 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4150,21 +3750,52 @@ paths:
state_abbr: NY
quick_checkout: false
is_default_billing: false
- is_default_shipping: true
+ is_default_shipping: false
state_name: New York
+ payment_methods:
+ - id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description:
+ type: store_credit
+ session_required: false
+ source_required: true
+ gift_card:
+ id: gc_UkLWZg9DAJ
+ code: GIFTCODE1
+ status: active
+ currency: USD
+ amount: '50.0'
+ amount_used: '50.0'
+ amount_authorized: '0.0'
+ amount_remaining: '0.0'
+ display_amount: "$50.00"
+ display_amount_used: "$50.00"
+ display_amount_remaining: "$0.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ market:
schema:
- "$ref": "#/components/schemas/Customer"
+ "$ref": "#/components/schemas/Cart"
+ '404':
+ description: gift card not found
+ content:
+ application/json:
+ example:
+ error:
+ code: gift_card_not_found
+ message: The Gift Card was not found.
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
'422':
- description: validation error
+ description: gift card already redeemed
content:
application/json:
example:
error:
- code: validation_error
- message: Email can't be blank
- details:
- email:
- - can't be blank
+ code: gift_card_already_redeemed
+ message: The Gift Card has already been redeemed.
schema:
"$ref": "#/components/schemas/ErrorResponse"
requestBody:
@@ -4173,90 +3804,21 @@ paths:
schema:
type: object
properties:
- first_name:
- type: string
- example: John
- last_name:
- type: string
- example: Doe
- email:
- type: string
- format: email
- password:
- type: string
- example: newpassword123
- password_confirmation:
- type: string
- example: newpassword123
- accepts_email_marketing:
- type: boolean
- example: true
- phone:
+ code:
type: string
- example: "+1 555 123 4567"
- metadata:
- type: object
- example:
- preferred_contact: email
- "/api/v3/store/digitals/{token}":
- get:
- summary: Download a digital product
- tags:
- - Digitals
- description: |
- Downloads a digital product file using the digital link token.
- The token is provided via the `download_url` field on digital links
- returned with order line items. No API key or authentication required —
- the token itself grants access.
- Each download increments the access counter. Downloads may be limited by
- store settings (number of downloads and/or time-based expiration).
- parameters:
- - name: token
- in: path
- required: true
- description: Digital link token
- schema:
- type: string
- responses:
- '200':
- description: file downloaded
- content:
- application/json: {}
- '403':
- description: download link expired or limit exceeded
- content:
- application/json:
- example:
- error:
- code: digital_link_expired
- message: Download link expired or invalid
- application/octet-stream:
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- '404':
- description: digital link not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Digital link not found
- application/octet-stream:
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{cart_id}/discount_codes":
- post:
- summary: Apply discount code
+ example: GC-ABCD-1234
+ description: Gift card code to apply
+ required:
+ - code
+ "/api/v3/store/carts/{cart_id}/gift_cards/{id}":
+ delete:
+ summary: Remove gift card
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: |
- Applies a promotion discount code to the cart. The code is matched case-insensitively.
-
- For gift cards, use the dedicated `POST /carts/{cart_id}/gift_cards` endpoint instead.
+ description: Removes a previously applied gift card from the cart.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -4268,7 +3830,7 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.discountCodes.apply('cart_abc123', 'SAVE10', {
+ const cart = await client.carts.giftCards.remove('cart_abc123', 'gc_abc123', {
token: '<token>',
})
parameters:
@@ -4283,57 +3845,57 @@ paths:
description: Bearer token for authenticated customers
schema:
type: string
- - name: x-spree-token
- in: header
- required: false
- description: Order token for guest access
+ - name: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID
schema:
type: string
- - name: cart_id
+ - name: id
in: path
required: true
- description: Cart prefixed ID (e.g., cart_abc123)
+ description: Gift card prefixed ID (e.g., gc_abc123)
schema:
type: string
- - name: Idempotency-Key
+ - name: x-spree-token
in: header
required: false
- description: Unique key for request idempotency.
+ description: Order token for guest access
schema:
type: string
responses:
- '201':
- description: discount code applied
+ '200':
+ description: gift card removed
content:
application/json:
example:
id: cart_UkLWZg9DAJ
market_id:
- number: R549797108
- token: dtJjZuWMLKEesDsMRZvLQQgWuYY9MuUwL2U
+ number: R375402748
+ token: zK6CyYENcBq5VLBnwSXE35w1RrR7o2sTgky
customer_note:
currency: USD
locale: en
total_quantity: 1
item_total: '10.0'
display_item_total: "$10.00"
- adjustment_total: "-10.0"
- display_adjustment_total: "-$10.00"
- discount_total: "-10.0"
- display_discount_total: "-$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
tax_total: '0.0'
display_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '100.0'
- display_total: "$100.00"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '100.0'
- display_amount_due: "$100.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
delivery_total: '100.0'
display_delivery_total: "$100.00"
warnings: []
@@ -4347,38 +3909,31 @@ paths:
field: payment
message: Add a payment method
shipping_eq_billing_address: false
- discounts:
- - id: discount_UkLWZg9DAJ
- promotion_id: promo_UkLWZg9DAJ
- name: Promo
- description:
- code: save10
- amount: "-10.0"
- display_amount: "-$10.00"
+ discounts: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1111931
- slug: product-1111931
+ name: Product 1215119
+ slug: product-1215119
options_text: ''
price: '10.0'
display_price: "$10.00"
- total: '0.0'
- display_total: "$0.00"
- adjustment_total: "-10.0"
- display_adjustment_total: "-$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
- discount_total: "-10.0"
- display_discount_total: "-$10.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
pre_tax_amount: '10.0'
display_pre_tax_amount: "$10.00"
- discounted_amount: '0.0'
- display_discounted_amount: "$0.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
compare_at_amount:
thumbnail_url:
@@ -4386,7 +3941,7 @@ paths:
digital_links: []
fulfillments:
- id: ful_UkLWZg9DAJ
- number: H10253682077
+ number: H49636801244
tracking: U10000
tracking_url:
cost: '100.0'
@@ -4415,7 +3970,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: NY
- name: Clark Gerlach
+ name: Melvina Gottlieb
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -4441,13 +3996,38 @@ paths:
id: dm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
- payments: []
+ payments:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code: 1-SC-20260526161402955039
+ number: PIQFGKXI
+ amount: '50.0'
+ display_amount: "$50.00"
+ status: invalid
+ source_type: store_credit
+ source_id: credit_UkLWZg9DAJ
+ source:
+ id: credit_UkLWZg9DAJ
+ amount: '50.0'
+ amount_used: '0.0'
+ amount_remaining: '50.0'
+ display_amount: "$50.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$50.00"
+ currency: USD
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description:
+ type: store_credit
+ session_required: false
+ source_required: true
billing_address:
id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 179 Lovely Street
+ address1: 219 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4466,7 +4046,7 @@ paths:
first_name: John
last_name: Doe
full_name: John Doe
- address1: 180 Lovely Street
+ address1: 220 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4485,38 +4065,16 @@ paths:
market:
schema:
"$ref": "#/components/schemas/Cart"
- '422':
- description: invalid discount code
- content:
- application/json:
- example:
- error:
- code: processing_error
- message: The coupon code you entered doesn't exist. Please try again.
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- code:
- type: string
- example: SAVE10
- description: Promotion discount code to apply
- required:
- - code
- "/api/v3/store/carts/{cart_id}/discount_codes/{id}":
- delete:
- summary: Remove discount code
+ "/api/v3/store/carts/{cart_id}/items":
+ post:
+ summary: Add item to cart
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: Removes a previously applied discount code from the cart. The ID
- is the discount code string itself.
+ description: Adds a variant to the cart. Creates a new line item or increases
+ quantity if variant already in cart.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -4528,7 +4086,10 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.discountCodes.remove('cart_abc123', 'SAVE10', {
+ const cart = await client.carts.items.create('cart_abc123', {
+ variant_id: 'variant_abc123',
+ quantity: 2,
+ }, {
token: '<token>',
})
parameters:
@@ -4543,41 +4104,41 @@ paths:
description: Bearer token for authenticated customers
schema:
type: string
- - name: cart_id
- in: path
- required: true
- description: Cart prefixed ID
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
schema:
type: string
- - name: id
+ - name: cart_id
in: path
required: true
- description: The discount code string to remove (e.g., SAVE10)
+ description: Cart prefixed ID (e.g., cart_abc123)
schema:
type: string
- - name: x-spree-token
+ - name: Idempotency-Key
in: header
required: false
- description: Order token for guest access
+ description: Unique key for request idempotency.
schema:
type: string
responses:
- '200':
- description: discount code removed
+ '201':
+ description: item added with metadata
content:
application/json:
example:
id: cart_UkLWZg9DAJ
market_id:
- number: R750836348
- token: uesByPtiBKoM7CoRrEKxrNXDHDLP4WQHVEg
+ number: R128024977
+ token: snfWbJhSsShSGdMgtj6NVNbk7SVZvg984Xb
customer_note:
currency: USD
locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
+ total_quantity: 2
+ item_total: '29.99'
+ display_item_total: "$29.99"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -4588,14 +4149,14 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '29.99'
+ display_total: "$29.99"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
+ amount_due: '29.99'
+ display_amount_due: "$29.99"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
warnings: []
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
@@ -4603,6 +4164,12 @@ paths:
current_step: address
completed_steps: []
requirements:
+ - step: address
+ field: ship_address
+ message: Shipping address is required
+ - step: delivery
+ field: shipping_method
+ message: Select a shipping method for all shipments
- step: payment
field: payment
message: Add a payment method
@@ -4613,8 +4180,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1136391
- slug: product-1136391
+ name: Product 1244584
+ slug: product-1244584
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -4637,89 +4204,42 @@ paths:
thumbnail_url:
option_values: []
digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H71965274390
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
+ - id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
+ quantity: 1
+ currency: USD
+ name: Product 1253628
+ slug: product-1253628
+ options_text: ''
+ price: '19.99'
+ display_price: "$19.99"
+ total: '19.99'
+ display_total: "$19.99"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Drusilla Greenfelder
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '19.99'
+ display_pre_tax_amount: "$19.99"
+ discounted_amount: '19.99'
+ display_discounted_amount: "$19.99"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments: []
payments: []
billing_address:
id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 187 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 188 Lovely Street
+ address1: 234 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4733,31 +4253,53 @@ paths:
is_default_billing: false
is_default_shipping: false
state_name: New York
+ shipping_address:
payment_methods: []
gift_card:
market:
schema:
"$ref": "#/components/schemas/Cart"
- '422':
- description: discount code not found on cart
+ '404':
+ description: variant not found
content:
application/json:
example:
error:
- code: processing_error
- message: The coupon code you entered doesn't exist. Please try again.
+ code: variant_not_found
+ message: Variant not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{cart_id}/fulfillments/{id}":
+ requestBody:
+ 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
+ "/api/v3/store/carts/{cart_id}/items/{id}":
patch:
- summary: Select delivery rate for fulfillment
+ summary: Update line item quantity
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: Selects a delivery rate for a specific fulfillment and auto-advances
- checkout.
+ description: Updates the quantity of a line item in the cart
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -4769,8 +4311,8 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.fulfillments.update('cart_abc123', 'ful_abc123', {
- selected_delivery_rate_id: 'dr_abc123',
+ const cart = await client.carts.items.update('cart_abc123', 'li_abc123', {
+ quantity: 5,
}, {
token: '<token>',
})
@@ -4794,32 +4336,31 @@ paths:
- name: id
in: path
required: true
- description: Fulfillment ID
+ description: Line item ID
schema:
type: string
- name: x-spree-token
in: header
required: false
- description: Order token for guest access
schema:
type: string
responses:
'200':
- description: delivery rate selected, returns updated cart
+ description: metadata updated on line item
content:
application/json:
example:
id: cart_UkLWZg9DAJ
market_id:
- number: R495333435
- token: vr5NsDydPesecXCDNmvqdhrE1FH96kV3K9s
+ number: R216067679
+ token: HBo9TtU6Kra7Pkqey8Rhw5WW93WSsLFKbcb
customer_note:
currency: USD
locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -4830,26 +4371,27 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '0.0'
+ display_total: "$0.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
warnings: []
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
- current_step: payment
- completed_steps:
- - address
- - delivery
+ current_step: address
+ completed_steps: []
requirements:
- - step: payment
- field: payment
- message: Add a payment method
+ - step: address
+ field: ship_address
+ message: Shipping address is required
+ - step: delivery
+ field: shipping_method
+ message: Select a shipping method for all shipments
shipping_eq_billing_address: false
discounts: []
items:
@@ -4857,8 +4399,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1159495
- slug: product-1159495
+ name: Product 1289337
+ slug: product-1289337
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -4881,70 +4423,160 @@ paths:
thumbnail_url:
option_values: []
digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H32451339376
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Danika Wiza
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
+ fulfillments: []
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 243 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ payment_methods: []
+ gift_card:
+ market:
+ schema:
+ "$ref": "#/components/schemas/Cart"
+ requestBody:
+ 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.
+ delete:
+ summary: Remove line item from cart
+ tags:
+ - Carts
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Removes a line item from the cart
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const cart = await client.carts.items.delete('cart_abc123', 'li_abc123', {
+ token: '<token>',
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ description: line item removed, returns updated cart
+ content:
+ application/json:
+ example:
+ id: cart_UkLWZg9DAJ
+ market_id:
+ number: R262930205
+ token: 6F91AsEuASghgSqqpwTgtCCF84SEMYm1ozP
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 0
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '0.0'
+ display_amount_due: "$0.00"
+ delivery_total: '0.0'
+ display_delivery_total: "$0.00"
+ warnings: []
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ current_step: address
+ completed_steps: []
+ requirements:
+ - step: cart
+ field: line_items
+ message: Add at least one item to your cart
+ - step: address
+ field: ship_address
+ message: Shipping address is required
+ - step: delivery
+ field: shipping_method
+ message: Select a shipping method for all shipments
+ shipping_eq_billing_address: false
+ discounts: []
+ items: []
+ fulfillments: []
payments: []
billing_address:
id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 195 Lovely Street
+ address1: 246 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -4959,64 +4591,223 @@ paths:
is_default_shipping: false
state_name: New York
shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 196 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
payment_methods: []
gift_card:
market:
schema:
"$ref": "#/components/schemas/Cart"
'404':
- description: delivery rate not found
+ description: line item not found
+ content:
+ application/json:
+ example:
+ error:
+ code: line_item_not_found
+ message: Line item not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/carts/{cart_id}/payment_sessions":
+ post:
+ summary: Create payment session
+ tags:
+ - Carts
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Creates a new payment session for the cart. Delegates to the payment
+ gateway to initialize a provider-specific session (e.g. Stripe PaymentIntent,
+ Adyen session, PayPal order).
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const session = await client.carts.paymentSessions.create('cart_abc123', {
+ payment_method_id: 'pm_abc123',
+ }, {
+ token: '<token>',
+ })
+ 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: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID (e.g., cart_abc123)
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ - name: Idempotency-Key
+ in: header
+ required: false
+ description: Unique key for request idempotency.
+ schema:
+ type: string
+ responses:
+ '201':
+ description: payment session created
+ content:
+ application/json:
+ example:
+ id: ps_gbHJdmfrXB
+ status: pending
+ currency: USD
+ external_id: bogus_7d70cfacf0ae7492cf904547
+ external_data:
+ client_secret: bogus_secret_ede104f24aa5154c
+ customer_external_id:
+ expires_at:
+ amount: '110.0'
+ payment_method_id: pm_UkLWZg9DAJ
+ order_id: or_UkLWZg9DAJ
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Credit Card
+ description:
+ type: bogus
+ session_required: true
+ source_required: true
+ schema:
+ "$ref": "#/components/schemas/PaymentSession"
+ requestBody:
+ 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
+ "/api/v3/store/carts/{cart_id}/payment_sessions/{id}":
+ 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: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
+ description: Payment session ID
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ get:
+ summary: Get payment session
+ tags:
+ - Carts
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Returns a single payment session with its current status and provider
+ data.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const session = await client.carts.paymentSessions.get('cart_abc123', 'ps_abc123', {
+ token: '<token>',
+ })
+ responses:
+ '200':
+ description: payment session found
+ content:
+ application/json:
+ example:
+ id: ps_UkLWZg9DAJ
+ status: pending
+ currency: USD
+ external_id: bogus_4c7d24178351b3d5952b3cf5
+ external_data:
+ client_secret: secret_123
+ customer_external_id:
+ expires_at:
+ amount: '110.0'
+ payment_method_id: pm_UkLWZg9DAJ
+ order_id: or_UkLWZg9DAJ
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Credit Card
+ description:
+ type: bogus
+ session_required: true
+ source_required: true
+ schema:
+ "$ref": "#/components/schemas/PaymentSession"
+ '404':
+ description: payment session not found
content:
application/json:
example:
error:
code: record_not_found
- message: Shipping rate not found
+ message: Payment session not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- "/api/v3/store/carts/{cart_id}/gift_cards":
- post:
- summary: Apply gift card
+ patch:
+ summary: Update payment session
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: |
- Applies a gift card to the cart. Gift cards are treated as a payment method, not a discount —
- the cart `total` remains unchanged while `amount_due` is reduced.
-
- For promotion discount codes, use the `POST /carts/{cart_id}/discount_codes` endpoint instead.
+ description: Updates a payment session. Delegates to the payment gateway to
+ sync changes with the provider.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -5028,277 +4819,246 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.giftCards.apply('cart_abc123', 'GC-ABCD-1234', {
+ const session = await client.carts.paymentSessions.update('cart_abc123', 'ps_abc123', {
+ amount: '50.00',
+ }, {
token: '<token>',
})
- 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
- - name: cart_id
- in: path
- required: true
- description: Cart prefixed ID (e.g., cart_abc123)
- schema:
- type: string
- - name: Idempotency-Key
- in: header
- required: false
- description: Unique key for request idempotency.
- schema:
- type: string
- responses:
- '201':
- description: gift card applied
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R144554045
- token: RuTHka2EQdEPmHa7PXXzb8EAr5c9vSivWun
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '50.0'
- display_gift_card_total: "$50.00"
- amount_due: '60.0'
- display_amount_due: "$60.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '50.0'
- display_store_credit_total: "-$50.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements: []
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 1174034
- slug: product-1174034
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H20393389861
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Gordon Pfeffer
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: 1-SC-20260526161400395109
- number: PGO55NWN
- amount: '50.0'
- display_amount: "$50.00"
- status: checkout
- source_type: store_credit
- source_id: credit_UkLWZg9DAJ
- source:
- id: credit_UkLWZg9DAJ
- amount: '50.0'
- amount_used: '0.0'
- amount_remaining: '50.0'
- display_amount: "$50.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$50.00"
- currency: USD
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Store Credit
- description:
- type: store_credit
- session_required: false
- source_required: true
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 203 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 204 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods:
- - id: pm_UkLWZg9DAJ
- name: Store Credit
+ parameters: []
+ responses:
+ '200':
+ description: payment session updated
+ content:
+ application/json:
+ example:
+ id: ps_UkLWZg9DAJ
+ status: pending
+ currency: USD
+ external_id: bogus_331c7200fe221193bf414698
+ external_data:
+ client_secret: secret_123
+ customer_external_id:
+ expires_at:
+ amount: '50.0'
+ payment_method_id: pm_UkLWZg9DAJ
+ order_id: or_UkLWZg9DAJ
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Credit Card
description:
- type: store_credit
- session_required: false
+ type: bogus
+ session_required: true
source_required: true
- gift_card:
- id: gc_UkLWZg9DAJ
- code: GIFTCODE1
- status: active
- currency: USD
- amount: '50.0'
- amount_used: '50.0'
- amount_authorized: '0.0'
- amount_remaining: '0.0'
- display_amount: "$50.00"
- display_amount_used: "$50.00"
- display_amount_remaining: "$0.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- market:
schema:
- "$ref": "#/components/schemas/Cart"
+ "$ref": "#/components/schemas/PaymentSession"
+ requestBody:
+ 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
+ "/api/v3/store/carts/{cart_id}/payment_sessions/{id}/complete":
+ 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: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
+ description: Payment session ID
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ patch:
+ summary: Complete payment session
+ tags:
+ - Carts
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Completes a payment session by confirming the payment with the
+ provider. This triggers payment capture/authorization and order completion.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const session = await client.carts.paymentSessions.complete('cart_abc123', 'ps_abc123', {
+ session_result: 'success',
+ }, {
+ token: '<token>',
+ })
+ parameters:
+ - name: Idempotency-Key
+ in: header
+ required: false
+ description: Unique key for request idempotency.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: payment session completed
+ content:
+ application/json:
+ example:
+ id: ps_UkLWZg9DAJ
+ status: completed
+ currency: USD
+ external_id: bogus_2ebf387c2f1e00f23440c181
+ external_data:
+ client_secret: secret_123
+ customer_external_id:
+ expires_at:
+ amount: '110.0'
+ payment_method_id: pm_UkLWZg9DAJ
+ order_id: or_UkLWZg9DAJ
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Credit Card
+ description:
+ type: bogus
+ session_required: true
+ source_required: true
+ schema:
+ "$ref": "#/components/schemas/PaymentSession"
'404':
- description: gift card not found
+ description: payment session not found
content:
application/json:
example:
error:
- code: gift_card_not_found
- message: The Gift Card was not found.
+ code: record_not_found
+ message: Payment session not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ 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
+ "/api/v3/store/carts/{cart_id}/payments":
+ post:
+ summary: Create payment
+ tags:
+ - Carts
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Creates a payment for a non-session payment method (e.g. Check,
+ Cash on Delivery, Bank Transfer). For payment methods that require a session
+ (e.g. Stripe, PayPal), use the payment sessions endpoint instead.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const payment = await client.carts.payments.create('cart_abc123', {
+ payment_method_id: 'pm_abc123',
+ }, {
+ token: '<token>',
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: cart_id
+ in: path
+ required: true
+ description: Cart prefixed ID
+ schema:
+ type: string
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ responses:
+ '201':
+ description: payment created
+ content:
+ application/json:
+ example:
+ id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ response_code:
+ number: P6M3ZHJE
+ amount: '110.0'
+ display_amount: "$110.00"
+ status: checkout
+ source_type:
+ source_id:
+ source:
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: check
+ session_required: false
+ source_required: false
+ schema:
+ "$ref": "#/components/schemas/Payment"
'422':
- description: gift card already redeemed
+ description: session-based payment method
content:
application/json:
example:
error:
- code: gift_card_already_redeemed
- message: The Gift Card has already been redeemed.
+ code: payment_session_required
+ message: This payment method requires a payment session. Use the
+ payment sessions endpoint instead.
schema:
"$ref": "#/components/schemas/ErrorResponse"
requestBody:
@@ -5307,21 +5067,29 @@ paths:
schema:
type: object
properties:
- code:
+ payment_method_id:
type: string
- example: GC-ABCD-1234
- description: Gift card code to apply
+ 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:
- - code
- "/api/v3/store/carts/{cart_id}/gift_cards/{id}":
- delete:
- summary: Remove gift card
+ - payment_method_id
+ "/api/v3/store/carts/{cart_id}/store_credits":
+ post:
+ summary: Apply store credit
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: Removes a previously applied gift card from the cart.
+ description: Applies store credit to the cart during checkout.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -5333,7 +5101,7 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.giftCards.remove('cart_abc123', 'gc_abc123', {
+ const cart = await client.carts.storeCredits.apply('cart_abc123', 10.0, {
token: '<token>',
})
parameters:
@@ -5344,39 +5112,37 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- description: Bearer token for authenticated customers
+ required: true
schema:
type: string
- name: cart_id
in: path
required: true
- description: Cart prefixed ID
+ description: Cart prefixed ID (e.g., cart_abc123)
schema:
type: string
- - name: id
- in: path
- required: true
- description: Gift card prefixed ID (e.g., gc_abc123)
+ - name: x-spree-token
+ in: header
+ required: false
schema:
type: string
- - name: x-spree-token
+ - name: Idempotency-Key
in: header
required: false
- description: Order token for guest access
+ description: Unique key for request idempotency.
schema:
type: string
responses:
'200':
- description: gift card removed
+ description: store credit applied
content:
application/json:
example:
id: cart_UkLWZg9DAJ
market_id:
- number: R375402748
- token: zK6CyYENcBq5VLBnwSXE35w1RrR7o2sTgky
+ number: R903776007
+ token: oPFUDLqngFUNHBsLi5NZyBfVqQFVkab5S48
customer_note:
currency: USD
locale: en
@@ -5397,20 +5163,17 @@ paths:
display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
+ amount_due: '100.0'
+ display_amount_due: "$100.00"
delivery_total: '100.0'
display_delivery_total: "$100.00"
warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
+ store_credit_total: '10.0'
+ display_store_credit_total: "-$10.00"
covered_by_store_credit: false
current_step: address
completed_steps: []
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
+ requirements: []
shipping_eq_billing_address: false
discounts: []
items:
@@ -5418,8 +5181,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1215119
- slug: product-1215119
+ name: Product 1909153
+ slug: product-1909153
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5444,7 +5207,7 @@ paths:
digital_links: []
fulfillments:
- id: ful_UkLWZg9DAJ
- number: H49636801244
+ number: H71098380344
tracking: U10000
tracking_url:
cost: '100.0'
@@ -5473,7 +5236,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: NY
- name: Melvina Gottlieb
+ name: Twanna Stamm
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5502,11 +5265,11 @@ paths:
payments:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
- response_code: 1-SC-20260526161402955039
- number: PIQFGKXI
- amount: '50.0'
- display_amount: "$50.00"
- status: invalid
+ response_code: 1-SC-20260526161430523363
+ number: P1X82P2A
+ amount: '10.0'
+ display_amount: "$10.00"
+ status: checkout
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -5521,7 +5284,7 @@ paths:
payment_method:
id: pm_UkLWZg9DAJ
name: Store Credit
- description:
+ description: Store Credit
type: store_credit
session_required: false
source_required: true
@@ -5530,7 +5293,7 @@ paths:
first_name: John
last_name: Doe
full_name: John Doe
- address1: 219 Lovely Street
+ address1: 320 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -5549,7 +5312,7 @@ paths:
first_name: John
last_name: Doe
full_name: John Doe
- address1: 220 Lovely Street
+ address1: 321 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -5558,207 +5321,50 @@ paths:
country_name: United States of America
country_iso: US
state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Cart"
- "/api/v3/store/customers/me/gift_cards":
- get:
- summary: List gift cards
- tags:
- - Customers
- security:
- - api_key: []
- bearer_auth: []
- description: Returns all gift cards for the authenticated customer
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const giftCards = await client.customer.giftCards.list({}, {
- token: '<token>',
- })
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
- schema:
- type: string
- responses:
- '200':
- description: gift cards found
- content:
- application/json:
- example:
- data:
- - id: gc_UkLWZg9DAJ
- code: 91F1E57C6C99A62C
- status: active
- currency: USD
- amount: '10.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '10.0'
- display_amount: "$10.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$10.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/GiftCard"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
- '401':
- description: unauthorized
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/gift_cards/{id}":
- get:
- summary: Get a gift card
- tags:
- - Customers
- security:
- - api_key: []
- bearer_auth: []
- description: Returns a gift card by its ID
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const giftCard = await client.customer.giftCards.get('gc_abc123', {
- token: '<token>',
- })
- 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: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
- schema:
- type: string
- responses:
- '200':
- description: gift card found
- content:
- application/json:
- example:
- id: gc_UkLWZg9DAJ
- code: 76D77B6CFFA255C8
- status: active
- currency: USD
- amount: '10.0'
- amount_used: '0.0'
- amount_authorized: '0.0'
- amount_remaining: '10.0'
- display_amount: "$10.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$10.00"
- expires_at:
- redeemed_at:
- expired: false
- active: true
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ payment_methods:
+ - id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description: Store Credit
+ type: store_credit
+ session_required: false
+ source_required: true
+ gift_card:
+ market:
schema:
- "$ref": "#/components/schemas/GiftCard"
- '404':
- description: gift card not found
+ "$ref": "#/components/schemas/Cart"
+ '422':
+ description: no store credit available
content:
application/json:
example:
error:
- code: record_not_found
- message: Gift card not found
+ code: processing_error
+ message: User does not have any Store Credits available
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{cart_id}/items":
- post:
- summary: Add item to cart
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ amount:
+ type: number
+ example: 10.0
+ description: Amount to apply (optional - defaults to max available)
+ delete:
+ summary: Remove store credit
tags:
- Carts
security:
- api_key: []
bearer_auth: []
- description: Adds a variant to the cart. Creates a new line item or increases
- quantity if variant already in cart.
+ description: Removes store credit from the cart.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -5770,10 +5376,7 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.items.create('cart_abc123', {
- variant_id: 'variant_abc123',
- quantity: 2,
- }, {
+ const cart = await client.carts.storeCredits.remove('cart_abc123', {
token: '<token>',
})
parameters:
@@ -5784,45 +5387,37 @@ paths:
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
+ required: true
schema:
type: string
- name: cart_id
in: path
required: true
- description: Cart prefixed ID (e.g., cart_abc123)
+ description: Cart prefixed ID
schema:
type: string
- - name: Idempotency-Key
+ - name: x-spree-token
in: header
required: false
- description: Unique key for request idempotency.
schema:
type: string
responses:
- '201':
- description: item added with metadata
+ '200':
+ description: store credit removed
content:
application/json:
example:
id: cart_UkLWZg9DAJ
market_id:
- number: R128024977
- token: snfWbJhSsShSGdMgtj6NVNbk7SVZvg984Xb
+ number: R646602683
+ token: c5RmvpB42n2ZRwYZ246jBJSFzvFgSLjsY5V
customer_note:
currency: USD
locale: en
- total_quantity: 2
- item_total: '29.99'
- display_item_total: "$29.99"
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -5833,14 +5428,14 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '29.99'
- display_total: "$29.99"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '29.99'
- display_amount_due: "$29.99"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
warnings: []
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
@@ -5848,12 +5443,6 @@ paths:
current_step: address
completed_steps: []
requirements:
- - step: address
- field: ship_address
- message: Shipping address is required
- - step: delivery
- field: shipping_method
- message: Select a shipping method for all shipments
- step: payment
field: payment
message: Add a payment method
@@ -5864,8 +5453,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1244584
- slug: product-1244584
+ name: Product 1922421
+ slug: product-1922421
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5888,42 +5477,70 @@ paths:
thumbnail_url:
option_values: []
digital_links: []
- - id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- quantity: 1
- currency: USD
- name: Product 1253628
- slug: product-1253628
- options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '19.99'
- display_total: "$19.99"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H93482247486
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '19.99'
- display_pre_tax_amount: "$19.99"
- discounted_amount: '19.99'
- display_discounted_amount: "$19.99"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments: []
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Carolina Kovacek
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_UkLWZg9DAJ
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '100.0'
+ total: '100.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$100.00"
+ display_total: "$100.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
payments: []
billing_address:
id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 234 Lovely Street
+ address1: 328 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -5938,52 +5555,39 @@ paths:
is_default_shipping: false
state_name: New York
shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 329 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
payment_methods: []
gift_card:
market:
schema:
"$ref": "#/components/schemas/Cart"
- '404':
- description: variant not found
- content:
- application/json:
- example:
- error:
- code: variant_not_found
- message: Variant not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
- "/api/v3/store/carts/{cart_id}/items/{id}":
- patch:
- summary: Update line item quantity
+ "/api/v3/store/orders/{id}":
+ get:
+ summary: Get an order
tags:
- - Carts
+ - Orders
security:
- api_key: []
bearer_auth: []
- description: Updates the quantity of a line item in the cart
+ description: Returns a single completed order by prefixed ID. Accessible via
+ JWT (authenticated users) or order token header (guests).
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -5995,9 +5599,7 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.items.update('cart_abc123', 'li_abc123', {
- quantity: 5,
- }, {
+ const order = await client.orders.get('or_abc123', {}, {
token: '<token>',
})
parameters:
@@ -6009,42 +5611,53 @@ paths:
- name: Authorization
in: header
required: false
+ description: Bearer token for authenticated customers
schema:
type: string
- - name: cart_id
+ - name: id
in: path
required: true
- description: Cart prefixed ID
+ description: Order prefixed ID
schema:
type: string
- - name: id
- in: path
- required: true
- description: Line item ID
+ - name: x-spree-token
+ in: header
+ required: false
+ description: Order token for guest access
schema:
type: string
- - name: x-spree-token
- in: header
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (items, fulfillments,
+ payments, discounts, billing_address, shipping_address, gift_card). Use
+ "none" to skip associations.
+ schema:
+ type: string
+ - name: fields
+ in: query
required: false
+ description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
+ id is always included.
schema:
type: string
responses:
'200':
- description: metadata updated on line item
+ description: order found (guest via order token)
content:
application/json:
example:
- id: cart_UkLWZg9DAJ
+ id: or_UkLWZg9DAJ
market_id:
- number: R216067679
- token: HBo9TtU6Kra7Pkqey8Rhw5WW93WSsLFKbcb
+ channel_id: ch_UkLWZg9DAJ
+ number: R528526445
customer_note:
currency: USD
locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
discount_total: '0.0'
@@ -6055,36 +5668,28 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
gift_card_total: '0.0'
display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- warnings: []
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ fulfillment_status:
+ payment_status:
+ completed_at: '2026-05-26T16:14:12.058Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: address
- field: ship_address
- message: Shipping address is required
- - step: delivery
- field: shipping_method
- message: Select a shipping method for all shipments
- shipping_eq_billing_address: false
discounts: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1289337
- slug: product-1289337
+ name: Product 1325879
+ slug: product-1325879
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -6107,14 +5712,70 @@ paths:
thumbnail_url:
option_values: []
digital_links: []
- fulfillments: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H26728427796
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Maida Rogahn
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_gbHJdmfrXB
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '10.0'
+ total: '10.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$10.00"
+ display_total: "$10.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
payments: []
billing_address:
- id: addr_EfhxLZ9ck8
+ id: addr_UkLWZg9DAJ
first_name: John
last_name: Doe
full_name: John Doe
- address1: 243 Lovely Street
+ address1: 256 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -6129,35 +5790,47 @@ paths:
is_default_shipping: false
state_name: New York
shipping_address:
- payment_methods: []
+ id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 257 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
gift_card:
market:
schema:
- "$ref": "#/components/schemas/Cart"
- requestBody:
- 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.
- delete:
- summary: Remove line item from cart
+ "$ref": "#/components/schemas/Order"
+ '404':
+ description: incomplete order not accessible
+ content:
+ application/json:
+ example:
+ error:
+ code: order_not_found
+ message: Order not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/customers/me/addresses":
+ get:
+ summary: List customer addresses
tags:
- - Carts
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Removes a line item from the cart
+ description: Returns all addresses in the customer address book
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6169,7 +5842,7 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.items.delete('cart_abc123', 'li_abc123', {
+ const addresses = await client.customer.addresses.list({}, {
token: '<token>',
})
parameters:
@@ -6180,87 +5853,38 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- schema:
- type: string
- - name: cart_id
- in: path
- required: true
- description: Cart prefixed ID
- schema:
- type: string
- - name: id
- in: path
required: true
schema:
type: string
- - name: x-spree-token
- in: header
- required: false
- schema:
- type: string
- responses:
- '200':
- description: line item removed, returns updated cart
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R262930205
- token: 6F91AsEuASghgSqqpwTgtCCF84SEMYm1ozP
- customer_note:
- currency: USD
- locale: en
- total_quantity: 0
- item_total: '0.0'
- display_item_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '0.0'
- display_amount_due: "$0.00"
- delivery_total: '0.0'
- display_delivery_total: "$0.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: cart
- field: line_items
- message: Add at least one item to your cart
- - step: address
- field: ship_address
- message: Shipping address is required
- - step: delivery
- field: shipping_method
- message: Select a shipping method for all shipments
- shipping_eq_billing_address: false
- discounts: []
- items: []
- fulfillments: []
- payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: addresses found
+ content:
+ application/json:
+ example:
+ data:
+ - id: addr_EfhxLZ9ck8
first_name: John
last_name: Doe
full_name: John Doe
- address1: 246 Lovely Street
+ address1: 72 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -6274,30 +5898,79 @@ paths:
is_default_billing: false
is_default_shipping: false
state_name: New York
- shipping_address:
- payment_methods: []
- gift_card:
- market:
+ - id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 71 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: true
+ is_default_shipping: false
+ state_name: New York
+ - id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 70 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: true
+ state_name: New York
+ meta:
+ page: 1
+ limit: 25
+ count: 3
+ pages: 1
+ from: 1
+ to: 3
+ in: 3
+ previous:
+ next:
schema:
- "$ref": "#/components/schemas/Cart"
- '404':
- description: line item not found
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Address"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized
content:
application/json:
example:
error:
- code: line_item_not_found
- message: Line item not found
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/locales":
- get:
- summary: List supported locales
+ post:
+ summary: Create an address
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Returns locales supported by the store (derived from markets)
+ bearer_auth: []
+ description: Adds a new address to the customer address book
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6309,59 +5982,146 @@ paths:
publishableKey: '<api-key>',
})
- const locales = await client.locales.list()
+ const address = await client.customer.addresses.create({
+ first_name: 'John',
+ last_name: 'Doe',
+ address1: '123 Main St',
+ city: 'New York',
+ postal_code: '10001',
+ country_iso: 'US',
+ state_abbr: 'NY',
+ phone: '+1 555 123 4567',
+ }, {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ - name: Authorization
+ in: header
+ required: true
schema:
type: string
responses:
- '200':
- description: locales found
+ '201':
+ description: address created
content:
application/json:
example:
- data:
- - code: de
- name: de
- - code: en
- name: English (US)
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 123 Main St
+ address2:
+ postal_code: '10001'
+ city: New York
+ phone: "+1 555 123 4567"
+ company:
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/Locale"
- required:
- - data
- '401':
- description: unauthorized
+ "$ref": "#/components/schemas/Address"
+ '422':
+ description: validation error
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: validation_error
+ message: First Name can't be blank, Last Name can't be blank, Address
+ can't be blank, City can't be blank, Country can't be blank, and
+ Zip Code can't be blank
+ details:
+ firstname:
+ - can't be blank
+ lastname:
+ - can't be blank
+ address1:
+ - can't be blank
+ city:
+ - can't be blank
+ country:
+ - can't be blank
+ zipcode:
+ - can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/markets":
+ requestBody:
+ 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_iso:
+ type: string
+ example: US
+ description: ISO 3166-1 alpha-2 country code (e.g., "US", "DE")
+ state_abbr:
+ 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_iso
+ "/api/v3/store/customers/me/addresses/{id}":
get:
- summary: List markets
+ summary: Get an address
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Returns all markets for the current store with their countries,
- currency, locales, and tax configuration.
+ bearer_auth: []
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6373,13 +6133,25 @@ paths:
publishableKey: '<api-key>',
})
- const markets = await client.markets.list()
+ const address = await client.customer.addresses.get('addr_abc123', {
+ token: '<token>',
+ })
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: fields
in: query
required: false
@@ -6389,78 +6161,47 @@ paths:
type: string
responses:
'200':
- description: markets found
+ description: address found
content:
application/json:
example:
- data:
- - id: mkt_UkLWZg9DAJ
- name: North America
- currency: USD
- default_locale: en
- tax_inclusive: false
- default: true
- country_isos:
- - US
- supported_locales:
- - en
- - es
- countries:
- - iso: US
- iso3: USA
- name: United States of America
- states_required: true
- zipcode_required: true
- - id: mkt_gbHJdmfrXB
- name: Europe
- currency: EUR
- default_locale: de
- tax_inclusive: true
- default: false
- country_isos:
- - DE
- - FR
- supported_locales:
- - de
- - en
- - fr
- countries:
- - iso: DE
- iso3: IS66
- name: Germany
- states_required: false
- zipcode_required: true
- - iso: FR
- iso3: IS67
- name: France
- states_required: false
- zipcode_required: true
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 84 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
schema:
- type: object
- properties:
- data:
- type: array
- required:
- - data
- '401':
- description: unauthorized
+ "$ref": "#/components/schemas/Address"
+ '404':
+ description: address not found
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: record_not_found
+ message: Address not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/markets/{id}":
- get:
- summary: Get a market
+ patch:
+ summary: Update an address
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Returns a single market by prefixed ID with its countries, currency,
- locales, and tax configuration.
+ bearer_auth: []
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6472,78 +6213,86 @@ paths:
publishableKey: '<api-key>',
})
- const market = await client.markets.get('mkt_xxx')
+ const address = await client.customer.addresses.update('addr_abc123', {
+ city: 'Los Angeles',
+ }, {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: id
- in: path
+ - name: Authorization
+ in: header
required: true
- description: Market prefixed ID (e.g., "mkt_k5nR8xLq")
schema:
type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ - name: id
+ in: path
+ required: true
schema:
type: string
responses:
'200':
- description: market found
- content:
- application/json:
- example:
- id: mkt_gbHJdmfrXB
- name: Europe
- currency: EUR
- default_locale: de
- tax_inclusive: true
- default: false
- country_isos:
- - DE
- - FR
- supported_locales:
- - de
- - en
- - fr
- countries:
- - iso: DE
- iso3: IS70
- name: Germany
- states_required: false
- zipcode_required: true
- - iso: FR
- iso3: IS71
- name: France
- states_required: false
- zipcode_required: true
- schema:
- type: object
- '404':
- description: market not found
+ description: address updated
content:
application/json:
example:
- error:
- code: record_not_found
- message: Market not found
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 90 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: Los Angeles
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/markets/resolve":
- get:
- summary: Resolve market by country
+ "$ref": "#/components/schemas/Address"
+ requestBody:
+ 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
+ delete:
+ summary: Delete an address
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Determine which market applies for a given country ISO code. Useful
- for auto-selecting the correct currency and locale when a customer's location
- is known.
+ bearer_auth: []
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6555,77 +6304,47 @@ paths:
publishableKey: '<api-key>',
})
- const market = await client.markets.resolve('DE')
+ await client.customer.addresses.delete('addr_abc123', {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: country
- in: query
+ - name: Authorization
+ in: header
required: true
- description: Country ISO 3166-1 alpha-2 code (e.g., "DE", "US")
schema:
type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ - name: id
+ in: path
+ required: true
schema:
type: string
- responses:
- '200':
- description: market resolved
- content:
- application/json:
- example:
- id: mkt_gbHJdmfrXB
- name: Europe
- currency: EUR
- default_locale: de
- tax_inclusive: true
- default: false
- country_isos:
- - DE
- - FR
- supported_locales:
- - de
- - en
- - fr
- countries:
- - iso: DE
- iso3: IS74
- name: Germany
- states_required: false
- zipcode_required: true
- - iso: FR
- iso3: IS75
- name: France
- states_required: false
- zipcode_required: true
- schema:
- type: object
+ responses:
+ '204':
+ description: address deleted
'404':
- description: no market for country
+ description: address not found
content:
application/json:
example:
error:
code: record_not_found
- message: Country not found
+ message: Address not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/markets/{market_id}/countries":
+ "/api/v3/store/customers/me/credit_cards":
get:
- summary: List countries in a market
+ summary: List saved credit cards
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Returns countries belonging to a specific market. Use this for
- address form country dropdowns during checkout.
+ bearer_auth: []
+ description: Returns all saved credit cards for the authenticated customer
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6637,19 +6356,30 @@ paths:
publishableKey: '<api-key>',
})
- const countries = await client.markets.countries.list('mkt_xxx')
+ const cards = await client.customer.creditCards.list({}, {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: market_id
- in: path
+ - name: Authorization
+ in: header
required: true
- description: Market prefixed ID
schema:
type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
- name: fields
in: query
required: false
@@ -6659,37 +6389,57 @@ paths:
type: string
responses:
'200':
- description: countries found
+ description: credit cards found
content:
application/json:
example:
data:
- - iso: FR
- iso3: IS79
- name: France
- states_required: false
- zipcode_required: true
- - iso: DE
- iso3: IS78
- name: Germany
- states_required: false
- zipcode_required: true
+ - id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
schema:
type: object
properties:
data:
type: array
- required:
- - data
- "/api/v3/store/markets/{market_id}/countries/{id}":
+ items:
+ "$ref": "#/components/schemas/CreditCard"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/customers/me/credit_cards/{id}":
get:
- summary: Get a country in a market
+ summary: Get a credit card
tags:
- - Markets
+ - Customers
security:
- api_key: []
- description: Returns a single country by ISO code within a market. Supports
- ?expand=states for address forms.
+ bearer_auth: []
+ description: Returns a saved credit card by its ID
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6701,23 +6451,23 @@ paths:
publishableKey: '<api-key>',
})
- const country = await client.markets.countries.get('mkt_xxx', 'DE')
+ const card = await client.customer.creditCards.get('card_abc123', {
+ token: '<token>',
+ })
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: market_id
- in: path
+ - name: Authorization
+ in: header
required: true
- description: Market prefixed ID
schema:
type: string
- name: id
in: path
required: true
- description: Country ISO 3166-1 alpha-2 code (e.g., "DE")
schema:
type: string
- name: fields
@@ -6729,62 +6479,38 @@ paths:
type: string
responses:
'200':
- description: country found
+ description: credit card found
content:
application/json:
example:
- iso: US
- iso3: USA
- name: United States of America
- states_required: true
- zipcode_required: true
+ id: card_UkLWZg9DAJ
+ brand: visa
+ last4: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: false
+ gateway_payment_profile_id:
schema:
- type: object
+ "$ref": "#/components/schemas/CreditCard"
'404':
- description: country not in market
+ description: credit card not found
content:
application/json:
example:
error:
code: record_not_found
- message: Country not found
+ message: Credit card not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/newsletter_subscribers":
- post:
- summary: Subscribe to the newsletter
+ delete:
+ summary: Delete a credit card
tags:
- - Newsletter Subscribers
+ - Customers
security:
- api_key: []
- description: |
- Subscribes an email address to the newsletter for the current store.
-
- Behavior:
-
- - If the email is already verified for this store, the existing subscription is returned unchanged.
- - If the request is unauthenticated (guest), the subscription is created in an unverified state
- and two events are published: `newsletter_subscriber.subscription_requested` (carrying the
- `verification_token` and the validated `redirect_url`, intended for headless storefronts that
- want to send the confirmation email themselves via a webhook handler) and the legacy
- `newsletter_subscriber.subscribed` lifecycle event (which the bundled `spree_emails` package
- listens to and uses to send a default confirmation email). The confirmation link should point
- at `redirect_url?token=<verification_token>` and call `POST /newsletter_subscribers/verify`
- when the user clicks it.
- - If the request is authenticated via JWT and the customer's email matches the subscribed email,
- the subscription is auto-verified and no events are fired — the JWT already proves email
- ownership, so no confirmation email is needed.
-
- The optional `redirect_url` is where the verification token should land on the storefront. The
- server does not return a validation error when the URL is outside the store's
- [Allowed Origins](/developer/core-concepts/allowed-origins); instead, the URL is silently
- omitted from the webhook payload (secure-by-default). When no allow-list is configured on the
- store, the URL is also omitted. Callers therefore receive the same 201 regardless, and the
- webhook handler should fall back to the store's storefront URL when `redirect_url` is missing
- from the payload.
-
- Newsletter consent is preserved across registration: if a guest subscribes and later registers
- with the same email, the existing subscriber record is reused.
+ bearer_auth: []
+ description: Removes a saved credit card from the customer account
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6796,9 +6522,8 @@ paths:
publishableKey: '<api-key>',
})
- const subscriber = await client.newsletterSubscribers.create({
- email: '[email protected]',
- redirect_url: 'https://your-store.com/newsletter/confirm',
+ await client.customer.creditCards.delete('card_abc123', {
+ token: '<token>',
})
parameters:
- name: x-spree-api-key
@@ -6808,73 +6533,37 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- description: Optional Bearer JWT — when present, links the subscription to
- that customer
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
schema:
type: string
responses:
- '201':
- description: auto-verified when JWT matches subscribed email
- content:
- application/json:
- example:
- id: sub_UkLWZg9DAJ
- created_at: '2026-05-26T16:14:11.183Z'
- updated_at: '2026-05-26T16:14:11.186Z'
- verified: true
- verified_at: '2026-05-26T16:14:11Z'
- customer_id: cus_UkLWZg9DAJ
- schema:
- "$ref": "#/components/schemas/NewsletterSubscriber"
- '422':
- description: invalid email format
+ '204':
+ description: credit card deleted
+ '404':
+ description: credit card not found
content:
application/json:
example:
error:
- code: validation_error
- message: Email is invalid
- details:
- email:
- - is invalid
+ code: record_not_found
+ message: Credit card not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- format: email
- 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:
- - email
- "/api/v3/store/newsletter_subscribers/verify":
- post:
- summary: Verify a newsletter subscription
+ "/api/v3/store/customers/me/orders":
+ get:
+ summary: List orders
tags:
- - Newsletter Subscribers
+ - Customers
security:
- api_key: []
- description: |
- Confirms a pending newsletter subscription using the verification token sent by email.
-
- After successful verification:
- - The subscriber record is marked verified.
- - If the subscription is associated with a customer, that customer's `accepts_email_marketing`
- flag is set to `true`.
+ bearer_auth: []
+ description: Returns a paginated list of completed orders for the authenticated
+ customer.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6886,62 +6575,312 @@ paths:
publishableKey: '<api-key>',
})
- const subscriber = await client.newsletterSubscribers.verify({
- token: 'abc123def456',
- })
+ const orders = await client.customer.orders.list(
+ {
+ completed_at_gt: '2026-01-01',
+ sort: '-completed_at',
+ },
+ { token: '<token>' },
+ )
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 (default: 1)'
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ description: 'Number of results per page (default: 25, max: 100)'
+ schema:
+ type: integer
+ - name: sort
+ in: query
+ required: false
+ description: 'Sort order. Prefix with - for descending. Values: completed_at,
+ -completed_at, total, -total, number, -number'
+ schema:
+ type: string
+ - name: q[completed_at_gt]
+ in: query
+ required: false
+ description: Filter by completed after date (ISO 8601)
+ schema:
+ type: string
+ - name: q[completed_at_lt]
+ in: query
+ required: false
+ description: Filter by completed before date (ISO 8601)
+ schema:
+ type: string
+ - name: q[number_eq]
+ in: query
+ required: false
+ description: Filter by exact order number (e.g., R123456)
+ schema:
+ type: string
+ - name: q[state_eq]
+ in: query
+ required: false
+ description: Filter by order state (complete, returned, canceled)
+ schema:
+ type: string
+ - name: q[payment_state_eq]
+ in: query
+ required: false
+ description: Filter by payment state (paid, balance_due, credit_owed, void,
+ failed)
+ schema:
+ type: string
+ - name: q[total_gteq]
+ in: query
+ required: false
+ description: Filter by minimum total
+ schema:
+ type: number
+ - name: q[total_lteq]
+ in: query
+ required: false
+ description: Filter by maximum total
+ schema:
+ type: number
+ - name: expand
+ in: query
+ required: false
+ description: Comma-separated associations to expand (items, fulfillments,
+ payments, discounts, billing_address, shipping_address, gift_card). Use
+ "none" to skip associations.
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., total,amount_due,item_count).
+ id is always included.
+ schema:
+ type: string
responses:
'200':
- description: subscription verified
+ description: orders listed
content:
application/json:
example:
- id: sub_UkLWZg9DAJ
- created_at: '2026-05-26T16:14:11.236Z'
- updated_at: '2026-05-26T16:14:11.255Z'
- verified: true
- verified_at: '2026-05-26T16:14:11Z'
- customer_id:
+ data:
+ - id: or_UkLWZg9DAJ
+ market_id:
+ channel_id: ch_UkLWZg9DAJ
+ number: R096824993
+ customer_note:
+ currency: USD
+ locale: en
+ total_quantity: 1
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ gift_card_total: '0.0'
+ display_gift_card_total: "$0.00"
+ amount_due: '110.0'
+ display_amount_due: "$110.00"
+ delivery_total: '100.0'
+ display_delivery_total: "$100.00"
+ fulfillment_status:
+ payment_status:
+ completed_at: '2026-05-26T16:13:49.079Z'
+ store_credit_total: '0.0'
+ display_store_credit_total: "$0.00"
+ covered_by_store_credit: false
+ discounts: []
+ items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 1016128
+ slug: product-1016128
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ fulfillments:
+ - id: ful_UkLWZg9DAJ
+ number: H70742962050
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ total: '100.0'
+ display_total: "$100.00"
+ discount_total: '0.0'
+ display_discount_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ status: pending
+ fulfillment_type: shipping
+ fulfilled_at:
+ items:
+ - item_id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: NY
+ name: Britany Halvorson
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: NY
+ delivery_rates:
+ - id: dr_gbHJdmfrXB
+ delivery_method_id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: '10.0'
+ total: '10.0'
+ additional_tax_total: '0.0'
+ included_tax_total: '0.0'
+ tax_total: '0.0'
+ display_cost: "$10.00"
+ display_total: "$10.00"
+ display_additional_tax_total: "$0.00"
+ display_included_tax_total: "$0.00"
+ display_tax_total: "$0.00"
+ delivery_method:
+ id: dm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ billing_address:
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 147 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 148 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ gift_card:
+ market:
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
schema:
- "$ref": "#/components/schemas/NewsletterSubscriber"
- '422':
- description: missing token
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Order"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ required:
+ - data
+ - meta
+ '401':
+ description: unauthorized
content:
application/json:
example:
error:
- code: parameter_missing
- message: token is required
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- example: abc123def456
- description: Verification token from the confirmation email
- required:
- - token
- "/api/v3/store/orders/{id}":
+ "/api/v3/store/customers/me/orders/{id}":
get:
summary: Get an order
tags:
- - Orders
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Returns a single completed order by prefixed ID. Accessible via
- JWT (authenticated users) or order token header (guests).
+ description: Returns a single completed order for the authenticated customer.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -6953,7 +6892,7 @@ paths:
publishableKey: '<api-key>',
})
- const order = await client.orders.get('or_abc123', {}, {
+ const order = await client.customer.orders.get('or_abc123', {}, {
token: '<token>',
})
parameters:
@@ -6964,8 +6903,7 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- description: Bearer token for authenticated customers
+ required: true
schema:
type: string
- name: id
@@ -6974,12 +6912,6 @@ paths:
description: Order prefixed ID
schema:
type: string
- - name: x-spree-token
- in: header
- required: false
- description: Order token for guest access
- schema:
- type: string
- name: expand
in: query
required: false
@@ -6997,15 +6929,15 @@ paths:
type: string
responses:
'200':
- description: order found (guest via order token)
+ description: order found
content:
application/json:
example:
id: or_UkLWZg9DAJ
market_id:
channel_id: ch_UkLWZg9DAJ
- number: R528526445
+ number: R695830260
customer_note:
currency: USD
locale: en
@@ -7032,7 +6964,7 @@ paths:
display_delivery_total: "$100.00"
fulfillment_status:
payment_status:
- completed_at: '2026-05-26T16:14:12.058Z'
+ completed_at: '2026-05-26T16:13:49.771Z'
store_credit_total: '0.0'
display_store_credit_total: "$0.00"
covered_by_store_credit: false
@@ -7042,8 +6974,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1325879
- slug: product-1325879
+ name: Product 1033099
+ slug: product-1033099
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -7068,7 +7000,7 @@ paths:
digital_links: []
fulfillments:
- id: ful_UkLWZg9DAJ
- number: H26728427796
+ number: H08221240082
tracking: U10000
tracking_url:
cost: '100.0'
@@ -7097,7 +7029,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: NY
- name: Maida Rogahn
+ name: Aleen Reynolds
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -7125,11 +7057,227 @@ paths:
code: UPS_GROUND
payments: []
billing_address:
- id: addr_UkLWZg9DAJ
+ id: addr_EfhxLZ9ck8
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 153 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ shipping_address:
+ id: addr_VqXmZF31wY
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 154 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: false
+ state_name: New York
+ gift_card:
+ market:
+ schema:
+ "$ref": "#/components/schemas/Order"
+ '404':
+ description: order belongs to another user
+ content:
+ application/json:
+ example:
+ error:
+ code: order_not_found
+ message: Order not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/customers":
+ post:
+ summary: Register a new customer
+ tags:
+ - Customers
+ security:
+ - api_key: []
+ description: Creates a new customer account and returns a JWT token
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const auth = await client.customers.create({
+ email: '[email protected]',
+ password: 'password123',
+ password_confirmation: 'password123',
+ first_name: 'John',
+ last_name: 'Doe',
+ phone: '+1234567890',
+ accepts_email_marketing: true,
+ metadata: { source: 'storefront' },
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ '201':
+ description: registration successful
+ content:
+ application/json:
+ example:
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjlmZGNlNTdjLTY2NGQtNGZkNy1hOTU2LWQ1MjEzZjdhMjljYSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc5ODE1NjMwfQ.vLRThKiR034rnZQYwpQGrIOeQSdrYNKnFVJZ86pCuUo
+ refresh_token: GVssZP2L5Zk7uKQzTmwSQ4i5
+ user:
+ id: cus_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ phone: "+1234567890"
+ accepts_email_marketing: true
+ full_name: John Doe
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses: []
+ default_billing_address:
+ default_shipping_address:
+ schema:
+ "$ref": "#/components/schemas/AuthResponse"
+ '422':
+ description: email already taken
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Email has already been taken
+ details:
+ email:
+ - has already been taken
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ format: email
+ 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:
+ - email
+ - password
+ "/api/v3/store/customers/me":
+ get:
+ summary: Get current customer profile
+ tags:
+ - Customers
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Returns the profile of the currently authenticated customer
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const customer = await client.customer.get({
+ token: '<token>',
+ })
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ description: Bearer JWT token
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: profile found
+ content:
+ application/json:
+ example:
+ id: cus_UkLWZg9DAJ
+ first_name: Catarina
+ last_name: Padberg
+ phone: 555-555-0199
+ accepts_email_marketing: false
+ full_name: Catarina Padberg
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses:
+ - id: addr_gbHJdmfrXB
first_name: John
last_name: Doe
full_name: John Doe
- address1: 256 Lovely Street
+ address1: 160 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -7140,15 +7288,14 @@ paths:
state_text: NY
state_abbr: NY
quick_checkout: false
- is_default_billing: false
+ is_default_billing: true
is_default_shipping: false
state_name: New York
- shipping_address:
- id: addr_gbHJdmfrXB
+ - id: addr_UkLWZg9DAJ
first_name: John
last_name: Doe
full_name: John Doe
- address1: 257 Lovely Street
+ address1: 159 Lovely Street
address2: Northwest
postal_code: '10118'
city: New York
@@ -7160,33 +7307,66 @@ paths:
state_abbr: NY
quick_checkout: false
is_default_billing: false
+ is_default_shipping: true
+ state_name: New York
+ default_billing_address:
+ id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 160 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: true
is_default_shipping: false
state_name: New York
- gift_card:
- market:
+ default_shipping_address:
+ id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 159 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: true
+ state_name: New York
schema:
- "$ref": "#/components/schemas/Order"
- '404':
- description: incomplete order not accessible
+ "$ref": "#/components/schemas/Customer"
+ '401':
+ description: unauthorized - invalid token
content:
application/json:
example:
error:
- code: order_not_found
- message: Order not found
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{cart_id}/payment_sessions":
- post:
- summary: Create payment session
+ patch:
+ summary: Update current customer profile
tags:
- - Carts
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Creates a new payment session for the cart. Delegates to the payment
- gateway to initialize a provider-specific session (e.g. Stripe PaymentIntent,
- Adyen session, PayPal order).
+ description: Updates the profile of the currently authenticated customer
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -7198,8 +7378,10 @@ paths:
publishableKey: '<api-key>',
})
- const session = await client.carts.paymentSessions.create('cart_abc123', {
- payment_method_id: 'pm_abc123',
+ const customer = await client.customer.update({
+ first_name: 'John',
+ last_name: 'Doe',
+ metadata: { preferred_contact: 'email' },
}, {
token: '<token>',
})
@@ -7211,173 +7393,155 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- description: Bearer token for authenticated customers
- schema:
- type: string
- - name: cart_id
- in: path
required: true
- description: Cart prefixed ID (e.g., cart_abc123)
- schema:
- type: string
- - name: x-spree-token
- in: header
- required: false
- description: Order token for guest access
- schema:
- type: string
- - name: Idempotency-Key
- in: header
- required: false
- description: Unique key for request idempotency.
schema:
type: string
- responses:
- '201':
- description: payment session created
- content:
- application/json:
- example:
- id: ps_gbHJdmfrXB
- status: pending
- currency: USD
- external_id: bogus_7d70cfacf0ae7492cf904547
- external_data:
- client_secret: bogus_secret_ede104f24aa5154c
- customer_external_id:
- expires_at:
- amount: '110.0'
- payment_method_id: pm_UkLWZg9DAJ
- order_id: or_UkLWZg9DAJ
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Credit Card
- description:
- type: bogus
- session_required: true
- source_required: true
- schema:
- "$ref": "#/components/schemas/PaymentSession"
- requestBody:
- 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
- "/api/v3/store/carts/{cart_id}/payment_sessions/{id}":
- 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: cart_id
- in: path
- required: true
- description: Cart prefixed ID
- schema:
- type: string
- - name: id
- in: path
- required: true
- description: Payment session ID
- schema:
- type: string
- - name: x-spree-token
- in: header
- required: false
- description: Order token for guest access
- schema:
- type: string
- get:
- summary: Get payment session
- tags:
- - Carts
- security:
- - api_key: []
- bearer_auth: []
- description: Returns a single payment session with its current status and provider
- data.
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const session = await client.carts.paymentSessions.get('cart_abc123', 'ps_abc123', {
- token: '<token>',
- })
responses:
'200':
- description: payment session found
+ description: profile updated
content:
application/json:
example:
- id: ps_UkLWZg9DAJ
- status: pending
- currency: USD
- external_id: bogus_4c7d24178351b3d5952b3cf5
- external_data:
- client_secret: secret_123
- customer_external_id:
- expires_at:
- amount: '110.0'
- payment_method_id: pm_UkLWZg9DAJ
- order_id: or_UkLWZg9DAJ
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Credit Card
- description:
- type: bogus
- session_required: true
- source_required: true
+ id: cus_UkLWZg9DAJ
+ first_name: Updated
+ last_name: Name
+ phone: 555-555-0199
+ accepts_email_marketing: false
+ full_name: Updated Name
+ available_store_credit_total: '0'
+ display_available_store_credit_total: "$0.00"
+ addresses:
+ - id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 162 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: true
+ is_default_shipping: false
+ state_name: New York
+ - id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 161 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: true
+ state_name: New York
+ default_billing_address:
+ id: addr_gbHJdmfrXB
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 162 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: true
+ is_default_shipping: false
+ state_name: New York
+ default_shipping_address:
+ id: addr_UkLWZg9DAJ
+ first_name: John
+ last_name: Doe
+ full_name: John Doe
+ address1: 161 Lovely Street
+ address2: Northwest
+ postal_code: '10118'
+ city: New York
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: NY
+ state_abbr: NY
+ quick_checkout: false
+ is_default_billing: false
+ is_default_shipping: true
+ state_name: New York
schema:
- "$ref": "#/components/schemas/PaymentSession"
- '404':
- description: payment session not found
+ "$ref": "#/components/schemas/Customer"
+ '422':
+ description: validation error
content:
application/json:
example:
error:
- code: record_not_found
- message: Payment session not found
+ code: validation_error
+ message: Email can't be blank
+ details:
+ email:
+ - can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update payment session
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ first_name:
+ type: string
+ example: John
+ last_name:
+ type: string
+ example: Doe
+ email:
+ type: string
+ format: email
+ 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
+ "/api/v3/store/customers/me/gift_cards":
+ get:
+ summary: List gift cards
tags:
- - Carts
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Updates a payment session. Delegates to the payment gateway to
- sync changes with the provider.
+ description: Returns all gift cards for the authenticated customer
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -7389,91 +7553,97 @@ paths:
publishableKey: '<api-key>',
})
- const session = await client.carts.paymentSessions.update('cart_abc123', 'ps_abc123', {
- amount: '50.00',
- }, {
+ const giftCards = await client.customer.giftCards.list({}, {
token: '<token>',
})
- parameters: []
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
responses:
'200':
- description: payment session updated
+ description: gift cards found
content:
application/json:
example:
- id: ps_UkLWZg9DAJ
- status: pending
- currency: USD
- external_id: bogus_331c7200fe221193bf414698
- external_data:
- client_secret: secret_123
- customer_external_id:
- expires_at:
- amount: '50.0'
- payment_method_id: pm_UkLWZg9DAJ
- order_id: or_UkLWZg9DAJ
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Credit Card
- description:
- type: bogus
- session_required: true
- source_required: true
+ data:
+ - id: gc_UkLWZg9DAJ
+ code: 91F1E57C6C99A62C
+ status: active
+ currency: USD
+ amount: '10.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '10.0'
+ display_amount: "$10.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$10.00"
+ expires_at:
+ redeemed_at:
+ expired: false
+ active: true
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
schema:
- "$ref": "#/components/schemas/PaymentSession"
- requestBody:
- 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
- "/api/v3/store/carts/{cart_id}/payment_sessions/{id}/complete":
- 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: cart_id
- in: path
- required: true
- description: Cart prefixed ID
- schema:
- type: string
- - name: id
- in: path
- required: true
- description: Payment session ID
- schema:
- type: string
- - name: x-spree-token
- in: header
- required: false
- description: Order token for guest access
- schema:
- type: string
- patch:
- summary: Complete payment session
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/GiftCard"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/customers/me/gift_cards/{id}":
+ get:
+ summary: Get a gift card
tags:
- - Carts
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Completes a payment session by confirming the payment with the
- provider. This triggers payment capture/authorization and order completion.
+ description: Returns a gift card by its ID
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -7485,66 +7655,65 @@ paths:
publishableKey: '<api-key>',
})
- const session = await client.carts.paymentSessions.complete('cart_abc123', 'ps_abc123', {
- session_result: 'success',
- }, {
+ const giftCard = await client.customer.giftCards.get('gc_abc123', {
token: '<token>',
})
parameters:
- - name: Idempotency-Key
+ - 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: fields
+ in: query
required: false
- description: Unique key for request idempotency.
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
'200':
- description: payment session completed
+ description: gift card found
content:
application/json:
example:
- id: ps_UkLWZg9DAJ
- status: completed
+ id: gc_UkLWZg9DAJ
+ code: 76D77B6CFFA255C8
+ status: active
currency: USD
- external_id: bogus_2ebf387c2f1e00f23440c181
- external_data:
- client_secret: secret_123
- customer_external_id:
+ amount: '10.0'
+ amount_used: '0.0'
+ amount_authorized: '0.0'
+ amount_remaining: '10.0'
+ display_amount: "$10.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$10.00"
expires_at:
- amount: '110.0'
- payment_method_id: pm_UkLWZg9DAJ
- order_id: or_UkLWZg9DAJ
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Credit Card
- description:
- type: bogus
- session_required: true
- source_required: true
+ redeemed_at:
+ expired: false
+ active: true
schema:
- "$ref": "#/components/schemas/PaymentSession"
+ "$ref": "#/components/schemas/GiftCard"
'404':
- description: payment session not found
+ description: gift card not found
content:
application/json:
example:
error:
code: record_not_found
- message: Payment session not found
+ message: Gift card not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- 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
"/api/v3/store/customers/me/payment_setup_sessions":
post:
summary: Create payment setup session
@@ -7804,17 +7973,16 @@ paths:
external_data:
type: object
description: Provider-specific completion data
- "/api/v3/store/carts/{cart_id}/payments":
- post:
- summary: Create payment
+ "/api/v3/store/customers/me/store_credits":
+ get:
+ summary: List store credits
tags:
- - Carts
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Creates a payment for a non-session payment method (e.g. Check,
- Cash on Delivery, Bank Transfer). For payment methods that require a session
- (e.g. Stripe, PayPal), use the payment sessions endpoint instead.
+ description: Returns store credits for the authenticated customer, filtered
+ by current store and currency. Supports Ransack filtering.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -7826,9 +7994,7 @@ paths:
publishableKey: '<api-key>',
})
- const payment = await client.carts.payments.create('cart_abc123', {
- payment_method_id: 'pm_abc123',
- }, {
+ const credits = await client.customer.storeCredits.list({}, {
token: '<token>',
})
parameters:
@@ -7839,163 +8005,49 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- schema:
- type: string
- - name: cart_id
- in: path
required: true
- description: Cart prefixed ID
schema:
type: string
- - name: x-spree-token
- in: header
+ - name: page
+ in: query
required: false
- description: Order token for guest access
schema:
- type: string
- responses:
- '201':
- description: payment created
- content:
- application/json:
- example:
- id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code:
- number: P6M3ZHJE
- amount: '110.0'
- display_amount: "$110.00"
- status: checkout
- source_type:
- source_id:
- source:
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: check
- session_required: false
- source_required: false
- schema:
- "$ref": "#/components/schemas/Payment"
- '422':
- description: session-based payment method
- content:
- application/json:
- example:
- error:
- code: payment_session_required
- message: This payment method requires a payment session. Use the
- payment sessions endpoint instead.
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- payment_method_id:
- type: string
- example: pm_abc123
- description: Payment method ID (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
- "/api/v3/store/policies":
- get:
- summary: List store policies
- tags:
- - Policies
- security:
- - api_key: []
- description: |
- Returns all policies for the current store (e.g., return policy, privacy policy, terms of service).
- Policies are managed in Spree Admin and contain rich text content.
- x-codeSamples:
- - lang: javascript
- label: Spree SDK
- source: |-
- import { createClient } from '@spree/sdk'
-
- const client = createClient({
- baseUrl: 'https://your-store.com',
- publishableKey: '<api-key>',
- })
-
- const policies = await client.policies.list()
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
+ type: integer
+ - name: limit
+ in: query
+ required: false
schema:
- type: string
+ type: integer
- name: fields
in: query
required: false
- description: Comma-separated list of fields to include (e.g., name,slug).
+ description: Comma-separated list of fields to include (e.g., amount,currency).
id is always included.
schema:
type: string
responses:
'200':
- description: policies listed
+ description: store credits found
content:
application/json:
example:
data:
- - id: pol_gbHJdmfrXB
- name: Privacy Policy
- slug: privacy-policy
- body: ''
- body_html: ''
- - id: pol_OIJLhNcSbf
- name: Privacy Policy
- slug: privacy-policy-006f63da-6062-4a3f-9fd7-aa690f7b356c
- body: We respect your privacy.
- body_html: |
- <div class="trix-content">
- We respect your privacy.
- </div>
- - id: pol_uw2YK1rnl0
- name: Return Policy
- slug: return-policy
- body: You can return items within 30 days.
- body_html: |
- <div class="trix-content">
- You can return items within 30 days.
- </div>
- - id: pol_EfhxLZ9ck8
- name: Returns Policy
- slug: returns-policy
- body: ''
- body_html: ''
- - id: pol_VqXmZF31wY
- name: Shipping Policy
- slug: shipping-policy
- body: ''
- body_html: ''
- - id: pol_UkLWZg9DAJ
- name: Terms of Service
- slug: terms-of-service
- body: ''
- body_html: ''
+ - id: credit_UkLWZg9DAJ
+ amount: '100.0'
+ amount_used: '0.0'
+ amount_remaining: '100.0'
+ display_amount: "$100.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$100.00"
+ currency: USD
meta:
page: 1
limit: 25
- count: 6
+ count: 1
pages: 1
from: 1
- to: 6
- in: 6
+ to: 1
+ in: 1
previous:
next:
schema:
@@ -8004,28 +8056,27 @@ paths:
data:
type: array
items:
- "$ref": "#/components/schemas/Policy"
- required:
- - data
+ "$ref": "#/components/schemas/StoreCredit"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
'401':
description: unauthorized
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/policies/{id}":
+ "/api/v3/store/customers/me/store_credits/{id}":
get:
- summary: Get a policy
+ summary: Get a store credit
tags:
- - Policies
+ - Customers
security:
- api_key: []
- description: Returns a single policy by slug or prefixed ID. Includes the full
- rich text body.
+ bearer_auth: []
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8037,59 +8088,67 @@ paths:
publishableKey: '<api-key>',
})
- const policy = await client.policies.get('return-policy')
+ const credit = await client.customer.storeCredits.get('credit_abc123', {
+ token: '<token>',
+ })
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: Policy slug (e.g., return-policy) or prefixed ID (e.g., pol_abc123)
schema:
type: string
- name: fields
in: query
required: false
- description: Comma-separated list of fields to include. id is always included.
+ description: Comma-separated list of fields to include (e.g., amount,currency).
+ id is always included.
schema:
type: string
responses:
'200':
- description: policy found
+ description: store credit found
content:
application/json:
example:
- id: pol_uw2YK1rnl0
- name: Return Policy
- slug: return-policy
- body: You can return items within 30 days.
- body_html: |
- <div class="trix-content">
- You can return items within 30 days.
- </div>
+ id: credit_UkLWZg9DAJ
+ amount: '100.0'
+ amount_used: '0.0'
+ amount_remaining: '100.0'
+ display_amount: "$100.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$100.00"
+ currency: USD
schema:
- "$ref": "#/components/schemas/Policy"
+ "$ref": "#/components/schemas/StoreCredit"
'404':
- description: policy not found
+ description: store credit not found
content:
application/json:
example:
error:
code: record_not_found
- message: Policy not found
+ message: Store credit not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/products":
+ "/api/v3/store/countries":
get:
- summary: List products
+ summary: List countries
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
- description: Returns a paginated list of active products for the current store
+ description: Returns countries available in the store. Use ?expand=market to
+ include market details (currency, locale, tax_inclusive).
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8101,91 +8160,11 @@ paths:
publishableKey: '<api-key>',
})
- const products = await client.products.list({
- page: 1,
- limit: 25,
- sort: 'price',
- name_cont: 'shirt',
- price_gte: 20,
- price_lte: 100,
- with_option_value_ids: ['optval_abc', 'optval_def'],
- expand: ['variants', 'media'],
- })
+ const countries = await client.countries.list()
parameters:
- name: x-spree-api-key
in: header
required: true
- description: Publishable API key
- schema:
- type: string
- - name: page
- in: query
- required: false
- description: 'Page number (default: 1)'
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- description: 'Number of items per page (default: 25, max: 100)'
- schema:
- type: integer
- - name: sort
- in: query
- required: false
- description: 'Sort order. Prefix with - for descending. Values: price, -price,
- best_selling, name, -name, -available_on, available_on'
- schema:
- type: string
- - name: q[name_cont]
- in: query
- required: false
- description: Filter by name containing string
- schema:
- type: string
- - name: q[in_category]
- in: query
- required: false
- description: Filter by category prefixed ID (includes descendants)
- schema:
- type: string
- - name: q[in_categories][]
- in: query
- required: false
- description: Filter by multiple category prefixed IDs (OR logic, includes
- descendants)
- schema:
- type: string
- - name: q[price_gte]
- in: query
- required: false
- description: Filter by minimum price
- schema:
- type: number
- - name: q[price_lte]
- in: query
- required: false
- description: Filter by maximum price
- schema:
- type: number
- - name: q[with_option_value_ids][]
- in: query
- required: false
- description: Filter by option value prefix IDs (e.g., optval_abc). Pass multiple
- values for OR logic.
- schema:
- type: string
- - name: q[in_stock]
- in: query
- required: false
- description: Filter to only in-stock products
- schema:
- type: boolean
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand (variants, media, categories,
- option_types)
schema:
type: string
- name: fields
@@ -8195,117 +8174,34 @@ paths:
id is always included.
schema:
type: string
- responses:
- '200':
- description: products found
- content:
- application/json:
- example:
- data:
- - id: prod_UkLWZg9DAJ
- name: Product 1421251
- slug: product-1421251
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 1
- available_on: '2025-05-26T16:14:22.402Z'
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: A comfortable cotton t-shirt.
- description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"
- default_variant_id: variant_gbHJdmfrXB
- thumbnail_url:
- tags: []
- price:
- id: price_gbHJdmfrXB
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- original_price:
- - id: prod_gbHJdmfrXB
- name: Product 1435220
- slug: product-1435220
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 0
- available_on: '2025-05-26T16:14:22.472Z'
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: Architecto dignissimos nemo inventore incidunt enim.
- Odit accusamus repellat error saepe culpa unde eius. Cupiditate
- officiis voluptatem autem perferendis qui vitae omnis sunt. Debitis
- dolor tempore ad impedit itaque reprehenderit delectus. Doloremque
- laudantium iure recusandae iusto debitis laborum consequuntur.
- Impedit eum optio commodi tempora cum quidem. Facere voluptatum
- nam possimus veritatis nostrum explicabo dolore ex. Adipisci iure
- unde nobis itaque amet nesciunt voluptatibus impedit. Numquam
- in accusantium magni itaque exercitationem. Quas vero maxime voluptatem
- rem impedit inventore. Esse perferendis asperiores ea expedita
- aut tenetur soluta. Enim accusantium dolor adipisci impedit. Error
- maxime neque accusamus facere provident eum. Cum officia velit
- asperiores quod cupiditate fugiat. Possimus tenetur aut consequuntur
- iusto cumque quas. Ab velit ullam qui pariatur veritatis omnis.
- Accusantium vero occaecati explicabo neque animi commodi. Necessitatibus
- perspiciatis iste culpa totam quibusdam voluptate distinctio.
- Quod aliquam ut et autem. Saepe ut asperiores et quisquam perspiciatis
- molestiae. Vel recusandae sunt nemo et accusamus veniam ducimus.
- Laborum modi quasi perferendis culpa laboriosam quaerat magnam.
- Facere at tempora iusto ex magni aliquam modi debitis.
- description_html: |-
- Architecto dignissimos nemo inventore incidunt enim. Odit accusamus repellat error saepe culpa unde eius. Cupiditate officiis voluptatem autem perferendis qui vitae omnis sunt. Debitis dolor tempore ad impedit itaque reprehenderit delectus. Doloremque laudantium iure recusandae iusto debitis laborum consequuntur.
- Impedit eum optio commodi tempora cum quidem. Facere voluptatum nam possimus veritatis nostrum explicabo dolore ex. Adipisci iure unde nobis itaque amet nesciunt voluptatibus impedit. Numquam in accusantium magni itaque exercitationem. Quas vero maxime voluptatem rem impedit inventore.
- Esse perferendis asperiores ea expedita aut tenetur soluta. Enim accusantium dolor adipisci impedit. Error maxime neque accusamus facere provident eum. Cum officia velit asperiores quod cupiditate fugiat. Possimus tenetur aut consequuntur iusto cumque quas.
- Ab velit ullam qui pariatur veritatis omnis. Accusantium vero occaecati explicabo neque animi commodi. Necessitatibus perspiciatis iste culpa totam quibusdam voluptate distinctio. Quod aliquam ut et autem. Saepe ut asperiores et quisquam perspiciatis molestiae.
- Vel recusandae sunt nemo et accusamus veniam ducimus. Laborum modi quasi perferendis culpa laboriosam quaerat magnam. Facere at tempora iusto ex magni aliquam modi debitis.
- default_variant_id: variant_EfhxLZ9ck8
- thumbnail_url:
- tags: []
- price:
- id: price_EfhxLZ9ck8
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- original_price:
- meta:
- page: 1
- limit: 25
- count: 2
- pages: 1
- from: 1
- to: 2
- in: 2
- previous:
- next:
+ responses:
+ '200':
+ description: countries found
+ content:
+ application/json:
+ example:
+ data:
+ - iso: DE
+ iso3: IS39
+ name: Germany
+ states_required: false
+ zipcode_required: true
+ - iso: US
+ iso3: USA
+ name: United States of America
+ states_required: true
+ zipcode_required: true
schema:
type: object
properties:
data:
type: array
items:
- "$ref": "#/components/schemas/Product"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
+ "$ref": "#/components/schemas/Country"
required:
- data
- - meta
'401':
- description: unauthorized - invalid or missing API key
+ description: unauthorized
content:
application/json:
example:
@@ -8314,14 +8210,15 @@ paths:
message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/products/{id}":
+ "/api/v3/store/countries/{iso}":
get:
- summary: Get a product
+ summary: Get a country
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
- description: Returns a single product by slug or prefix ID
+ description: Returns a single country by ISO code. Supports ?expand=states for
+ address forms and ?expand=market for market details.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8333,26 +8230,17 @@ paths:
publishableKey: '<api-key>',
})
- const product = await client.products.get('spree-tote', {
- expand: ['variants', 'media'],
- })
+ const country = await client.countries.get('US')
parameters:
- name: x-spree-api-key
in: header
required: true
- description: Publishable API key
schema:
type: string
- - name: id
+ - name: iso
in: path
required: true
- description: Product slug (e.g., spree-tote) or prefix ID (e.g., product_abc123)
- schema:
- type: string
- - name: expand
- in: query
- required: false
- description: Comma-separated associations to expand
+ description: Country ISO 3166-1 alpha-2 code (e.g., "US", "DE")
schema:
type: string
- name: fields
@@ -8364,70 +8252,52 @@ paths:
type: string
responses:
'200':
- description: product without prior_price expanded does not include field
+ description: country found
content:
application/json:
example:
- id: prod_UkLWZg9DAJ
- name: Product 1702106
- slug: product-1702106
- meta_title:
- meta_description:
- meta_keywords:
- variant_count: 1
- available_on: '2025-05-26T16:14:24.749Z'
- purchasable: true
- in_stock: false
- backorderable: true
- available: true
- description: A comfortable cotton t-shirt.
- description_html: "<p>A <strong>comfortable</strong> cotton t-shirt.</p>"
- default_variant_id: variant_gbHJdmfrXB
- thumbnail_url:
- tags: []
- price:
- id: price_gbHJdmfrXB
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- original_price:
- prior_price:
- id: _AXs1igzRC6
- amount: '9.99'
- amount_in_cents: 999
- currency: USD
- display_amount: "$9.99"
- recorded_at: '2026-05-11T16:14:24Z'
+ iso: US
+ iso3: USA
+ name: United States of America
+ states_required: true
+ zipcode_required: true
schema:
- "$ref": "#/components/schemas/Product"
+ type: object
+ properties:
+ iso:
+ type: string
+ iso3:
+ type: string
+ name:
+ type: string
+ states_required:
+ type: boolean
+ zipcode_required:
+ type: boolean
+ required:
+ - iso
+ - iso3
+ - name
+ - states_required
+ - zipcode_required
'404':
- description: draft product not visible
+ description: country not found
content:
application/json:
example:
error:
code: record_not_found
- message: Product not found
+ message: Country not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/products/filters":
+ "/api/v3/store/currencies":
get:
- summary: Get product filters
+ summary: List supported currencies
tags:
- - Product Catalog
+ - Markets
security:
- api_key: []
- description: |
- Returns available filters for products with their options and counts.
- Use this endpoint to build filter UIs for product listing pages.
-
- The filters are context-aware - when a category_id is provided, only filters
- relevant to products in that category are returned.
+ description: Returns currencies supported by the store (derived from markets)
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8439,110 +8309,107 @@ paths:
publishableKey: '<api-key>',
})
- const filters = await client.products.filters({
- category_id: 'ctg_abc123',
- })
+ const currencies = await client.currencies.list()
parameters:
- name: x-spree-api-key
in: header
required: true
- description: Publishable API key
- schema:
- type: string
- - name: category_id
- in: query
- required: false
- description: Scope filters to products in this category (prefix ID)
schema:
type: string
- - name: q[name_cont]
+ - name: fields
in: query
required: false
- description: Filter by name containing string
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
'200':
- description: filters scoped to category
+ description: currencies found
content:
application/json:
example:
- filters:
- - id: price
- type: price_range
- min: 19.99
- max: 19.99
- currency: USD
- - id: availability
- type: availability
- options:
- - id: in_stock
- count: 2
- - id: out_of_stock
- count: 0
- - id: opt_UkLWZg9DAJ
- type: option
- name: size
- label: Size
- kind: dropdown
- options:
- - id: optval_UkLWZg9DAJ
- name: small
- label: S
- position: 1
- color_code:
- image_url:
- count: 1
- - id: categories
- type: category
- options:
- - id: ctg_EfhxLZ9ck8
- name: Shirts
- permalink: taxonomy-27/taxon-34/shirts
- count: 2
- sort_options:
- - id: manual
- - id: best_selling
- - id: price
- - id: "-price"
- - id: "-available_on"
- - id: available_on
- - id: name
- - id: "-name"
- default_sort: manual
- total_count: 2
+ data:
+ - iso_code: USD
+ name: United States Dollar
+ symbol: "$"
+ - iso_code: EUR
+ name: Euro
+ symbol: "€"
schema:
type: object
properties:
- filters:
+ data:
type: array
- description: Available filters (price_range, availability, option,
- category)
items:
- type: object
- sort_options:
+ "$ref": "#/components/schemas/Currency"
+ required:
+ - data
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/locales":
+ get:
+ summary: List supported locales
+ tags:
+ - Markets
+ security:
+ - api_key: []
+ description: Returns locales supported by the store (derived from markets)
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const locales = await client.locales.list()
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: locales found
+ content:
+ application/json:
+ example:
+ data:
+ - code: de
+ name: de
+ - code: en
+ name: English (US)
+ schema:
+ type: object
+ properties:
+ data:
type: array
- description: Available sort options
items:
- type: object
- properties:
- id:
- type: string
- required:
- - id
- default_sort:
- type: string
- description: Default sort option ID
- total_count:
- type: integer
- description: Total products matching current filters
+ "$ref": "#/components/schemas/Locale"
required:
- - filters
- - sort_options
- - default_sort
- - total_count
+ - data
'401':
- description: unauthorized - invalid or missing API key
+ description: unauthorized
content:
application/json:
example:
@@ -8551,16 +8418,15 @@ paths:
message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/store_credits":
+ "/api/v3/store/markets":
get:
- summary: List store credits
+ summary: List markets
tags:
- - Customers
+ - Markets
security:
- api_key: []
- bearer_auth: []
- description: Returns store credits for the authenticated customer, filtered
- by current store and currency. Supports Ransack filtering.
+ description: Returns all markets for the current store with their countries,
+ currency, locales, and tax configuration.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8572,89 +8438,94 @@ paths:
publishableKey: '<api-key>',
})
- const credits = await client.customer.storeCredits.list({}, {
- token: '<token>',
- })
+ const markets = await client.markets.list()
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: limit
- in: query
- required: false
- schema:
- type: integer
- name: fields
in: query
required: false
- description: Comma-separated list of fields to include (e.g., amount,currency).
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
id is always included.
schema:
type: string
responses:
'200':
- description: store credits found
+ description: markets found
content:
application/json:
example:
data:
- - id: credit_UkLWZg9DAJ
- amount: '100.0'
- amount_used: '0.0'
- amount_remaining: '100.0'
- display_amount: "$100.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$100.00"
+ - id: mkt_UkLWZg9DAJ
+ name: North America
currency: USD
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
+ default_locale: en
+ tax_inclusive: false
+ default: true
+ country_isos:
+ - US
+ supported_locales:
+ - en
+ - es
+ countries:
+ - iso: US
+ iso3: USA
+ name: United States of America
+ states_required: true
+ zipcode_required: true
+ - id: mkt_gbHJdmfrXB
+ name: Europe
+ currency: EUR
+ default_locale: de
+ tax_inclusive: true
+ default: false
+ country_isos:
+ - DE
+ - FR
+ supported_locales:
+ - de
+ - en
+ - fr
+ countries:
+ - iso: DE
+ iso3: IS66
+ name: Germany
+ states_required: false
+ zipcode_required: true
+ - iso: FR
+ iso3: IS67
+ name: France
+ states_required: false
+ zipcode_required: true
schema:
type: object
properties:
data:
type: array
- items:
- "$ref": "#/components/schemas/StoreCredit"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
+ required:
+ - data
'401':
description: unauthorized
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: invalid_token
+ message: Valid API key required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customers/me/store_credits/{id}":
+ "/api/v3/store/markets/{id}":
get:
- summary: Get a store credit
+ summary: Get a market
tags:
- - Customers
+ - Markets
security:
- api_key: []
- bearer_auth: []
+ description: Returns a single market by prefixed ID with its countries, currency,
+ locales, and tax configuration.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8666,67 +8537,160 @@ paths:
publishableKey: '<api-key>',
})
- const credit = await client.customer.storeCredits.get('credit_abc123', {
- token: '<token>',
- })
+ const market = await client.markets.get('mkt_xxx')
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
+ - name: id
+ in: path
+ required: true
+ description: Market prefixed ID (e.g., "mkt_k5nR8xLq")
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: market found
+ content:
+ application/json:
+ example:
+ id: mkt_gbHJdmfrXB
+ name: Europe
+ currency: EUR
+ default_locale: de
+ tax_inclusive: true
+ default: false
+ country_isos:
+ - DE
+ - FR
+ supported_locales:
+ - de
+ - en
+ - fr
+ countries:
+ - iso: DE
+ iso3: IS70
+ name: Germany
+ states_required: false
+ zipcode_required: true
+ - iso: FR
+ iso3: IS71
+ name: France
+ states_required: false
+ zipcode_required: true
+ schema:
+ type: object
+ '404':
+ description: market not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Market not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/markets/resolve":
+ get:
+ summary: Resolve market by country
+ tags:
+ - Markets
+ security:
+ - api_key: []
+ description: Determine which market applies for a given country ISO code. Useful
+ for auto-selecting the correct currency and locale when a customer's location
+ is known.
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const market = await client.markets.resolve('DE')
+ parameters:
+ - name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: id
- in: path
+ - name: country
+ in: query
required: true
+ description: Country ISO 3166-1 alpha-2 code (e.g., "DE", "US")
schema:
type: string
- name: fields
in: query
required: false
- description: Comma-separated list of fields to include (e.g., amount,currency).
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
id is always included.
schema:
type: string
responses:
'200':
- description: store credit found
+ description: market resolved
content:
application/json:
example:
- id: credit_UkLWZg9DAJ
- amount: '100.0'
- amount_used: '0.0'
- amount_remaining: '100.0'
- display_amount: "$100.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$100.00"
- currency: USD
+ id: mkt_gbHJdmfrXB
+ name: Europe
+ currency: EUR
+ default_locale: de
+ tax_inclusive: true
+ default: false
+ country_isos:
+ - DE
+ - FR
+ supported_locales:
+ - de
+ - en
+ - fr
+ countries:
+ - iso: DE
+ iso3: IS74
+ name: Germany
+ states_required: false
+ zipcode_required: true
+ - iso: FR
+ iso3: IS75
+ name: France
+ states_required: false
+ zipcode_required: true
schema:
- "$ref": "#/components/schemas/StoreCredit"
+ type: object
'404':
- description: store credit not found
+ description: no market for country
content:
application/json:
example:
error:
code: record_not_found
- message: Store credit not found
+ message: Country not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/carts/{cart_id}/store_credits":
- post:
- summary: Apply store credit
+ "/api/v3/store/markets/{market_id}/countries":
+ get:
+ summary: List countries in a market
tags:
- - Carts
+ - Markets
security:
- api_key: []
- bearer_auth: []
- description: Applies store credit to the cart during checkout.
+ description: Returns countries belonging to a specific market. Use this for
+ address form country dropdowns during checkout.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -8738,270 +8702,59 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.storeCredits.apply('cart_abc123', 10.0, {
- token: '<token>',
- })
+ const countries = await client.markets.countries.list('mkt_xxx')
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
- required: true
- schema:
- type: string
- - name: cart_id
+ - name: market_id
in: path
required: true
- description: Cart prefixed ID (e.g., cart_abc123)
- schema:
- type: string
- - name: x-spree-token
- in: header
- required: false
+ description: Market prefixed ID
schema:
type: string
- - name: Idempotency-Key
- in: header
+ - name: fields
+ in: query
required: false
- description: Unique key for request idempotency.
- schema:
- type: string
- responses:
- '200':
- description: store credit applied
- content:
- application/json:
- example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R903776007
- token: oPFUDLqngFUNHBsLi5NZyBfVqQFVkab5S48
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '100.0'
- display_amount_due: "$100.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '10.0'
- display_store_credit_total: "-$10.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements: []
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 1909153
- slug: product-1909153
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H71098380344
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Twanna Stamm
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- response_code: 1-SC-20260526161430523363
- number: P1X82P2A
- amount: '10.0'
- display_amount: "$10.00"
- status: checkout
- source_type: store_credit
- source_id: credit_UkLWZg9DAJ
- source:
- id: credit_UkLWZg9DAJ
- amount: '50.0'
- amount_used: '0.0'
- amount_remaining: '50.0'
- display_amount: "$50.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$50.00"
- currency: USD
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Store Credit
- description: Store Credit
- type: store_credit
- session_required: false
- source_required: true
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 320 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 321 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods:
- - id: pm_UkLWZg9DAJ
- name: Store Credit
- description: Store Credit
- type: store_credit
- session_required: false
- source_required: true
- gift_card:
- market:
- schema:
- "$ref": "#/components/schemas/Cart"
- '422':
- description: no store credit available
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: countries found
content:
application/json:
example:
- error:
- code: processing_error
- message: User does not have any Store Credits available
+ data:
+ - iso: FR
+ iso3: IS79
+ name: France
+ states_required: false
+ zipcode_required: true
+ - iso: DE
+ iso3: IS78
+ name: Germany
+ states_required: false
+ zipcode_required: true
schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- amount:
- type: number
- example: 10.0
- description: Amount to apply (optional - defaults to max available)
- delete:
- summary: Remove store credit
+ type: object
+ properties:
+ data:
+ type: array
+ required:
+ - data
+ "/api/v3/store/markets/{market_id}/countries/{id}":
+ get:
+ summary: Get a country in a market
tags:
- - Carts
+ - Markets
security:
- api_key: []
- bearer_auth: []
- description: Removes store credit from the cart.
+ description: Returns a single country by ISO code within a market. Supports
+ ?expand=states for address forms.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -9013,208 +8766,55 @@ paths:
publishableKey: '<api-key>',
})
- const cart = await client.carts.storeCredits.remove('cart_abc123', {
- token: '<token>',
- })
+ const country = await client.markets.countries.get('mkt_xxx', 'DE')
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
+ - name: market_id
+ in: path
required: true
+ description: Market prefixed ID
schema:
type: string
- - name: cart_id
+ - name: id
in: path
required: true
- description: Cart prefixed ID
+ description: Country ISO 3166-1 alpha-2 code (e.g., "DE")
schema:
type: string
- - name: x-spree-token
- in: header
+ - name: fields
+ in: query
required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
schema:
type: string
responses:
'200':
- description: store credit removed
+ description: country found
content:
application/json:
example:
- id: cart_UkLWZg9DAJ
- market_id:
- number: R646602683
- token: c5RmvpB42n2ZRwYZ246jBJSFzvFgSLjsY5V
- customer_note:
- currency: USD
- locale: en
- total_quantity: 1
- item_total: '10.0'
- display_item_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- gift_card_total: '0.0'
- display_gift_card_total: "$0.00"
- amount_due: '110.0'
- display_amount_due: "$110.00"
- delivery_total: '100.0'
- display_delivery_total: "$100.00"
- warnings: []
- store_credit_total: '0.0'
- display_store_credit_total: "$0.00"
- covered_by_store_credit: false
- current_step: address
- completed_steps: []
- requirements:
- - step: payment
- field: payment
- message: Add a payment method
- shipping_eq_billing_address: false
- discounts: []
- items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- currency: USD
- name: Product 1922421
- slug: product-1922421
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- fulfillments:
- - id: ful_UkLWZg9DAJ
- number: H93482247486
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- total: '100.0'
- display_total: "$100.00"
- discount_total: '0.0'
- display_discount_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- status: pending
- fulfillment_type: shipping
- fulfilled_at:
- items:
- - item_id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: NY
- name: Carolina Kovacek
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: NY
- delivery_rates:
- - id: dr_UkLWZg9DAJ
- delivery_method_id: dm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: '100.0'
- total: '100.0'
- additional_tax_total: '0.0'
- included_tax_total: '0.0'
- tax_total: '0.0'
- display_cost: "$100.00"
- display_total: "$100.00"
- display_additional_tax_total: "$0.00"
- display_included_tax_total: "$0.00"
- display_tax_total: "$0.00"
- delivery_method:
- id: dm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- billing_address:
- id: addr_EfhxLZ9ck8
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 328 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- shipping_address:
- id: addr_VqXmZF31wY
- first_name: John
- last_name: Doe
- full_name: John Doe
- address1: 329 Lovely Street
- address2: Northwest
- postal_code: '10118'
- city: New York
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: NY
- state_abbr: NY
- quick_checkout: false
- is_default_billing: false
- is_default_shipping: false
- state_name: New York
- payment_methods: []
- gift_card:
- market:
+ iso: US
+ iso3: USA
+ name: United States of America
+ states_required: true
+ zipcode_required: true
schema:
- "$ref": "#/components/schemas/Cart"
+ type: object
+ '404':
+ description: country not in market
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Country not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
"/api/v3/store/wishlists":
get:
summary: List wishlists
@@ -9361,34 +8961,312 @@ paths:
content:
application/json:
example:
- error:
- code: validation_error
- message: Name can't be blank
- details:
- name:
- - can't be blank
+ error:
+ code: validation_error
+ message: Name can't be blank
+ details:
+ name:
+ - can't be blank
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ 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
+ "/api/v3/store/wishlists/{id}":
+ get:
+ summary: Get a 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>',
+ })
+
+ const wishlist = await client.wishlists.get('wl_abc123', {
+ expand: ['wished_items'],
+ }, {
+ token: '<token>',
+ })
+ 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: Expand wished_items
+ schema:
+ type: string
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug,price).
+ id is always included.
+ schema:
+ type: string
+ responses:
+ '200':
+ description: wishlist found
+ content:
+ application/json:
+ example:
+ id: wl_UkLWZg9DAJ
+ name: My Wishlist
+ token: K1j4ej8u38Y4P9whWrjPs2R9
+ is_default: false
+ is_private: true
+ schema:
+ "$ref": "#/components/schemas/Wishlist"
+ '404':
+ description: wishlist not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Wishlist not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ patch:
+ summary: Update a 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>',
+ })
+
+ const wishlist = await client.wishlists.update('wl_abc123', {
+ name: 'Updated Name',
+ }, {
+ token: '<token>',
+ })
+ 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: wishlist updated
+ content:
+ application/json:
+ example:
+ id: wl_UkLWZg9DAJ
+ name: Updated Name
+ token: xVUpUiksViqHLiWcenRTEGZx
+ is_default: false
+ is_private: true
+ schema:
+ "$ref": "#/components/schemas/Wishlist"
+ requestBody:
+ 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
+ delete:
+ summary: Delete a 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.delete('wl_abc123', {
+ token: '<token>',
+ })
+ 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: wishlist deleted
+ "/api/v3/store/wishlists/{wishlist_id}/items":
+ post:
+ summary: Add item to wishlist
+ tags:
+ - Wishlists
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Adds a variant to the wishlist
+ x-codeSamples:
+ - lang: javascript
+ label: Spree SDK
+ source: |-
+ import { createClient } from '@spree/sdk'
+
+ const client = createClient({
+ baseUrl: 'https://your-store.com',
+ publishableKey: '<api-key>',
+ })
+
+ const item = await client.wishlists.items.create('wl_abc123', {
+ variant_id: 'variant_abc123',
+ quantity: 1,
+ }, {
+ token: '<token>',
+ })
+ 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
+ responses:
+ '201':
+ description: item added
+ content:
+ application/json:
+ example:
+ id: wi_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
+ wishlist_id: wl_UkLWZg9DAJ
+ quantity: 1
+ variant:
+ id: variant_gbHJdmfrXB
+ product_id: prod_gbHJdmfrXB
+ sku: SKU-239
+ options_text: ''
+ track_inventory: true
+ media_count: 0
+ thumbnail_url:
+ purchasable: true
+ in_stock: false
+ backorderable: true
+ weight: 0.0
+ height:
+ width:
+ depth:
+ price:
+ id: price_gbHJdmfrXB
+ amount: '19.99'
+ amount_in_cents: 1999
+ compare_at_amount:
+ compare_at_amount_in_cents:
+ currency: USD
+ display_amount: "$19.99"
+ display_compare_at_amount:
+ price_list_id:
+ original_price:
+ option_values: []
schema:
- "$ref": "#/components/schemas/ErrorResponse"
+ "$ref": "#/components/schemas/WishlistItem"
requestBody:
content:
application/json:
schema:
type: object
properties:
- name:
+ variant_id:
type: string
- example: Birthday Ideas
- is_private:
- type: boolean
- example: true
- is_default:
- type: boolean
- example: false
+ example: variant_abc123
+ quantity:
+ type: integer
+ example: 1
required:
- - name
- "/api/v3/store/wishlists/{id}":
- get:
- summary: Get a wishlist
+ - variant_id
+ "/api/v3/store/wishlists/{wishlist_id}/items/{id}":
+ delete:
+ summary: Remove item from wishlist
tags:
- Wishlists
security:
@@ -9405,9 +9283,7 @@ paths:
publishableKey: '<api-key>',
})
- const wishlist = await client.wishlists.get('wl_abc123', {
- expand: ['wished_items'],
- }, {
+ await client.wishlists.items.delete('wl_abc123', 'wi_abc123', {
token: '<token>',
})
parameters:
@@ -9421,54 +9297,62 @@ paths:
required: true
schema:
type: string
- - name: id
+ - name: wishlist_id
in: path
required: true
schema:
type: string
- - name: expand
- in: query
- required: false
- description: Expand wished_items
- schema:
- type: string
- - name: fields
- in: query
- required: false
- description: Comma-separated list of fields to include (e.g., name,slug,price).
- id is always included.
+ - name: id
+ in: path
+ required: true
schema:
type: string
responses:
- '200':
- description: wishlist found
- content:
- application/json:
- example:
- id: wl_UkLWZg9DAJ
- name: My Wishlist
- token: K1j4ej8u38Y4P9whWrjPs2R9
- is_default: false
- is_private: true
- schema:
- "$ref": "#/components/schemas/Wishlist"
+ '204':
+ description: item removed
'404':
- description: wishlist not found
+ description: item not found
content:
application/json:
example:
error:
code: record_not_found
- message: Wishlist not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update a wishlist
+ message: Wished item not found
+ "/api/v3/store/newsletter_subscribers":
+ post:
+ summary: Subscribe to the newsletter
tags:
- - Wishlists
+ - Newsletter Subscribers
security:
- api_key: []
- bearer_auth: []
+ description: |
+ Subscribes an email address to the newsletter for the current store.
+
+ Behavior:
+
+ - If the email is already verified for this store, the existing subscription is returned unchanged.
+ - If the request is unauthenticated (guest), the subscription is created in an unverified state
+ and two events are published: `newsletter_subscriber.subscription_requested` (carrying the
+ `verification_token` and the validated `redirect_url`, intended for headless storefronts that
+ want to send the confirmation email themselves via a webhook handler) and the legacy
+ `newsletter_subscriber.subscribed` lifecycle event (which the bundled `spree_emails` package
+ listens to and uses to send a default confirmation email). The confirmation link should point
+ at `redirect_url?token=<verification_token>` and call `POST /newsletter_subscribers/verify`
+ when the user clicks it.
+ - If the request is authenticated via JWT and the customer's email matches the subscribed email,
+ the subscription is auto-verified and no events are fired — the JWT already proves email
+ ownership, so no confirmation email is needed.
+
+ The optional `redirect_url` is where the verification token should land on the storefront. The
+ server does not return a validation error when the URL is outside the store's
+ [Allowed Origins](/developer/core-concepts/allowed-origins); instead, the URL is silently
+ omitted from the webhook payload (secure-by-default). When no allow-list is configured on the
+ store, the URL is also omitted. Callers therefore receive the same 201 regardless, and the
+ webhook handler should fall back to the store's storefront URL when `redirect_url` is missing
+ from the payload.
+
+ Newsletter consent is preserved across registration: if a guest subscribes and later registers
+ with the same email, the existing subscriber record is reused.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -9480,10 +9364,9 @@ paths:
publishableKey: '<api-key>',
})
- const wishlist = await client.wishlists.update('wl_abc123', {
- name: 'Updated Name',
- }, {
- token: '<token>',
+ const subscriber = await client.newsletterSubscribers.create({
+ email: '[email protected]',
+ redirect_url: 'https://your-store.com/newsletter/confirm',
})
parameters:
- name: x-spree-api-key
@@ -9493,49 +9376,73 @@ paths:
type: string
- name: Authorization
in: header
- required: true
- schema:
- type: string
- - name: id
- in: path
- required: true
+ required: false
+ description: Optional Bearer JWT — when present, links the subscription to
+ that customer
schema:
type: string
responses:
- '200':
- description: wishlist updated
+ '201':
+ description: auto-verified when JWT matches subscribed email
content:
application/json:
example:
- id: wl_UkLWZg9DAJ
- name: Updated Name
- token: xVUpUiksViqHLiWcenRTEGZx
- is_default: false
- is_private: true
+ id: sub_UkLWZg9DAJ
+ created_at: '2026-05-26T16:14:11.183Z'
+ updated_at: '2026-05-26T16:14:11.186Z'
+ verified: true
+ verified_at: '2026-05-26T16:14:11Z'
+ customer_id: cus_UkLWZg9DAJ
schema:
- "$ref": "#/components/schemas/Wishlist"
+ "$ref": "#/components/schemas/NewsletterSubscriber"
+ '422':
+ description: invalid email format
+ content:
+ application/json:
+ example:
+ error:
+ code: validation_error
+ message: Email is invalid
+ details:
+ email:
+ - is invalid
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
properties:
- name:
+ email:
type: string
- example: Updated Name
- is_private:
- type: boolean
- example: true
- is_default:
- type: boolean
- example: false
- delete:
- summary: Delete a wishlist
+ format: email
+ 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:
+ - email
+ "/api/v3/store/newsletter_subscribers/verify":
+ post:
+ summary: Verify a newsletter subscription
tags:
- - Wishlists
+ - Newsletter Subscribers
security:
- api_key: []
- bearer_auth: []
+ description: |
+ Confirms a pending newsletter subscription using the verification token sent by email.
+
+ After successful verification:
+ - The subscriber record is marked verified.
+ - If the subscription is associated with a customer, that customer's `accepts_email_marketing`
+ flag is set to `true`.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -9547,8 +9454,8 @@ paths:
publishableKey: '<api-key>',
})
- await client.wishlists.delete('wl_abc123', {
- token: '<token>',
+ const subscriber = await client.newsletterSubscribers.verify({
+ token: 'abc123def456',
})
parameters:
- name: x-spree-api-key
@@ -9556,28 +9463,53 @@ paths:
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: wishlist deleted
- "/api/v3/store/wishlists/{wishlist_id}/items":
- post:
- summary: Add item to wishlist
+ '200':
+ description: subscription verified
+ content:
+ application/json:
+ example:
+ id: sub_UkLWZg9DAJ
+ created_at: '2026-05-26T16:14:11.236Z'
+ updated_at: '2026-05-26T16:14:11.255Z'
+ verified: true
+ verified_at: '2026-05-26T16:14:11Z'
+ customer_id:
+ schema:
+ "$ref": "#/components/schemas/NewsletterSubscriber"
+ '422':
+ description: missing token
+ content:
+ application/json:
+ example:
+ error:
+ code: parameter_missing
+ message: token is required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ token:
+ type: string
+ example: abc123def456
+ description: Verification token from the confirmation email
+ required:
+ - token
+ "/api/v3/store/policies":
+ get:
+ summary: List store policies
tags:
- - Wishlists
+ - Policies
security:
- api_key: []
- bearer_auth: []
- description: Adds a variant to the wishlist
+ description: |
+ Returns all policies for the current store (e.g., return policy, privacy policy, terms of service).
+ Policies are managed in Spree Admin and contain rich text content.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -9589,89 +9521,101 @@ paths:
publishableKey: '<api-key>',
})
- const item = await client.wishlists.items.create('wl_abc123', {
- variant_id: 'variant_abc123',
- quantity: 1,
- }, {
- token: '<token>',
- })
+ const policies = await client.policies.list()
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
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include (e.g., name,slug).
+ id is always included.
schema:
type: string
responses:
- '201':
- description: item added
+ '200':
+ description: policies listed
content:
application/json:
example:
- id: wi_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- wishlist_id: wl_UkLWZg9DAJ
- quantity: 1
- variant:
- id: variant_gbHJdmfrXB
- product_id: prod_gbHJdmfrXB
- sku: SKU-239
- options_text: ''
- track_inventory: true
- media_count: 0
- thumbnail_url:
- purchasable: true
- in_stock: false
- backorderable: true
- weight: 0.0
- height:
- width:
- depth:
- price:
- id: price_gbHJdmfrXB
- amount: '19.99'
- amount_in_cents: 1999
- compare_at_amount:
- compare_at_amount_in_cents:
- currency: USD
- display_amount: "$19.99"
- display_compare_at_amount:
- price_list_id:
- original_price:
- option_values: []
+ data:
+ - id: pol_gbHJdmfrXB
+ name: Privacy Policy
+ slug: privacy-policy
+ body: ''
+ body_html: ''
+ - id: pol_OIJLhNcSbf
+ name: Privacy Policy
+ slug: privacy-policy-006f63da-6062-4a3f-9fd7-aa690f7b356c
+ body: We respect your privacy.
+ body_html: |
+ <div class="trix-content">
+ We respect your privacy.
+ </div>
+ - id: pol_uw2YK1rnl0
+ name: Return Policy
+ slug: return-policy
+ body: You can return items within 30 days.
+ body_html: |
+ <div class="trix-content">
+ You can return items within 30 days.
+ </div>
+ - id: pol_EfhxLZ9ck8
+ name: Returns Policy
+ slug: returns-policy
+ body: ''
+ body_html: ''
+ - id: pol_VqXmZF31wY
+ name: Shipping Policy
+ slug: shipping-policy
+ body: ''
+ body_html: ''
+ - id: pol_UkLWZg9DAJ
+ name: Terms of Service
+ slug: terms-of-service
+ body: ''
+ body_html: ''
+ meta:
+ page: 1
+ limit: 25
+ count: 6
+ pages: 1
+ from: 1
+ to: 6
+ in: 6
+ previous:
+ next:
schema:
- "$ref": "#/components/schemas/WishlistItem"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- variant_id:
- type: string
- example: variant_abc123
- quantity:
- type: integer
- example: 1
- required:
- - variant_id
- "/api/v3/store/wishlists/{wishlist_id}/items/{id}":
- delete:
- summary: Remove item from wishlist
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/Policy"
+ required:
+ - data
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/policies/{id}":
+ get:
+ summary: Get a policy
tags:
- - Wishlists
+ - Policies
security:
- api_key: []
- bearer_auth: []
+ description: Returns a single policy by slug or prefixed ID. Includes the full
+ rich text body.
x-codeSamples:
- lang: javascript
label: Spree SDK
@@ -9683,41 +9627,97 @@ paths:
publishableKey: '<api-key>',
})
- await client.wishlists.items.delete('wl_abc123', 'wi_abc123', {
- token: '<token>',
- })
+ const policy = await client.policies.get('return-policy')
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
+ - name: id
+ in: path
required: true
+ description: Policy slug (e.g., return-policy) or prefixed ID (e.g., pol_abc123)
schema:
type: string
- - name: wishlist_id
- in: path
- required: true
+ - name: fields
+ in: query
+ required: false
+ description: Comma-separated list of fields to include. id is always included.
schema:
type: string
- - name: id
+ responses:
+ '200':
+ description: policy found
+ content:
+ application/json:
+ example:
+ id: pol_uw2YK1rnl0
+ name: Return Policy
+ slug: return-policy
+ body: You can return items within 30 days.
+ body_html: |
+ <div class="trix-content">
+ You can return items within 30 days.
+ </div>
+ schema:
+ "$ref": "#/components/schemas/Policy"
+ '404':
+ description: policy not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Policy not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/digitals/{token}":
+ get:
+ summary: Download a digital product
+ tags:
+ - Digitals
+ description: |
+ Downloads a digital product file using the digital link token.
+ The token is provided via the `download_url` field on digital links
+ returned with order line items. No API key or authentication required —
+ the token itself grants access.
+ Each download increments the access counter. Downloads may be limited by
+ store settings (number of downloads and/or time-based expiration).
+ parameters:
+ - name: token
in: path
required: true
+ description: Digital link token
schema:
type: string
responses:
- '204':
- description: item removed
+ '200':
+ description: file downloaded
+ content:
+ application/json: {}
+ '403':
+ description: download link expired or limit exceeded
+ content:
+ application/json:
+ example:
+ error:
+ code: digital_link_expired
+ message: Download link expired or invalid
+ application/octet-stream:
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
'404':
- description: item not found
+ description: digital link not found
content:
application/json:
example:
error:
code: record_not_found
- message: Wished item not found
+ message: Digital link not found
+ application/octet-stream:
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
servers:
- url: http://{defaultHost}
variables:
diff --git a/spree/api/Rakefile b/spree/api/Rakefile
index c72ddbbb9d..e966e1e72b 100644
--- a/spree/api/Rakefile
+++ b/spree/api/Rakefile
@@ -27,6 +27,25 @@ namespace :rswag do
ENV['OPENAPI'] = 'true'
t.rspec_opts = ['--format Rswag::Specs::SwaggerFormatter', '--order defined']
end
+
+ # rswag emits paths in spec-load order (alphabetical by filename), which doesn't
+ # match the curated order in swagger_helper.rb's `tags:` array. Mintlify groups
+ # sidebar sections by first-tag-appearance in `paths:`, so reorder paths here
+ # so the sidebar follows the `tags:` array.
+ Rake::Task['rswag:specs:swaggerize'].enhance do
+ $LOAD_PATH.unshift(File.expand_path('lib', __dir__))
+ require 'spree/api/openapi/path_sorter'
+
+ docs = File.expand_path('../../docs/api-reference', __dir__)
+ %w[admin.yaml store.yaml].each do |name|
+ path = File.join(docs, name)
+ next unless File.exist?(path)
+
+ if Spree::Api::OpenAPI::PathSorter.sort_file!(path)
+ puts "Reordered paths by tag → #{path}"
+ end
+ end
+ end
end
end
diff --git a/spree/api/lib/spree/api/openapi/path_sorter.rb b/spree/api/lib/spree/api/openapi/path_sorter.rb
new file mode 100644
index 0000000000..89f40c6349
--- /dev/null
+++ b/spree/api/lib/spree/api/openapi/path_sorter.rb
@@ -0,0 +1,126 @@
+# frozen_string_literal: true
+
+module Spree
+ module Api
+ module OpenAPI
+ # Reorders the `paths:` block of a generated OpenAPI YAML so paths are grouped
+ # by tag, in the same order as the top-level `tags:` array.
+ #
+ # rswag emits paths in the order specs are loaded (alphabetical by filename),
+ # which doesn't match the curated `tags:` array order in swagger_helper.rb.
+ # Mintlify groups sidebar sections by the *first appearance* of each tag in
+ # `paths:` — so after this sort runs, the sidebar matches the `tags:` array.
+ #
+ # The reorder is line-based to preserve the exact text formatting that
+ # rswag/Psych produced (indentation, multi-line string wrapping, etc.).
+ module PathSorter
+ module_function
+
+ # Sort the `paths:` block in `path` so each path's first-operation primary
+ # tag follows the order defined in the document's top-level `tags:` array.
+ # Returns true if the file was rewritten, false if already sorted.
+ def sort_file!(path)
+ original = File.read(path)
+ sorted = sort_text(original)
+ return false if sorted == original
+
+ File.write(path, sorted)
+ true
+ end
+
+ # Pure-string variant: sort a YAML document's `paths:` block by tag order.
+ def sort_text(yaml)
+ lines = yaml.lines
+ tag_rank = extract_tag_rank(lines)
+ return yaml if tag_rank.empty?
+
+ paths_start = lines.index { |l| l.start_with?('paths:') }
+ return yaml unless paths_start
+
+ paths_end_exclusive = (paths_start + 1...lines.size).find do |i|
+ line = lines[i]
+ line.match?(/\A[A-Za-z]/) || line.start_with?('x-')
+ end || lines.size
+
+ blocks = collect_path_blocks(lines, paths_start + 1, paths_end_exclusive)
+ return yaml if blocks.empty?
+
+ unknown_rank = tag_rank.size
+ sorted_blocks = blocks.each_with_index.sort_by do |block, original_index|
+ [tag_rank.fetch(block[:tag], unknown_rank), original_index]
+ end.map(&:first)
+
+ prefix = lines[0..paths_start].join
+ suffix = lines[paths_end_exclusive..].to_a.join
+ prefix + sorted_blocks.map { |b| b[:text] }.join + suffix
+ end
+
+ # Parse the top-level `tags:` block and return { tag_name => index } in
+ # declared order. Returns {} if not found.
+ def extract_tag_rank(lines)
+ start = lines.index { |l| l.start_with?('tags:') }
+ return {} unless start
+
+ rank = {}
+ i = start + 1
+ while i < lines.size
+ line = lines[i]
+ if line.start_with?('- name: ')
+ rank[line.sub('- name: ', '').strip] = rank.size
+ elsif line.match?(/\A[A-Za-z]/) || line.start_with?('x-')
+ break
+ end
+ i += 1
+ end
+ rank
+ end
+
+ # Collect each path block as { tag:, text: } from lines[range].
+ # A path block starts on a line beginning with two spaces + a quote.
+ def collect_path_blocks(lines, start_idx, end_idx_exclusive)
+ blocks = []
+ current_start = nil
+
+ (start_idx...end_idx_exclusive).each do |i|
+ if path_header?(lines[i])
+ blocks << build_block(lines, current_start, i) if current_start
+ current_start = i
+ end
+ end
+ blocks << build_block(lines, current_start, end_idx_exclusive) if current_start
+
+ blocks
+ end
+
+ def path_header?(line)
+ line.start_with?(' "/') || line.start_with?(' /')
+ end
+
+ def build_block(lines, from, to_exclusive)
+ slice = lines[from...to_exclusive]
+ {
+ tag: extract_primary_tag(slice),
+ text: slice.join
+ }
+ end
+
+ # Within a path block, find the first `tags:` line and return the first
+ # tag value following it (the path block's "primary" tag).
+ def extract_primary_tag(slice)
+ slice.each_with_index do |line, idx|
+ next unless line.match?(/\A {6}tags:\s*$/)
+
+ slice[(idx + 1)..].each do |next_line|
+ if next_line.start_with?(' - ')
+ value = next_line[8..].strip
+ return value unless value.empty?
+ end
+ break if next_line.match?(/\A {0,4}\S/)
+ end
+ end
+ nil
+ end
+ end
+ end
+ end
+end
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.rb
index c0f987a724..8152771a49 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
@@ -20,7 +20,7 @@ RSpec.describe 'Admin Staff API', type: :request, swagger_doc: 'api-reference/ad
path '/api/v3/admin/admin_users' do
get 'List staff' do
- tags 'Configuration'
+ tags 'Staff'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns admin users with at least one role assignment on the current store.'
@@ -47,7 +47,7 @@ RSpec.describe 'Admin Staff API', type: :request, swagger_doc: 'api-reference/ad
let(:id) { staff_member.prefixed_id }
get 'Show a staff member' do
- tags 'Configuration'
+ tags 'Staff'
produces 'application/json'
security [api_key: [], bearer_auth: []]
admin_scope :read, :settings
@@ -71,7 +71,7 @@ RSpec.describe 'Admin Staff API', type: :request, swagger_doc: 'api-reference/ad
end
patch 'Update a staff member' do
- tags 'Configuration'
+ tags 'Staff'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -106,7 +106,7 @@ RSpec.describe 'Admin Staff API', type: :request, swagger_doc: 'api-reference/ad
end
delete 'Remove a staff member from this store' do
- tags 'Configuration'
+ 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."
admin_scope :write, :settings
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.rb
index 92f7ad559c..47f31e0957 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-re
path '/api/v3/admin/allowed_origins' do
get 'List allowed origins' do
- tags 'Configuration'
+ tags 'Allowed Origins'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -59,7 +59,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-re
end
post 'Create an allowed origin' do
- tags 'Configuration'
+ tags 'Allowed Origins'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -110,7 +110,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-re
parameter name: :id, in: :path, type: :string, required: true, description: 'Allowed origin ID'
get 'Get an allowed origin' do
- tags 'Configuration'
+ tags 'Allowed Origins'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single allowed origin by prefixed ID.'
@@ -147,7 +147,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-re
end
patch 'Update an allowed origin' do
- tags 'Configuration'
+ tags 'Allowed Origins'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -191,7 +191,7 @@ RSpec.describe 'Admin Allowed Origins API', type: :request, swagger_doc: 'api-re
end
delete 'Delete an allowed origin' do
- tags 'Configuration'
+ tags 'Allowed Origins'
security [api_key: [], bearer_auth: []]
description <<~DESC
Removes an origin from the admin CORS allowlist. After deletion the
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.rb
index 33d259b57e..1d968a5912 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
@@ -13,7 +13,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/api_keys' do
get 'List API keys' do
- tags 'Configuration'
+ tags 'API Keys'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns publishable and secret API keys for the current store. ' \
@@ -43,7 +43,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-reference
end
post 'Create an API key' do
- tags 'Configuration'
+ tags 'API Keys'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -92,7 +92,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-reference
let(:id) { publishable_key.prefixed_id }
get 'Show an API key' do
- tags 'Configuration'
+ tags 'API Keys'
produces 'application/json'
security [api_key: [], bearer_auth: []]
admin_scope :read, :settings
@@ -114,7 +114,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-reference
end
delete 'Delete an API key' do
- tags 'Configuration'
+ tags 'API Keys'
security [api_key: [], bearer_auth: []]
admin_scope :write, :settings
@@ -136,7 +136,7 @@ RSpec.describe 'Admin API Keys API', type: :request, swagger_doc: 'api-reference
let(:id) { secret_key_record.prefixed_id }
patch 'Revoke an API key' do
- tags 'Configuration'
+ tags 'API Keys'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.'
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.rb
index 450d566dce..d833af1b0b 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
@@ -11,7 +11,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-re
path '/api/v3/admin/customer_groups' do
get 'List customer groups' do
- tags 'Customers'
+ tags 'Customer Groups'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -64,7 +64,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-re
end
post 'Create a customer group' do
- tags 'Customers'
+ tags 'Customer Groups'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -120,7 +120,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-re
parameter name: :id, in: :path, type: :string, required: true, description: 'Customer group prefixed ID'
get 'Get a customer group' do
- tags 'Customers'
+ tags 'Customer Groups'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -182,7 +182,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-re
end
patch 'Update a customer group' do
- tags 'Customers'
+ tags 'Customer Groups'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -232,7 +232,7 @@ RSpec.describe 'Admin Customer Groups API', type: :request, swagger_doc: 'api-re
end
delete 'Delete a customer group' do
- tags 'Customers'
+ 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.'
admin_scope :write, :customers
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.rb
index 394b02d45f..48bfe262cf 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
@@ -13,7 +13,7 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refere
path '/api/v3/admin/invitations' do
get 'List invitations' do
- tags 'Configuration'
+ tags 'Staff'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns invitations for the current store, including pending and accepted.'
@@ -36,7 +36,7 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refere
end
post 'Create an invitation' do
- tags 'Configuration'
+ tags 'Staff'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -75,7 +75,7 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refere
let(:id) { invitation.prefixed_id }
delete 'Revoke an invitation' do
- tags 'Configuration'
+ tags 'Staff'
security [api_key: [], bearer_auth: []]
admin_scope :write, :settings
@@ -97,7 +97,7 @@ RSpec.describe 'Admin Invitations API', type: :request, swagger_doc: 'api-refere
let(:id) { invitation.prefixed_id }
patch 'Resend an invitation' do
- tags 'Configuration'
+ tags 'Staff'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Issues a fresh token and dispatches the invitation email again.'
diff --git a/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb
index 3c22434559..28786946b8 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
@@ -27,7 +27,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/
path '/api/v3/admin/markets' do
get 'List markets' do
- tags 'Pricing'
+ tags 'Markets'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -61,7 +61,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/
end
post 'Create a market' do
- tags 'Pricing'
+ tags 'Markets'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -147,7 +147,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/
parameter name: :id, in: :path, type: :string, required: true
get 'Get a market' do
- tags 'Pricing'
+ tags 'Markets'
produces 'application/json'
security [api_key: [], bearer_auth: []]
admin_scope :read, :settings
@@ -181,7 +181,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/
end
patch 'Update a market' do
- tags 'Pricing'
+ tags 'Markets'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -239,7 +239,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/
end
delete 'Delete a market' do
- tags 'Pricing'
+ tags 'Markets'
security [api_key: [], bearer_auth: []]
description <<~DESC
Soft-deletes the market (sets `deleted_at`). The default market and
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.rb
index 8ddea56abc..2a946e78e9 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-refer
path '/api/v3/admin/option_types' do
get 'List option types' do
- tags 'Product Catalog'
+ tags 'Option Types'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a paginated list of option types.'
@@ -53,7 +53,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-refer
end
post 'Create an option type' do
- tags 'Product Catalog'
+ tags 'Option Types'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -117,7 +117,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-refer
path '/api/v3/admin/option_types/{id}' do
get 'Get an option type' do
- tags 'Product Catalog'
+ tags 'Option Types'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single option type by ID, including its option values.'
@@ -157,7 +157,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-refer
end
patch 'Update an option type' do
- tags 'Product Catalog'
+ tags 'Option Types'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -217,7 +217,7 @@ RSpec.describe 'Admin Option Types API', type: :request, swagger_doc: 'api-refer
end
delete 'Delete an option type' do
- tags 'Product Catalog'
+ tags 'Option Types'
security [api_key: [], bearer_auth: []]
description 'Deletes an option type.'
admin_scope :write, :products
diff --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.rb
index 959fd87820..e4a595e094 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
@@ -13,7 +13,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
let(:order_id) { order.prefixed_id }
get 'List fulfillments' do
- tags 'Orders'
+ tags 'Fulfillments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all shipments for an order.'
@@ -48,7 +48,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
let(:id) { shipment.prefixed_id }
get 'Show a shipment' do
- tags 'Orders'
+ tags 'Fulfillments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns details of a specific shipment.'
@@ -80,7 +80,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
end
patch 'Update a shipment' do
- tags 'Orders'
+ tags 'Fulfillments'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -118,7 +118,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
path '/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill' do
patch 'Fulfill a fulfillment' do
- tags 'Orders'
+ tags 'Fulfillments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Marks a fulfillment as fulfilled.'
@@ -153,7 +153,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
path '/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel' do
patch 'Cancel a fulfillment' do
- tags 'Orders'
+ tags 'Fulfillments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Cancels a fulfillment.'
@@ -184,7 +184,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
path '/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume' do
patch 'Resume a fulfillment' do
- tags 'Orders'
+ tags 'Fulfillments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Resumes a canceled fulfillment.'
@@ -219,7 +219,7 @@ RSpec.describe 'Admin Order Fulfillments API', type: :request, swagger_doc: 'api
path '/api/v3/admin/orders/{order_id}/fulfillments/{id}/split' do
patch 'Split a fulfillment' do
- tags 'Orders'
+ tags 'Fulfillments'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
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.rb
index fd4e804075..a5491bccb0 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
@@ -13,7 +13,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-ref
let(:order_id) { order.prefixed_id }
get 'List payments' do
- tags 'Orders'
+ tags 'Payments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all payments for an order.'
@@ -43,7 +43,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-ref
end
post 'Create a payment' do
- tags 'Orders'
+ tags 'Payments'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -87,7 +87,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-ref
let(:id) { payment.prefixed_id }
get 'Show a payment' do
- tags 'Orders'
+ tags 'Payments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns details of a specific payment.'
@@ -120,7 +120,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-ref
path '/api/v3/admin/orders/{order_id}/payments/{id}/capture' do
patch 'Capture a payment' do
- tags 'Orders'
+ tags 'Payments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Captures a pending payment.'
@@ -176,7 +176,7 @@ RSpec.describe 'Admin Order Payments API', type: :request, swagger_doc: 'api-ref
path '/api/v3/admin/orders/{order_id}/payments/{id}/void' do
patch 'Void a payment' do
- tags 'Orders'
+ tags 'Payments'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Voids a payment.'
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.rb
index 4115f6a321..ea411872ff 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
@@ -14,7 +14,7 @@ RSpec.describe 'Admin Order Refunds API', type: :request, swagger_doc: 'api-refe
let(:order_id) { order.prefixed_id }
get 'List refunds' do
- tags 'Orders'
+ tags 'Refunds'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all refunds for an order.'
@@ -43,7 +43,7 @@ RSpec.describe 'Admin Order Refunds API', type: :request, swagger_doc: 'api-refe
end
post 'Create a refund' do
- tags 'Orders'
+ tags 'Refunds'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
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.rb
index fa49d3740b..61705a2d0c 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Payment Methods API', type: :request, swagger_doc: 'api-re
path '/api/v3/admin/payment_methods' do
get 'List payment methods' do
- tags 'Configuration'
+ tags 'Payment Methods'
produces 'application/json'
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.'
@@ -38,7 +38,7 @@ RSpec.describe 'Admin Payment Methods API', type: :request, swagger_doc: 'api-re
path '/api/v3/admin/payment_methods/types' do
get 'List available payment provider types' do
- tags 'Configuration'
+ tags 'Payment Methods'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a "Provider" dropdown in admin UIs.'
@@ -77,7 +77,7 @@ RSpec.describe 'Admin Payment Methods API', type: :request, swagger_doc: 'api-re
let(:id) { payment_method.prefixed_id }
get 'Show a payment method' do
- tags 'Configuration'
+ tags 'Payment Methods'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a payment method by ID.'
diff --git a/spree/api/spec/integration/spree/api/v3/admin/products_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/products_spec.rb
index 5a7282dd9b..3651fba8b5 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products' do
get 'List products' do
- tags 'Product Catalog'
+ tags 'Products'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a paginated list of products for the current store.'
@@ -57,7 +57,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
end
post 'Create a product' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -161,7 +161,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/{id}' do
get 'Get a product' do
- tags 'Product Catalog'
+ tags 'Products'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single product by ID.'
@@ -201,7 +201,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
end
patch 'Update a product' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -300,7 +300,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
end
delete 'Delete a product' do
- tags 'Product Catalog'
+ tags 'Products'
security [api_key: [], bearer_auth: []]
description 'Soft-deletes a product.'
admin_scope :write, :products
@@ -325,7 +325,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_status_update' do
post 'Bulk-update product status' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -387,7 +387,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_add_to_categories' do
post 'Bulk-add products to categories' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -430,7 +430,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_remove_from_categories' do
post 'Bulk-remove products from categories' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -467,7 +467,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_add_to_channels' do
post 'Bulk-add products to channels' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -510,7 +510,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_remove_from_channels' do
post 'Bulk-remove products from channels' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -552,7 +552,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_add_tags' do
post 'Bulk-add tags to products' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -590,7 +590,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_remove_tags' do
post 'Bulk-remove tags from products' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -625,7 +625,7 @@ RSpec.describe 'Admin Products API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/bulk_destroy' do
delete 'Bulk-delete products' do
- tags 'Product Catalog'
+ tags 'Products'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/roles_spec.rb
index 43e6489623..d48a287d2d 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Roles API', type: :request, swagger_doc: 'api-reference/ad
path '/api/v3/admin/roles' do
get 'List roles' do
- tags 'Configuration'
+ tags 'Staff'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns the roles available for staff role pickers. Roles are global, not per-store.'
diff --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.rb
index 0cfd05b0da..cfc1b2cd54 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
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-re
path '/api/v3/admin/stock_locations' do
get 'List stock locations' do
- tags 'Configuration'
+ tags 'Stock Locations'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -70,7 +70,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-re
end
post 'Create a stock location' do
- tags 'Configuration'
+ tags 'Stock Locations'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -160,7 +160,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-re
parameter name: :id, in: :path, type: :string, required: true, description: 'Stock location ID'
get 'Get a stock location' do
- tags 'Configuration'
+ tags 'Stock Locations'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single stock location by prefixed ID.'
@@ -197,7 +197,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-re
end
patch 'Update a stock location' do
- tags 'Configuration'
+ tags 'Stock Locations'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -267,7 +267,7 @@ RSpec.describe 'Admin Stock Locations API', type: :request, swagger_doc: 'api-re
end
delete 'Delete a stock location' do
- tags 'Configuration'
+ tags 'Stock Locations'
security [api_key: [], bearer_auth: []]
description <<~DESC
Soft-deletes the stock location (sets `deleted_at`). Existing
diff --git a/spree/api/spec/integration/spree/api/v3/admin/store_credit_categories_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/store_credit_categories_spec.rb
index b6a999011d..2d077e6ca3 100644
--- a/spree/api/spec/integration/spree/api/v3/admin/store_credit_categories_spec.rb
+++ b/spree/api/spec/integration/spree/api/v3/admin/store_credit_categories_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe 'Admin Store Credit Categories API', type: :request, swagger_doc:
path '/api/v3/admin/store_credit_categories' do
get 'List store credit categories' do
- tags 'Configuration'
+ tags 'Settings'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -63,7 +63,7 @@ RSpec.describe 'Admin Store Credit Categories API', type: :request, swagger_doc:
parameter name: :id, in: :path, type: :string, required: true, description: 'Store credit category ID'
get 'Get a store credit category' do
- tags 'Configuration'
+ tags 'Settings'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single store credit category by prefixed ID.'
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.rb
index c1ef9e3a0e..d5e5507f1f 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
@@ -16,7 +16,7 @@ RSpec.describe 'Admin Store API', type: :request, swagger_doc: 'api-reference/ad
path '/api/v3/admin/store' do
get 'Get the current store' do
- tags 'Configuration'
+ tags 'Settings'
produces 'application/json'
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.'
@@ -53,7 +53,7 @@ RSpec.describe 'Admin Store API', type: :request, swagger_doc: 'api-reference/ad
end
patch 'Update the current store' do
- tags 'Configuration'
+ tags 'Settings'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/spree/api/spec/integration/spree/api/v3/admin/tags_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/tags_spec.rb
index b72b096087..459a64f338 100644
--- a/spree/api/spec/integration/spree/api/v3/admin/tags_spec.rb
+++ b/spree/api/spec/integration/spree/api/v3/admin/tags_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Admin Tags API', type: :request, swagger_doc: 'api-reference/adm
path '/api/v3/admin/tags' do
get 'List tags' do
- tags 'Configuration'
+ tags 'Settings'
produces 'application/json'
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.'
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.rb
index 83d6fcf46a..463374de49 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
@@ -11,7 +11,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/{product_id}/variants' do
get 'List product variants' do
- tags 'Product Catalog'
+ tags 'Variants'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a paginated list of variants for a product, including the master variant.'
@@ -42,7 +42,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-reference
end
post 'Create a variant' do
- tags 'Product Catalog'
+ tags 'Variants'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -144,7 +144,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-reference
path '/api/v3/admin/products/{product_id}/variants/{id}' do
get 'Get a variant' do
- tags 'Product Catalog'
+ tags 'Variants'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single variant by ID.'
@@ -185,7 +185,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-reference
end
patch 'Update a variant' do
- tags 'Product Catalog'
+ tags 'Variants'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -268,7 +268,7 @@ RSpec.describe 'Admin Variants API', type: :request, swagger_doc: 'api-reference
end
delete 'Delete a variant' do
- tags 'Product Catalog'
+ tags 'Variants'
security [api_key: [], bearer_auth: []]
description 'Soft-deletes a variant.'
admin_scope :write, :products
diff --git a/spree/api/spec/integration/spree/api/v3/admin/webhook_deliveries_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/webhook_deliveries_spec.rb
index aef9549ad6..f3be363dc1 100644
--- a/spree/api/spec/integration/spree/api/v3/admin/webhook_deliveries_spec.rb
+++ b/spree/api/spec/integration/spree/api/v3/admin/webhook_deliveries_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe 'Admin Webhook Deliveries API', type: :request, swagger_doc: 'api
description: 'Parent webhook endpoint ID'
get 'List webhook deliveries' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -74,7 +74,7 @@ RSpec.describe 'Admin Webhook Deliveries API', type: :request, swagger_doc: 'api
parameter name: :id, in: :path, type: :string, required: true, description: 'Webhook delivery ID'
get 'Get a webhook delivery' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -126,7 +126,7 @@ RSpec.describe 'Admin Webhook Deliveries API', type: :request, swagger_doc: 'api
description: 'Webhook delivery ID to redeliver'
post 'Redeliver a webhook delivery' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
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.rb
index 0f01c5e5f9..8f3a68986e 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
@@ -18,7 +18,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
path '/api/v3/admin/webhook_endpoints' do
get 'List webhook endpoints' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -72,7 +72,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
end
post 'Create a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -139,7 +139,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
parameter name: :id, in: :path, type: :string, required: true, description: 'Webhook endpoint ID'
get 'Get a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single webhook endpoint by prefixed ID.'
@@ -181,7 +181,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
end
patch 'Update a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -230,7 +230,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
end
delete 'Delete a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
security [api_key: [], bearer_auth: []]
description 'Soft-deletes the endpoint and stops future deliveries.'
admin_scope :write, :settings
@@ -254,7 +254,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
parameter name: :id, in: :path, type: :string, required: true, description: 'Webhook endpoint ID'
post 'Send a test delivery' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description <<~DESC
@@ -293,7 +293,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
parameter name: :id, in: :path, type: :string, required: true, description: 'Webhook endpoint ID'
patch 'Re-enable a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Re-enables an endpoint that was manually or automatically disabled.'
@@ -324,7 +324,7 @@ RSpec.describe 'Admin Webhook Endpoints API', type: :request, swagger_doc: 'api-
parameter name: :id, in: :path, type: :string, required: true, description: 'Webhook endpoint ID'
patch 'Disable a webhook endpoint' do
- tags 'Configuration'
+ tags 'Webhooks'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/spree/api/spec/swagger_helper.rb b/spree/api/spec/swagger_helper.rb
index 9658e61680..e13d3da03e 100644
--- a/spree/api/spec/swagger_helper.rb
+++ b/spree/api/spec/swagger_helper.rb
@@ -166,18 +166,40 @@ RSpec.configure do |config|
}
],
tags: [
- { name: 'Authentication', description: 'Admin user authentication' },
- { name: 'Product Catalog', description: 'Products, variants, and option types' },
- { name: 'Orders', description: 'Order management — orders, items, payments, fulfillments, refunds, gift cards, store credits' },
- { name: 'Customers', description: 'Customer management — profiles, addresses, store credits, credit cards' },
- { name: 'Configuration', description: 'Store configuration — payment methods, tag autocomplete' }
+ { name: 'Authentication', description: 'Admin user login, logout, token refresh, and current user profile' },
+ { name: 'Allowed Origins', description: 'CORS allowlist for storefront and admin client origins' },
+ { name: 'API Keys', description: 'Secret and publishable API keys' },
+ { name: 'Channels', description: 'Sales channels and product publication across channels' },
+ { name: 'Custom Fields', description: 'Custom field definitions for products, variants, customers, and other resources' },
+ { name: 'Customer Groups', description: 'Customer groups for segmenting customers (e.g. wholesale, VIP) used by pricing and promotions' },
+ { name: 'Customers', description: 'Customer profiles, addresses, credit cards, and store credits' },
+ { name: 'Exports', description: 'Async CSV exports of admin resources' },
+ { name: 'Fulfillments', description: 'Order fulfillments — shipments, fulfill, cancel, resume, split' },
+ { name: 'Gift Cards', description: 'Gift cards and gift card batches' },
+ { name: 'Markets', description: 'Markets — geographic groupings of countries used for pricing, tax, and fulfillment rules' },
+ { name: 'Option Types', description: 'Option types and option values used to build product variants (e.g. Size, Color)' },
+ { name: 'Orders', description: 'Orders, order items, applied gift cards, and applied store credits' },
+ { name: 'Payment Methods', description: 'Configured payment providers and their available types' },
+ { name: 'Payments', description: 'Order payments — list, capture, void' },
+ { name: 'Pricing', description: 'Prices and price lists for currency-, market-, and customer-group-specific pricing' },
+ { name: 'Products', description: 'Products, taxons/categories, product custom field values, and bulk product operations' },
+ { name: 'Promotions', description: 'Promotions, promotion rules, promotion actions, and coupon codes' },
+ { name: 'Refunds', description: 'Order refunds' },
+ { name: 'Settings', description: 'Store-level settings — store profile, tags, store credit categories' },
+ { name: 'Staff', description: 'Admin users, roles, and invitations to the store' },
+ { name: 'Stock Locations', description: 'Warehouses and physical fulfillment locations' },
+ { name: 'Variants', description: 'Product variants — the individual SKUs (size/color combinations) sold under a product' },
+ { name: 'Webhooks', description: 'Webhook endpoints and webhook delivery history' }
],
'x-tagGroups': [
{ name: 'Authentication', tags: ['Authentication'] },
- { name: 'Product Catalog', tags: ['Product Catalog'] },
- { name: 'Orders', tags: ['Orders'] },
- { name: 'Customers', tags: ['Customers'] },
- { name: 'Configuration', tags: ['Configuration'] }
+ { name: 'Products & Catalog', tags: ['Products', 'Variants', 'Option Types', 'Custom Fields', 'Channels'] },
+ { name: 'Pricing', tags: ['Pricing', 'Markets'] },
+ { name: 'Orders & Fulfillment', tags: ['Orders', 'Payments', 'Fulfillments', 'Refunds'] },
+ { name: 'Customers', tags: ['Customers', 'Customer Groups'] },
+ { name: 'Promotions & Gift Cards', tags: ['Promotions', 'Gift Cards'] },
+ { name: 'Data', tags: ['Exports'] },
+ { name: 'Configuration', tags: ['Settings', 'Stock Locations', 'Payment Methods', 'Staff', 'API Keys', 'Allowed Origins', 'Webhooks'] }
],
components: {
securitySchemes: {