@spree/docs 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-reference/admin-api/authentication.md +8 -7
- package/dist/api-reference/admin-api/endpoints.md +348 -0
- package/dist/api-reference/admin-api/errors.md +2 -0
- package/dist/api-reference/admin-api/introduction.md +11 -0
- package/dist/api-reference/store.yaml +243 -232
- package/dist/developer/agentic/overview.md +1 -1
- package/dist/developer/cli/admin-api.md +146 -0
- package/dist/developer/cli/quickstart.md +40 -5
- package/dist/developer/core-concepts/addresses.md +32 -16
- package/dist/developer/core-concepts/adjustments.md +11 -5
- package/dist/developer/core-concepts/architecture.md +8 -8
- package/dist/developer/core-concepts/calculators.md +31 -51
- package/dist/developer/core-concepts/channels.md +13 -6
- package/dist/developer/core-concepts/customers.md +47 -23
- package/dist/developer/core-concepts/events.md +22 -17
- package/dist/developer/core-concepts/imports-exports.md +69 -14
- package/dist/developer/core-concepts/inventory.md +79 -1
- package/dist/developer/core-concepts/markets.md +64 -20
- package/dist/developer/core-concepts/media.md +43 -6
- package/dist/developer/core-concepts/metafields.md +76 -13
- package/dist/developer/core-concepts/orders.md +95 -17
- package/dist/developer/core-concepts/payments.md +14 -13
- package/dist/developer/core-concepts/pricing.md +95 -9
- package/dist/developer/core-concepts/products.md +192 -26
- package/dist/developer/core-concepts/promotions.md +61 -4
- package/dist/developer/core-concepts/reports.md +4 -2
- package/dist/developer/core-concepts/search-filtering.md +82 -32
- package/dist/developer/core-concepts/shipments.md +16 -13
- package/dist/developer/core-concepts/slugs.md +20 -11
- package/dist/developer/core-concepts/staff-roles.md +51 -1
- package/dist/developer/core-concepts/store-credits-gift-cards.md +90 -9
- package/dist/developer/core-concepts/stores.md +16 -14
- package/dist/developer/core-concepts/taxes.md +28 -0
- package/dist/developer/core-concepts/translations.md +16 -7
- package/dist/developer/core-concepts/users.md +13 -9
- package/dist/developer/core-concepts/webhooks.md +95 -64
- package/dist/developer/how-to/custom-api-authentication.md +103 -23
- package/dist/developer/multi-store/quickstart.md +1 -1
- package/dist/developer/sdk/admin/authentication.md +1 -1
- package/dist/developer/sdk/admin/resources.md +2 -0
- package/dist/developer/upgrades/5.3-to-5.4.md +1 -1
- package/dist/developer/upgrades/5.4-to-5.5.md +1 -1
- package/dist/integrations/integrations.md +0 -7
- package/package.json +1 -1
- package/dist/integrations/sso-mfa-social-login/admin-dashboard.md +0 -57
- package/dist/integrations/sso-mfa-social-login/storefront.md +0 -56
|
@@ -25,13 +25,16 @@ const client = createAdminClient({
|
|
|
25
25
|
const { data: products } = await client.products.list()
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
```bash
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
```bash CLI
|
|
29
|
+
# Point the CLI at your store + key, then call any endpoint:
|
|
30
|
+
export SPREE_BASE_URL='https://store.example.com'
|
|
31
|
+
export SPREE_API_KEY='sk_xxx'
|
|
32
|
+
|
|
33
|
+
spree api get /products
|
|
31
34
|
```
|
|
32
35
|
|
|
33
36
|
|
|
34
|
-
Secret API keys are prefixed with `sk_`. Create them in the Spree admin under **Settings → API Keys
|
|
37
|
+
Secret API keys are prefixed with `sk_`. Create them with the [Spree CLI](../../developer/cli/admin-api.md) or in the Spree admin under **Settings → API Keys**:
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
40
|
spree api-key create --type secret --scopes read_orders,write_products # Create a scoped secret key
|
|
@@ -149,9 +152,7 @@ If the key lacks the required scope, the API returns `403 Forbidden`:
|
|
|
149
152
|
}
|
|
150
153
|
```
|
|
151
154
|
|
|
152
|
-
The `details.required_scope` field tells you exactly which scope to add.
|
|
153
|
-
|
|
154
|
-
Pick scopes when creating the key in **Settings → API Keys**. Choose the narrowest set that covers your integration's needs.
|
|
155
|
+
The `details.required_scope` field tells you exactly which scope to add — and `spree api-key create --type secret --scopes <scope>` mints a key that has it. Choose the narrowest set that covers your integration's needs.
|
|
155
156
|
|
|
156
157
|
### JWT bearer tokens: CanCanCan abilities
|
|
157
158
|
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Admin API endpoint index"
|
|
3
|
+
sidebarTitle: "Endpoint index"
|
|
4
|
+
description: "Every Spree Admin API v3 endpoint at a glance — method, path, required API key scope, and summary, grouped by resource."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
{/* Generated from docs/api-reference/admin.yaml by packages/cli/scripts/generate-endpoints-doc.mjs — do not edit by hand. */}
|
|
8
|
+
|
|
9
|
+
All 192 Admin API operations, with the [scope](authentication.md) a secret API key needs for each. JWT-authenticated admin users are governed by their roles instead of scopes. The same index is available offline via the CLI: `spree api endpoints`.
|
|
10
|
+
|
|
11
|
+
Endpoints marked — are exempt from scope checks (authentication and session endpoints) or resolve their scope at request time.
|
|
12
|
+
|
|
13
|
+
## Admin users
|
|
14
|
+
|
|
15
|
+
| Method | Path | Required scope | Summary |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| `GET` | `/admin_users` | `read_settings` | List staff |
|
|
18
|
+
| `GET` | `/admin_users/{id}` | `read_settings` | Show a staff member |
|
|
19
|
+
| `PATCH` | `/admin_users/{id}` | `write_settings` | Update a staff member |
|
|
20
|
+
| `DELETE` | `/admin_users/{id}` | `write_settings` | Remove a staff member from this store |
|
|
21
|
+
|
|
22
|
+
## Allowed origins
|
|
23
|
+
|
|
24
|
+
| Method | Path | Required scope | Summary |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| `GET` | `/allowed_origins` | `read_settings` | List allowed origins |
|
|
27
|
+
| `POST` | `/allowed_origins` | `write_settings` | Create an allowed origin |
|
|
28
|
+
| `GET` | `/allowed_origins/{id}` | `read_settings` | Get an allowed origin |
|
|
29
|
+
| `PATCH` | `/allowed_origins/{id}` | `write_settings` | Update an allowed origin |
|
|
30
|
+
| `DELETE` | `/allowed_origins/{id}` | `write_settings` | Delete an allowed origin |
|
|
31
|
+
|
|
32
|
+
## Api keys
|
|
33
|
+
|
|
34
|
+
| Method | Path | Required scope | Summary |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| `GET` | `/api_keys` | `read_api_keys` | List API keys |
|
|
37
|
+
| `POST` | `/api_keys` | `write_api_keys` | Create an API key |
|
|
38
|
+
| `GET` | `/api_keys/{id}` | `read_api_keys` | Show an API key |
|
|
39
|
+
| `DELETE` | `/api_keys/{id}` | `write_api_keys` | Delete an API key |
|
|
40
|
+
| `PATCH` | `/api_keys/{id}/revoke` | `write_api_keys` | Revoke an API key |
|
|
41
|
+
|
|
42
|
+
## Auth
|
|
43
|
+
|
|
44
|
+
| Method | Path | Required scope | Summary |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| `POST` | `/auth/login` | — | Login |
|
|
47
|
+
| `POST` | `/auth/refresh` | — | Refresh token |
|
|
48
|
+
| `POST` | `/auth/logout` | — | Logout |
|
|
49
|
+
|
|
50
|
+
## Channels
|
|
51
|
+
|
|
52
|
+
| Method | Path | Required scope | Summary |
|
|
53
|
+
|---|---|---|---|
|
|
54
|
+
| `GET` | `/channels` | `read_settings` | List channels |
|
|
55
|
+
| `POST` | `/channels` | `write_settings` | Create a channel |
|
|
56
|
+
| `GET` | `/channels/{id}` | `read_settings` | Get a channel |
|
|
57
|
+
| `PATCH` | `/channels/{id}` | `write_settings` | Update a channel |
|
|
58
|
+
| `DELETE` | `/channels/{id}` | `write_settings` | Delete a channel |
|
|
59
|
+
| `POST` | `/channels/{id}/add_products` | `write_products` | Publish products on a channel |
|
|
60
|
+
| `POST` | `/channels/{id}/remove_products` | `write_products` | Unpublish products from a channel |
|
|
61
|
+
|
|
62
|
+
## Custom field definitions
|
|
63
|
+
|
|
64
|
+
| Method | Path | Required scope | Summary |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| `GET` | `/custom_field_definitions` | `read_settings` | List custom field definitions |
|
|
67
|
+
| `POST` | `/custom_field_definitions` | `write_settings` | Create a custom field definition |
|
|
68
|
+
| `GET` | `/custom_field_definitions/{id}` | `read_settings` | Show a custom field definition |
|
|
69
|
+
| `PATCH` | `/custom_field_definitions/{id}` | `write_settings` | Update a custom field definition |
|
|
70
|
+
| `DELETE` | `/custom_field_definitions/{id}` | `write_settings` | Delete a custom field definition |
|
|
71
|
+
|
|
72
|
+
## Customer groups
|
|
73
|
+
|
|
74
|
+
| Method | Path | Required scope | Summary |
|
|
75
|
+
|---|---|---|---|
|
|
76
|
+
| `GET` | `/customer_groups` | `read_customers` | List customer groups |
|
|
77
|
+
| `POST` | `/customer_groups` | `write_customers` | Create a customer group |
|
|
78
|
+
| `GET` | `/customer_groups/{id}` | `read_customers` | Get a customer group |
|
|
79
|
+
| `PATCH` | `/customer_groups/{id}` | `write_customers` | Update a customer group |
|
|
80
|
+
| `DELETE` | `/customer_groups/{id}` | `write_customers` | Delete a customer group |
|
|
81
|
+
|
|
82
|
+
## Customers
|
|
83
|
+
|
|
84
|
+
| Method | Path | Required scope | Summary |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| `GET` | `/customers/{customer_id}/addresses` | `read_customers` | List customer addresses |
|
|
87
|
+
| `POST` | `/customers/{customer_id}/addresses` | `write_customers` | Create a customer address |
|
|
88
|
+
| `PATCH` | `/customers/{customer_id}/addresses/{id}` | `write_customers` | Update a customer address |
|
|
89
|
+
| `DELETE` | `/customers/{customer_id}/addresses/{id}` | `write_customers` | Delete a customer address |
|
|
90
|
+
| `GET` | `/customers/{customer_id}/credit_cards` | `read_customers` | List customer credit cards |
|
|
91
|
+
| `GET` | `/customers/{customer_id}/credit_cards/{id}` | `read_customers` | Show a customer credit card |
|
|
92
|
+
| `DELETE` | `/customers/{customer_id}/credit_cards/{id}` | `write_customers` | Delete a customer credit card |
|
|
93
|
+
| `GET` | `/customers/{customer_id}/store_credits` | `read_store_credits` | List customer store credits |
|
|
94
|
+
| `POST` | `/customers/{customer_id}/store_credits` | `write_store_credits` | Issue a store credit to a customer |
|
|
95
|
+
| `PATCH` | `/customers/{customer_id}/store_credits/{id}` | `write_store_credits` | Update a store credit |
|
|
96
|
+
| `DELETE` | `/customers/{customer_id}/store_credits/{id}` | `write_store_credits` | Delete a store credit |
|
|
97
|
+
| `GET` | `/customers` | `read_customers` | List customers |
|
|
98
|
+
| `POST` | `/customers` | `write_customers` | Create a customer |
|
|
99
|
+
| `GET` | `/customers/{id}` | `read_customers` | Show a customer |
|
|
100
|
+
| `PATCH` | `/customers/{id}` | `write_customers` | Update a customer |
|
|
101
|
+
| `DELETE` | `/customers/{id}` | `write_customers` | Delete a customer |
|
|
102
|
+
| `POST` | `/customers/bulk_add_to_groups` | `write_customers` | Bulk-add customers to groups |
|
|
103
|
+
| `POST` | `/customers/bulk_remove_from_groups` | `write_customers` | Bulk-remove customers from groups |
|
|
104
|
+
| `POST` | `/customers/bulk_add_tags` | `write_customers` | Bulk-add tags to customers |
|
|
105
|
+
| `POST` | `/customers/bulk_remove_tags` | `write_customers` | Bulk-remove tags from customers |
|
|
106
|
+
|
|
107
|
+
## Exports
|
|
108
|
+
|
|
109
|
+
| Method | Path | Required scope | Summary |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `GET` | `/exports` | *the read scope of the exported resource* | List exports |
|
|
112
|
+
| `POST` | `/exports` | *the read scope of the exported resource* | Create an export |
|
|
113
|
+
| `GET` | `/exports/{id}` | *the read scope of the exported resource* | Show an export |
|
|
114
|
+
| `DELETE` | `/exports/{id}` | *the read scope of the exported resource* | Delete an export |
|
|
115
|
+
| `GET` | `/exports/{id}/download` | *the read scope of the exported resource* | Download an export |
|
|
116
|
+
|
|
117
|
+
## Gift card batches
|
|
118
|
+
|
|
119
|
+
| Method | Path | Required scope | Summary |
|
|
120
|
+
|---|---|---|---|
|
|
121
|
+
| `GET` | `/gift_card_batches` | `read_gift_cards` | List gift card batches |
|
|
122
|
+
| `POST` | `/gift_card_batches` | `write_gift_cards` | Create a gift card batch |
|
|
123
|
+
| `GET` | `/gift_card_batches/{id}` | `read_gift_cards` | Get a gift card batch |
|
|
124
|
+
|
|
125
|
+
## Gift cards
|
|
126
|
+
|
|
127
|
+
| Method | Path | Required scope | Summary |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| `GET` | `/gift_cards` | `read_gift_cards` | List gift cards |
|
|
130
|
+
| `POST` | `/gift_cards` | `write_gift_cards` | Create a gift card |
|
|
131
|
+
| `GET` | `/gift_cards/{id}` | `read_gift_cards` | Get a gift card |
|
|
132
|
+
| `PATCH` | `/gift_cards/{id}` | `write_gift_cards` | Update a gift card |
|
|
133
|
+
| `DELETE` | `/gift_cards/{id}` | `write_gift_cards` | Delete a gift card |
|
|
134
|
+
|
|
135
|
+
## Invitations
|
|
136
|
+
|
|
137
|
+
| Method | Path | Required scope | Summary |
|
|
138
|
+
|---|---|---|---|
|
|
139
|
+
| `GET` | `/invitations` | `read_settings` | List invitations |
|
|
140
|
+
| `POST` | `/invitations` | `write_settings` | Create an invitation |
|
|
141
|
+
| `DELETE` | `/invitations/{id}` | `write_settings` | Revoke an invitation |
|
|
142
|
+
| `PATCH` | `/invitations/{id}/resend` | `write_settings` | Resend an invitation |
|
|
143
|
+
|
|
144
|
+
## Markets
|
|
145
|
+
|
|
146
|
+
| Method | Path | Required scope | Summary |
|
|
147
|
+
|---|---|---|---|
|
|
148
|
+
| `GET` | `/markets` | `read_settings` | List markets |
|
|
149
|
+
| `POST` | `/markets` | `write_settings` | Create a market |
|
|
150
|
+
| `GET` | `/markets/{id}` | `read_settings` | Get a market |
|
|
151
|
+
| `PATCH` | `/markets/{id}` | `write_settings` | Update a market |
|
|
152
|
+
| `DELETE` | `/markets/{id}` | `write_settings` | Delete a market |
|
|
153
|
+
|
|
154
|
+
## Me
|
|
155
|
+
|
|
156
|
+
| Method | Path | Required scope | Summary |
|
|
157
|
+
|---|---|---|---|
|
|
158
|
+
| `GET` | `/me` | — | Get current admin user and permissions |
|
|
159
|
+
|
|
160
|
+
## Option types
|
|
161
|
+
|
|
162
|
+
| Method | Path | Required scope | Summary |
|
|
163
|
+
|---|---|---|---|
|
|
164
|
+
| `GET` | `/option_types` | `read_products` | List option types |
|
|
165
|
+
| `POST` | `/option_types` | `write_products` | Create an option type |
|
|
166
|
+
| `GET` | `/option_types/{id}` | `read_products` | Get an option type |
|
|
167
|
+
| `PATCH` | `/option_types/{id}` | `write_products` | Update an option type |
|
|
168
|
+
| `DELETE` | `/option_types/{id}` | `write_products` | Delete an option type |
|
|
169
|
+
|
|
170
|
+
## Orders
|
|
171
|
+
|
|
172
|
+
| Method | Path | Required scope | Summary |
|
|
173
|
+
|---|---|---|---|
|
|
174
|
+
| `GET` | `/orders/{order_id}/fulfillments` | `read_fulfillments` | List fulfillments |
|
|
175
|
+
| `GET` | `/orders/{order_id}/fulfillments/{id}` | `read_fulfillments` | Show a shipment |
|
|
176
|
+
| `PATCH` | `/orders/{order_id}/fulfillments/{id}` | `write_fulfillments` | Update a shipment |
|
|
177
|
+
| `PATCH` | `/orders/{order_id}/fulfillments/{id}/fulfill` | `write_fulfillments` | Fulfill a fulfillment |
|
|
178
|
+
| `PATCH` | `/orders/{order_id}/fulfillments/{id}/cancel` | `write_fulfillments` | Cancel a fulfillment |
|
|
179
|
+
| `PATCH` | `/orders/{order_id}/fulfillments/{id}/resume` | `write_fulfillments` | Resume a fulfillment |
|
|
180
|
+
| `PATCH` | `/orders/{order_id}/fulfillments/{id}/split` | `write_fulfillments` | Split a fulfillment |
|
|
181
|
+
| `POST` | `/orders/{order_id}/gift_cards` | `write_gift_cards` | Apply a gift card to an order |
|
|
182
|
+
| `DELETE` | `/orders/{order_id}/gift_cards/{id}` | `write_gift_cards` | Remove a gift card from an order |
|
|
183
|
+
| `GET` | `/orders/{order_id}/items` | `read_orders` | List order items |
|
|
184
|
+
| `POST` | `/orders/{order_id}/items` | `write_orders` | Add an item |
|
|
185
|
+
| `GET` | `/orders/{order_id}/items/{id}` | `read_orders` | Show an item |
|
|
186
|
+
| `PATCH` | `/orders/{order_id}/items/{id}` | `write_orders` | Update an item |
|
|
187
|
+
| `DELETE` | `/orders/{order_id}/items/{id}` | `write_orders` | Remove an item |
|
|
188
|
+
| `POST` | `/orders/{order_id}/store_credits` | `write_store_credits` | Apply customer's store credit to an order |
|
|
189
|
+
| `DELETE` | `/orders/{order_id}/store_credits` | `write_store_credits` | Remove store credit from an order |
|
|
190
|
+
| `GET` | `/orders` | `read_orders` | List orders |
|
|
191
|
+
| `POST` | `/orders` | `write_orders` | Create a draft order |
|
|
192
|
+
| `GET` | `/orders/{id}` | `read_orders` | Show an order |
|
|
193
|
+
| `PATCH` | `/orders/{id}` | `write_orders` | Update an order |
|
|
194
|
+
| `DELETE` | `/orders/{id}` | `write_orders` | Delete a draft order |
|
|
195
|
+
| `PATCH` | `/orders/{id}/complete` | `write_orders` | Complete an order |
|
|
196
|
+
| `PATCH` | `/orders/{id}/cancel` | `write_orders` | Cancel an order |
|
|
197
|
+
| `PATCH` | `/orders/{id}/approve` | `write_orders` | Approve an order |
|
|
198
|
+
| `PATCH` | `/orders/{id}/resume` | `write_orders` | Resume a canceled order |
|
|
199
|
+
| `POST` | `/orders/{id}/resend_confirmation` | `write_orders` | Resend confirmation email |
|
|
200
|
+
| `GET` | `/orders/{order_id}/payments` | `read_payments` | List payments |
|
|
201
|
+
| `POST` | `/orders/{order_id}/payments` | `write_payments` | Create a payment |
|
|
202
|
+
| `GET` | `/orders/{order_id}/payments/{id}` | `read_payments` | Show a payment |
|
|
203
|
+
| `PATCH` | `/orders/{order_id}/payments/{id}/capture` | `write_payments` | Capture a payment |
|
|
204
|
+
| `PATCH` | `/orders/{order_id}/payments/{id}/void` | `write_payments` | Void a payment |
|
|
205
|
+
| `GET` | `/orders/{order_id}/refunds` | `read_refunds` | List refunds |
|
|
206
|
+
| `POST` | `/orders/{order_id}/refunds` | `write_refunds` | Create a refund |
|
|
207
|
+
|
|
208
|
+
## Payment methods
|
|
209
|
+
|
|
210
|
+
| Method | Path | Required scope | Summary |
|
|
211
|
+
|---|---|---|---|
|
|
212
|
+
| `GET` | `/payment_methods` | `read_settings` | List payment methods |
|
|
213
|
+
| `GET` | `/payment_methods/types` | `read_settings` | List available payment provider types |
|
|
214
|
+
| `GET` | `/payment_methods/{id}` | `read_settings` | Show a payment method |
|
|
215
|
+
|
|
216
|
+
## Price lists
|
|
217
|
+
|
|
218
|
+
| Method | Path | Required scope | Summary |
|
|
219
|
+
|---|---|---|---|
|
|
220
|
+
| `GET` | `/price_lists` | `read_products` | List price lists |
|
|
221
|
+
| `POST` | `/price_lists` | `write_products` | Create a price list |
|
|
222
|
+
| `GET` | `/price_lists/{id}` | `read_products` | Get a price list |
|
|
223
|
+
| `PATCH` | `/price_lists/{id}` | `write_products` | Update a price list |
|
|
224
|
+
| `DELETE` | `/price_lists/{id}` | `write_products` | Delete a price list |
|
|
225
|
+
| `PATCH` | `/price_lists/{id}/activate` | `write_products` | Activate a price list |
|
|
226
|
+
| `PATCH` | `/price_lists/{id}/deactivate` | `write_products` | Deactivate a price list |
|
|
227
|
+
|
|
228
|
+
## Prices
|
|
229
|
+
|
|
230
|
+
| Method | Path | Required scope | Summary |
|
|
231
|
+
|---|---|---|---|
|
|
232
|
+
| `GET` | `/prices` | `read_products` | List prices |
|
|
233
|
+
| `POST` | `/prices` | `write_products` | Create a price |
|
|
234
|
+
| `GET` | `/prices/{id}` | `read_products` | Get a price |
|
|
235
|
+
| `PATCH` | `/prices/{id}` | `write_products` | Update a price |
|
|
236
|
+
| `DELETE` | `/prices/{id}` | `write_products` | Delete a price |
|
|
237
|
+
| `POST` | `/prices/bulk_upsert` | `write_products` | Bulk-upsert prices |
|
|
238
|
+
| `DELETE` | `/prices/bulk_destroy` | `write_products` | Bulk-delete prices |
|
|
239
|
+
|
|
240
|
+
## Products
|
|
241
|
+
|
|
242
|
+
| Method | Path | Required scope | Summary |
|
|
243
|
+
|---|---|---|---|
|
|
244
|
+
| `GET` | `/products/{product_id}/custom_fields` | `read_products` | List product custom fields |
|
|
245
|
+
| `POST` | `/products/{product_id}/custom_fields` | `write_products` | Create a product custom field |
|
|
246
|
+
| `GET` | `/products/{product_id}/custom_fields/{id}` | `read_products` | Show a product custom field |
|
|
247
|
+
| `PATCH` | `/products/{product_id}/custom_fields/{id}` | `write_products` | Update a product custom field |
|
|
248
|
+
| `DELETE` | `/products/{product_id}/custom_fields/{id}` | `write_products` | Delete a product custom field |
|
|
249
|
+
| `GET` | `/products` | `read_products` | List products |
|
|
250
|
+
| `POST` | `/products` | `write_products` | Create a product |
|
|
251
|
+
| `GET` | `/products/{id}` | `read_products` | Get a product |
|
|
252
|
+
| `PATCH` | `/products/{id}` | `write_products` | Update a product |
|
|
253
|
+
| `DELETE` | `/products/{id}` | `write_products` | Delete a product |
|
|
254
|
+
| `POST` | `/products/bulk_status_update` | `write_products` | Bulk-update product status |
|
|
255
|
+
| `POST` | `/products/bulk_add_to_categories` | `write_products` | Bulk-add products to categories |
|
|
256
|
+
| `POST` | `/products/bulk_remove_from_categories` | `write_products` | Bulk-remove products from categories |
|
|
257
|
+
| `POST` | `/products/bulk_add_to_channels` | `write_products` | Bulk-add products to channels |
|
|
258
|
+
| `POST` | `/products/bulk_remove_from_channels` | `write_products` | Bulk-remove products from channels |
|
|
259
|
+
| `POST` | `/products/bulk_add_tags` | `write_products` | Bulk-add tags to products |
|
|
260
|
+
| `POST` | `/products/bulk_remove_tags` | `write_products` | Bulk-remove tags from products |
|
|
261
|
+
| `DELETE` | `/products/bulk_destroy` | `write_products` | Bulk-delete products |
|
|
262
|
+
| `GET` | `/products/{product_id}/variants` | `read_products` | List product variants |
|
|
263
|
+
| `POST` | `/products/{product_id}/variants` | `write_products` | Create a variant |
|
|
264
|
+
| `GET` | `/products/{product_id}/variants/{id}` | `read_products` | Get a variant |
|
|
265
|
+
| `PATCH` | `/products/{product_id}/variants/{id}` | `write_products` | Update a variant |
|
|
266
|
+
| `DELETE` | `/products/{product_id}/variants/{id}` | `write_products` | Delete a variant |
|
|
267
|
+
|
|
268
|
+
## Promotion actions
|
|
269
|
+
|
|
270
|
+
| Method | Path | Required scope | Summary |
|
|
271
|
+
|---|---|---|---|
|
|
272
|
+
| `GET` | `/promotion_actions/types` | `read_promotions` | List available promotion action types |
|
|
273
|
+
|
|
274
|
+
## Promotion rules
|
|
275
|
+
|
|
276
|
+
| Method | Path | Required scope | Summary |
|
|
277
|
+
|---|---|---|---|
|
|
278
|
+
| `GET` | `/promotion_rules/types` | `read_promotions` | List available promotion rule types |
|
|
279
|
+
|
|
280
|
+
## Promotions
|
|
281
|
+
|
|
282
|
+
| Method | Path | Required scope | Summary |
|
|
283
|
+
|---|---|---|---|
|
|
284
|
+
| `GET` | `/promotions/{promotion_id}/coupon_codes` | `read_promotions` | List coupon codes for a promotion |
|
|
285
|
+
| `GET` | `/promotions/{promotion_id}/promotion_actions` | `read_promotions` | List actions for a promotion |
|
|
286
|
+
| `POST` | `/promotions/{promotion_id}/promotion_actions` | `write_promotions` | Create an action on a promotion |
|
|
287
|
+
| `DELETE` | `/promotions/{promotion_id}/promotion_actions/{id}` | `write_promotions` | Delete an action from a promotion |
|
|
288
|
+
| `GET` | `/promotions/{promotion_id}/promotion_rules` | `read_promotions` | List rules for a promotion |
|
|
289
|
+
| `POST` | `/promotions/{promotion_id}/promotion_rules` | `write_promotions` | Create a rule on a promotion |
|
|
290
|
+
| `PATCH` | `/promotions/{promotion_id}/promotion_rules/{id}` | `write_promotions` | Update a rule's preferences |
|
|
291
|
+
| `DELETE` | `/promotions/{promotion_id}/promotion_rules/{id}` | `write_promotions` | Delete a rule from a promotion |
|
|
292
|
+
| `GET` | `/promotions` | `read_promotions` | List promotions |
|
|
293
|
+
| `POST` | `/promotions` | `write_promotions` | Create a promotion |
|
|
294
|
+
| `GET` | `/promotions/{id}` | `read_promotions` | Show a promotion |
|
|
295
|
+
| `PATCH` | `/promotions/{id}` | `write_promotions` | Update a promotion |
|
|
296
|
+
| `DELETE` | `/promotions/{id}` | `write_promotions` | Delete a promotion |
|
|
297
|
+
|
|
298
|
+
## Roles
|
|
299
|
+
|
|
300
|
+
| Method | Path | Required scope | Summary |
|
|
301
|
+
|---|---|---|---|
|
|
302
|
+
| `GET` | `/roles` | `read_settings` | List roles |
|
|
303
|
+
|
|
304
|
+
## Stock locations
|
|
305
|
+
|
|
306
|
+
| Method | Path | Required scope | Summary |
|
|
307
|
+
|---|---|---|---|
|
|
308
|
+
| `GET` | `/stock_locations` | `read_stock` | List stock locations |
|
|
309
|
+
| `POST` | `/stock_locations` | `write_stock` | Create a stock location |
|
|
310
|
+
| `GET` | `/stock_locations/{id}` | `read_stock` | Get a stock location |
|
|
311
|
+
| `PATCH` | `/stock_locations/{id}` | `write_stock` | Update a stock location |
|
|
312
|
+
| `DELETE` | `/stock_locations/{id}` | `write_stock` | Delete a stock location |
|
|
313
|
+
|
|
314
|
+
## Store
|
|
315
|
+
|
|
316
|
+
| Method | Path | Required scope | Summary |
|
|
317
|
+
|---|---|---|---|
|
|
318
|
+
| `GET` | `/store` | `read_settings` | Get the current store |
|
|
319
|
+
| `PATCH` | `/store` | `write_settings` | Update the current store |
|
|
320
|
+
|
|
321
|
+
## Store credit categories
|
|
322
|
+
|
|
323
|
+
| Method | Path | Required scope | Summary |
|
|
324
|
+
|---|---|---|---|
|
|
325
|
+
| `GET` | `/store_credit_categories` | `read_settings` | List store credit categories |
|
|
326
|
+
| `GET` | `/store_credit_categories/{id}` | `read_settings` | Get a store credit category |
|
|
327
|
+
|
|
328
|
+
## Tags
|
|
329
|
+
|
|
330
|
+
| Method | Path | Required scope | Summary |
|
|
331
|
+
|---|---|---|---|
|
|
332
|
+
| `GET` | `/tags` | — | List tags |
|
|
333
|
+
|
|
334
|
+
## Webhook endpoints
|
|
335
|
+
|
|
336
|
+
| Method | Path | Required scope | Summary |
|
|
337
|
+
|---|---|---|---|
|
|
338
|
+
| `GET` | `/webhook_endpoints/{webhook_endpoint_id}/deliveries` | `read_webhooks` | List webhook deliveries |
|
|
339
|
+
| `GET` | `/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}` | `read_webhooks` | Get a webhook delivery |
|
|
340
|
+
| `POST` | `/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}/redeliver` | `write_webhooks` | Redeliver a webhook delivery |
|
|
341
|
+
| `GET` | `/webhook_endpoints` | `read_webhooks` | List webhook endpoints |
|
|
342
|
+
| `POST` | `/webhook_endpoints` | `write_webhooks` | Create a webhook endpoint |
|
|
343
|
+
| `GET` | `/webhook_endpoints/{id}` | `read_webhooks` | Get a webhook endpoint |
|
|
344
|
+
| `PATCH` | `/webhook_endpoints/{id}` | `write_webhooks` | Update a webhook endpoint |
|
|
345
|
+
| `DELETE` | `/webhook_endpoints/{id}` | `write_webhooks` | Delete a webhook endpoint |
|
|
346
|
+
| `POST` | `/webhook_endpoints/{id}/send_test` | `write_webhooks` | Send a test delivery |
|
|
347
|
+
| `PATCH` | `/webhook_endpoints/{id}/enable` | `write_webhooks` | Re-enable a webhook endpoint |
|
|
348
|
+
| `PATCH` | `/webhook_endpoints/{id}/disable` | `write_webhooks` | Disable a webhook endpoint |
|
|
@@ -5,6 +5,8 @@ description: "Reference for the Spree Admin API Stripe-style error response form
|
|
|
5
5
|
|
|
6
6
|
The Admin API uses the same Stripe-style error format as the rest of the Spree v3 API. Every error response carries a machine-readable `code` and a human-readable `message`.
|
|
7
7
|
|
|
8
|
+
> **TIP:** Debugging a failing request? The [Spree CLI](../../developer/cli/admin-api.md) is the fastest probe: `spree api get /orders/<id>` shows the live state, and on a `403` it prints the exact missing scope plus the command to mint a key that has it.
|
|
9
|
+
|
|
8
10
|
## Error response format
|
|
9
11
|
|
|
10
12
|
```json
|
|
@@ -53,8 +53,19 @@ const { data: orders } = await client.orders.list({
|
|
|
53
53
|
})
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
## From the command line
|
|
57
|
+
|
|
58
|
+
Every endpoint can also be called with the [Spree CLI](../../developer/cli/admin-api.md) — a generic HTTP client (`get`/`post`/`patch`/`delete`) built into `@spree/cli`. It's the fastest way to explore the API from a terminal or drive it from scripts and AI agents, with zero-config credentials in local development:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
spree api get /orders -q status_eq=complete --limit 25
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Each endpoint page below shows the matching **Spree CLI** command alongside the SDK example. To browse the whole surface offline, use `spree api endpoints` and `spree api schema "<METHOD> <path>"`.
|
|
65
|
+
|
|
56
66
|
Before integrating, read:
|
|
57
67
|
|
|
58
68
|
- [Authentication](authentication.md) — secret API keys, scopes, and JWT tokens
|
|
59
69
|
- [Errors](errors.md) — error format and admin-specific codes
|
|
60
70
|
- [Querying](querying.md) — filtering, sorting, pagination, and `expand`
|
|
71
|
+
- [Spree CLI](../../developer/cli/admin-api.md) — call the Admin API from your terminal
|