@spree/cli 2.3.0 → 2.3.1
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/README.md +3 -3
- package/dist/index.js +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ Call the Admin API directly with generic `get`/`post`/`patch`/`delete` commands.
|
|
|
142
142
|
```bash
|
|
143
143
|
spree api get /products -q status_eq=active --sort -created_at --limit 10
|
|
144
144
|
spree api get /orders/ord_x8k2J9aQ --expand items,payments
|
|
145
|
-
spree api post /products -d '{"name":"Classic Tee"}'
|
|
145
|
+
spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'
|
|
146
146
|
spree api patch /orders/ord_x8k2J9aQ/cancel
|
|
147
147
|
spree api delete /products/prod_86Rf07xd
|
|
148
148
|
|
|
@@ -215,8 +215,8 @@ npm run load-sample-data # spree sample-data
|
|
|
215
215
|
|
|
216
216
|
## Learn More
|
|
217
217
|
|
|
218
|
-
- [Spree Documentation](https://
|
|
219
|
-
- [Store API Reference](https://
|
|
218
|
+
- [Spree Documentation](https://spreecommerce.org/docs)
|
|
219
|
+
- [Store API Reference](https://spreecommerce.org/docs/api-reference/introduction)
|
|
220
220
|
- [create-spree-app](https://www.npmjs.com/package/create-spree-app)
|
|
221
221
|
- [Spree GitHub](https://github.com/spree/spree)
|
|
222
222
|
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,7 @@ the full member list inline (recommended only for single-record
|
|
|
165
165
|
reads \u2014 embed cost scales with membership size).
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
**Required scope:** \`read_customers\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to embed. Supported: `customers`.",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customer group with embedded customers",content:{"application/json":{schema:{$ref:"#/components/schemas/CustomerGroup"}}}},"404":{description:"customer group not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a customer group",tags:["Customer Groups"],security:[{api_key:[],bearer_auth:[]}],description:"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement \u2014 the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customer group updated",content:{"application/json":{schema:{$ref:"#/components/schemas/CustomerGroup"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string",nullable:!0},customer_ids:{type:"array",items:{type:"string"}}}}}}}},delete:{summary:"Delete a customer group",tags:["Customer Groups"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{get:{summary:"List customer addresses",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"addresses found",content:{"application/json":{}}}}},post:{summary:"Create a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default \u2014 the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}}],responses:{"201":{description:"address created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},address2:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string",description:"ISO-2 country code (e.g. US)"},state_abbr:{type:"string",description:"State/province abbreviation (e.g. NY)"},phone:{type:"string"},company:{type:"string"},label:{type:"string"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{patch:{summary:"Update a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"address updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{city:{type:"string"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"}}}}}}},delete:{summary:"Delete a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{get:{summary:"List customer credit cards",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"credit cards found",content:{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{get:{summary:"Show a customer credit card",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"credit card found",content:{"application/json":{}}}}},delete:{summary:"Delete a customer credit card",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{get:{summary:"List customer store credits",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"store credits found",content:{"application/json":{}}}}},post:{summary:"Issue a store credit to a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}}],responses:{"201":{description:"store credit created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["amount","currency","category_id"],properties:{amount:{type:"number"},currency:{type:"string"},category_id:{type:"string",description:"StoreCreditCategory ID"},memo:{type:"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{patch:{summary:"Update a store credit",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"store credit updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{amount:{type:"number"},category_id:{type:"string"},memo:{type:"string"}}}}}}},delete:{summary:"Delete a store credit",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"store credit deleted"}}}},"/api/v3/admin/customers":{get:{summary:"List customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,schema:{type:"integer"}},{name:"limit",in:"query",required:!1,schema:{type:"integer"}},{name:"q[search]",in:"query",required:!1,description:"Email + name full-text-ish search",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customers found",content:{"application/json":{}}}}},post:{summary:"Create a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"customer created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["email"],properties:{email:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},phone:{type:"string"},accepts_email_marketing:{type:"boolean"},internal_note:{type:"string"},tags:{type:"array",items:{type:"string"}},metadata:{type:"object"}}}}}}}},"/api/v3/admin/customers/{id}":{get:{summary:"Show a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Customer ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customer found",content:{"application/json":{}}}}},patch:{summary:"Update a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customer updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},phone:{type:"string"},accepts_email_marketing:{type:"boolean"},internal_note:{type:"string"},tags:{type:"array",items:{type:"string"}},metadata:{type:"object"}}}}}}},delete:{summary:"Delete a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{post:{summary:"Bulk-add customers to groups",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent \u2014 customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customers added to groups",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},customer_group_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","customer_group_ids"],properties:{ids:{type:"array",items:{type:"string"}},customer_group_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{post:{summary:"Bulk-remove customers from groups",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customers removed from groups",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},customer_group_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","customer_group_ids"],properties:{ids:{type:"array",items:{type:"string"}},customer_group_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{post:{summary:"Bulk-add tags to customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags added",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{post:{summary:"Bulk-remove tags from customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags removed",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/exports":{get:{summary:"List exports",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"exports found",content:{"application/json":{}}}}},post:{summary:"Create an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:'Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: "all"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"export queued",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["type"],properties:{type:{type:"string",enum:["Spree::Exports::Products","Spree::Exports::Orders","Spree::Exports::Customers","Spree::Exports::ProductTranslations","Spree::Exports::GiftCards","Spree::Exports::CouponCodes","Spree::Exports::NewsletterSubscribers"]},record_selection:{type:"string",enum:["filtered","all"],description:'Set to "all" to ignore search_params and export everything in scope.'},search_params:{type:"object",description:"Ransack query hash. Same predicates accepted by the list endpoint.",additionalProperties:!0}}}}}}}},"/api/v3/admin/exports/{id}":{get:{summary:"Show an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"export found",content:{"application/json":{}}}}},delete:{summary:"Delete an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{get:{summary:"Download an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL \u2014 a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"CSV file",content:{"application/json":{},"text/csv":{schema:{type:"string",format:"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{get:{summary:"List fulfillments",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"fulfillments found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{get:{summary:"Show a shipment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"shipment found",content:{"application/json":{}}}}},patch:{summary:"Update a shipment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a shipment (tracking, shipping rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"shipment updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{tracking:{type:"string"},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.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment fulfilled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{patch:{summary:"Cancel a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment canceled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{patch:{summary:"Resume a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment resumed",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{patch:{summary:"Split a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment split",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["variant_id","quantity"],properties:{variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer"},stock_location_id:{type:"string",description:"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{get:{summary:"List gift card batches",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n\u2014 the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Records per page",schema:{type:"integer"}},{name:"q[prefix_cont]",in:"query",required:!1,description:"Filter by prefix (contains)",schema:{type:"string"}},{name:"sort",in:"query",required:!1,description:"Sort by field. Prefix with `-` for descending.",schema:{type:"string"}}],responses:{"200":{description:"gift card batches found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/GiftCardBatch"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}}}},post:{summary:"Create a gift card batch",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"gift card batch created",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCardBatch"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["prefix","amount","codes_count"],properties:{prefix:{type:"string",description:"Lowercased and prepended to every generated code."},amount:{type:"string",description:"Decimal amount per card, greater than zero."},currency:{type:"string",description:"ISO 4217 currency code. Defaults to the store currency."},codes_count:{type:"integer",description:"Number of cards to generate. Capped at `gift_card_batch_limit`."},expires_at:{type:"string",nullable:!0}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{parameters:[{name:"id",in:"path",required:!0,description:"Gift card batch prefixed ID",schema:{type:"string"}}],get:{summary:"Get a gift card batch",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"gift card batch found",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCardBatch"}}}},"404":{description:"gift card batch not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{get:{summary:"List gift cards",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Number of records per page",schema:{type:"integer"}},{name:"q[code_cont]",in:"query",required:!1,description:"Filter by gift card code (contains)",schema:{type:"string"}},{name:"q[state_eq]",in:"query",required:!1,description:"Filter by status (active, redeemed, partially_redeemed, canceled)",schema:{type:"string"}},{name:"sort",in:"query",required:!1,description:"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"gift cards found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/GiftCard"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}},"401":{description:"unauthorized",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},post:{summary:"Create a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"gift card created",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCard"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["amount"],properties:{amount:{type:"string",description:"Decimal amount, greater than zero."},currency:{type:"string",description:"ISO 4217 currency code. Defaults to the store currency."},code:{type:"string",description:"Optional caller-supplied code. Auto-generated when omitted."},expires_at:{type:"string",description:"ISO 8601 date.",nullable:!0},user_id:{type:"string",description:"Optional customer prefixed ID.",nullable:!0}}}}}}}},"/api/v3/admin/gift_cards/{id}":{parameters:[{name:"id",in:"path",required:!0,description:"Gift card prefixed ID",schema:{type:"string"}}],get:{summary:"Get a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"gift card found",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCard"}}}},"404":{description:"gift card not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:`Updates an active gift card's editable attributes. Redeemed or
|
|
168
|
+
**Required scope:** \`read_customers\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to embed. Supported: `customers`.",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customer group with embedded customers",content:{"application/json":{schema:{$ref:"#/components/schemas/CustomerGroup"}}}},"404":{description:"customer group not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a customer group",tags:["Customer Groups"],security:[{api_key:[],bearer_auth:[]}],description:"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement \u2014 the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customer group updated",content:{"application/json":{schema:{$ref:"#/components/schemas/CustomerGroup"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string",nullable:!0},customer_ids:{type:"array",items:{type:"string"}}}}}}}},delete:{summary:"Delete a customer group",tags:["Customer Groups"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{get:{summary:"List customer addresses",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"addresses found",content:{"application/json":{}}}}},post:{summary:"Create a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default \u2014 the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}}],responses:{"201":{description:"address created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},address2:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string",description:"ISO-2 country code (e.g. US)"},state_abbr:{type:"string",description:"State/province abbreviation (e.g. NY)"},phone:{type:"string"},company:{type:"string"},label:{type:"string"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{patch:{summary:"Update a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"address updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{city:{type:"string"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"}}}}}}},delete:{summary:"Delete a customer address",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{get:{summary:"List customer credit cards",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"credit cards found",content:{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{get:{summary:"Show a customer credit card",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"credit card found",content:{"application/json":{}}}}},delete:{summary:"Delete a customer credit card",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{get:{summary:"List customer store credits",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"store credits found",content:{"application/json":{}}}}},post:{summary:"Issue a store credit to a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}}],responses:{"201":{description:"store credit created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["amount","currency","category_id"],properties:{amount:{type:"string"},currency:{type:"string"},category_id:{type:"string",description:"StoreCreditCategory ID"},memo:{type:"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{patch:{summary:"Update a store credit",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"store credit updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{amount:{type:"string"},category_id:{type:"string"},memo:{type:"string"}}}}}}},delete:{summary:"Delete a store credit",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"customer_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"store credit deleted"}}}},"/api/v3/admin/customers":{get:{summary:"List customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,schema:{type:"integer"}},{name:"limit",in:"query",required:!1,schema:{type:"integer"}},{name:"q[search]",in:"query",required:!1,description:"Email + name full-text-ish search",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customers found",content:{"application/json":{}}}}},post:{summary:"Create a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"customer created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["email"],properties:{email:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},phone:{type:"string"},accepts_email_marketing:{type:"boolean"},internal_note:{type:"string"},tags:{type:"array",items:{type:"string"}},metadata:{type:"object"}}}}}}}},"/api/v3/admin/customers/{id}":{get:{summary:"Show a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Customer ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"customer found",content:{"application/json":{}}}}},patch:{summary:"Update a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customer updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},first_name:{type:"string"},last_name:{type:"string"},phone:{type:"string"},accepts_email_marketing:{type:"boolean"},internal_note:{type:"string"},tags:{type:"array",items:{type:"string"}},metadata:{type:"object"}}}}}}},delete:{summary:"Delete a customer",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{post:{summary:"Bulk-add customers to groups",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent \u2014 customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customers added to groups",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},customer_group_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","customer_group_ids"],properties:{ids:{type:"array",items:{type:"string"}},customer_group_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{post:{summary:"Bulk-remove customers from groups",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"customers removed from groups",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},customer_group_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","customer_group_ids"],properties:{ids:{type:"array",items:{type:"string"}},customer_group_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{post:{summary:"Bulk-add tags to customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags added",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{post:{summary:"Bulk-remove tags from customers",tags:["Customers"],security:[{api_key:[],bearer_auth:[]}],description:"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags removed",content:{"application/json":{schema:{type:"object",properties:{customer_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/exports":{get:{summary:"List exports",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"exports found",content:{"application/json":{}}}}},post:{summary:"Create an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:'Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: "all"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"export queued",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["type"],properties:{type:{type:"string",enum:["Spree::Exports::Products","Spree::Exports::Orders","Spree::Exports::Customers","Spree::Exports::ProductTranslations","Spree::Exports::GiftCards","Spree::Exports::CouponCodes","Spree::Exports::NewsletterSubscribers"]},record_selection:{type:"string",enum:["filtered","all"],description:'Set to "all" to ignore search_params and export everything in scope.'},search_params:{type:"object",description:"Ransack query hash. Same predicates accepted by the list endpoint.",additionalProperties:!0}}}}}}}},"/api/v3/admin/exports/{id}":{get:{summary:"Show an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"export found",content:{"application/json":{}}}}},delete:{summary:"Delete an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{get:{summary:"Download an export",tags:["Exports"],security:[{api_key:[],bearer_auth:[]}],description:"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL \u2014 a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource \u2014 `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"CSV file",content:{"application/json":{},"text/csv":{schema:{type:"string",format:"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{get:{summary:"List fulfillments",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"fulfillments found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{get:{summary:"Show a shipment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"shipment found",content:{"application/json":{}}}}},patch:{summary:"Update a shipment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a shipment (tracking, shipping rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"shipment updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{tracking:{type:"string"},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.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment fulfilled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{patch:{summary:"Cancel a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment canceled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{patch:{summary:"Resume a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment resumed",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{patch:{summary:"Split a fulfillment",tags:["Fulfillments"],security:[{api_key:[],bearer_auth:[]}],description:"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Fulfillment ID",schema:{type:"string"}}],responses:{"200":{description:"fulfillment split",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["variant_id","quantity"],properties:{variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer"},stock_location_id:{type:"string",description:"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{get:{summary:"List gift card batches",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n\u2014 the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Records per page",schema:{type:"integer"}},{name:"q[prefix_cont]",in:"query",required:!1,description:"Filter by prefix (contains)",schema:{type:"string"}},{name:"sort",in:"query",required:!1,description:"Sort by field. Prefix with `-` for descending.",schema:{type:"string"}}],responses:{"200":{description:"gift card batches found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/GiftCardBatch"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}}}},post:{summary:"Create a gift card batch",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"gift card batch created",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCardBatch"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["prefix","amount","codes_count"],properties:{prefix:{type:"string",description:"Lowercased and prepended to every generated code."},amount:{type:"string",description:"Decimal amount per card, greater than zero."},currency:{type:"string",description:"ISO 4217 currency code. Defaults to the store currency."},codes_count:{type:"integer",description:"Number of cards to generate. Capped at `gift_card_batch_limit`."},expires_at:{type:"string",nullable:!0}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{parameters:[{name:"id",in:"path",required:!0,description:"Gift card batch prefixed ID",schema:{type:"string"}}],get:{summary:"Get a gift card batch",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"gift card batch found",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCardBatch"}}}},"404":{description:"gift card batch not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{get:{summary:"List gift cards",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Number of records per page",schema:{type:"integer"}},{name:"q[code_cont]",in:"query",required:!1,description:"Filter by gift card code (contains)",schema:{type:"string"}},{name:"q[state_eq]",in:"query",required:!1,description:"Filter by status (active, redeemed, partially_redeemed, canceled)",schema:{type:"string"}},{name:"sort",in:"query",required:!1,description:"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"gift cards found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/GiftCard"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}},"401":{description:"unauthorized",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},post:{summary:"Create a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"gift card created",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCard"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["amount"],properties:{amount:{type:"string",description:"Decimal amount, greater than zero."},currency:{type:"string",description:"ISO 4217 currency code. Defaults to the store currency."},code:{type:"string",description:"Optional caller-supplied code. Auto-generated when omitted."},expires_at:{type:"string",description:"ISO 8601 date.",nullable:!0},user_id:{type:"string",description:"Optional customer prefixed ID.",nullable:!0}}}}}}}},"/api/v3/admin/gift_cards/{id}":{parameters:[{name:"id",in:"path",required:!0,description:"Gift card prefixed ID",schema:{type:"string"}}],get:{summary:"Get a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include. id is always included.",schema:{type:"string"}}],responses:{"200":{description:"gift card found",content:{"application/json":{schema:{$ref:"#/components/schemas/GiftCard"}}}},"404":{description:"gift card not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a gift card",tags:["Gift Cards"],security:[{api_key:[],bearer_auth:[]}],description:`Updates an active gift card's editable attributes. Redeemed or
|
|
169
169
|
partially-redeemed cards cannot be edited.
|
|
170
170
|
|
|
171
171
|
|
|
@@ -178,7 +178,7 @@ partially redeemed cannot be deleted and return 422.
|
|
|
178
178
|
Option values can be provided inline and will be created or updated by name.
|
|
179
179
|
|
|
180
180
|
|
|
181
|
-
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"option type created",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"},filterable:{type:"boolean"},option_values:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"}}}}},required:["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{get:{summary:"Get an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., name,label,position). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"option type found",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"404":{description:"option type not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}}],responses:{"200":{description:"option type updated",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"},filterable:{type:"boolean"},option_values:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Existing option value ID to update"},name:{type:"string"},label:{type:"string"},position:{type:"integer"}}}}}}}}}},delete:{summary:"Delete an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}}],responses:{"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:"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"gift card applied",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["code"],properties:{code:{type:"string",description:"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{delete:{summary:"Remove a gift card from an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Gift card ID",schema:{type:"string"}}],responses:{"204":{description:"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{get:{summary:"List order items",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"items found",content:{"application/json":{}}}}},post:{summary:"Add an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"item added",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["variant_id"],properties:{variant_id:{type:"string",description:"Prefixed variant ID"},quantity:{type:"integer",default:1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{get:{summary:"Show an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"item found",content:{"application/json":{}}}}},patch:{summary:"Update an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}}],responses:{"200":{description:"item updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{quantity:{type:"integer"}}}}}}},delete:{summary:"Remove an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}}],responses:{"204":{description:"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{post:{summary:"Apply customer's store credit to an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"store credit applied",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{amount:{type:"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:"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"204":{description:"store credit removed"}}}},"/api/v3/admin/orders":{get:{summary:"List orders",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Number of records per page",schema:{type:"integer"}},{name:"sort",in:"query",required:!1,description:"Sort field (e.g., created_at, -created_at, completed_at)",schema:{type:"string"}},{name:"q[state_eq]",in:"query",required:!1,description:"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)",schema:{type:"string"}},{name:"q[email_cont]",in:"query",required:!1,description:"Filter by email (contains)",schema:{type:"string"}},{name:"q[number_eq]",in:"query",required:!1,description:"Filter by order number",schema:{type:"string"}},{name:"q[completed_at_gt]",in:"query",required:!1,description:"Filter by completed after date",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"orders found",content:{"application/json":{}}},"401":{description:"unauthorized",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},post:{summary:"Create a draft order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:`Creates a new draft order in one shot. Customer, items, addresses, currency,
|
|
181
|
+
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"option type created",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"},filterable:{type:"boolean"},option_values:{type:"array",items:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"}}}}},required:["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{get:{summary:"Get an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., name,label,position). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"option type found",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"404":{description:"option type not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}}],responses:{"200":{description:"option type updated",content:{"application/json":{schema:{$ref:"#/components/schemas/OptionType"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},label:{type:"string"},position:{type:"integer"},filterable:{type:"boolean"},option_values:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"Existing option value ID to update"},name:{type:"string"},label:{type:"string"},position:{type:"integer"}}}}}}}}}},delete:{summary:"Delete an option type",tags:["Option Types"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Option type ID",schema:{type:"string"}}],responses:{"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:"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"gift card applied",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["code"],properties:{code:{type:"string",description:"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{delete:{summary:"Remove a gift card from an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Gift card ID",schema:{type:"string"}}],responses:{"204":{description:"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{get:{summary:"List order items",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"items found",content:{"application/json":{}}}}},post:{summary:"Add an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"item added",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["variant_id"],properties:{variant_id:{type:"string",description:"Prefixed variant ID"},quantity:{type:"integer",default:1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{get:{summary:"Show an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"item found",content:{"application/json":{}}}}},patch:{summary:"Update an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}}],responses:{"200":{description:"item updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{quantity:{type:"integer"}}}}}}},delete:{summary:"Remove an item",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Item ID",schema:{type:"string"}}],responses:{"204":{description:"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{post:{summary:"Apply customer's store credit to an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"store credit applied",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{amount:{type:"string",description:"Optional explicit amount; defaults to order outstanding balance"}}}}}}},delete:{summary:"Remove store credit from an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"204":{description:"store credit removed"}}}},"/api/v3/admin/orders":{get:{summary:"List orders",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"page",in:"query",required:!1,description:"Page number",schema:{type:"integer"}},{name:"limit",in:"query",required:!1,description:"Number of records per page",schema:{type:"integer"}},{name:"sort",in:"query",required:!1,description:"Sort field (e.g., created_at, -created_at, completed_at)",schema:{type:"string"}},{name:"q[state_eq]",in:"query",required:!1,description:"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)",schema:{type:"string"}},{name:"q[email_cont]",in:"query",required:!1,description:"Filter by email (contains)",schema:{type:"string"}},{name:"q[number_eq]",in:"query",required:!1,description:"Filter by order number",schema:{type:"string"}},{name:"q[completed_at_gt]",in:"query",required:!1,description:"Filter by completed after date",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"orders found",content:{"application/json":{}}},"401":{description:"unauthorized",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},post:{summary:"Create a draft order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:`Creates a new draft order in one shot. Customer, items, addresses, currency,
|
|
182
182
|
market, channel, locale, notes, metadata, and a coupon code can all be
|
|
183
183
|
provided inline.
|
|
184
184
|
|
|
@@ -190,7 +190,7 @@ Invalid coupon codes are non-fatal \u2014 the order is created and the failure
|
|
|
190
190
|
is reported on the service result (not in the API response body for now).
|
|
191
191
|
|
|
192
192
|
|
|
193
|
-
**Required scope:** \`write_orders\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"order created with preferred_stock_location_id",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},customer_id:{type:"string",description:"Customer ID. Alias: user_id (legacy)."},use_customer_default_address:{type:"boolean",description:"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},currency:{type:"string"},market_id:{type:"string",description:"Market ID"},channel_id:{type:"string",description:"Channel ID. Defaults to the store primary channel when omitted."},preferred_stock_location_id:{type:"string",description:"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},locale:{type:"string"},customer_note:{type:"string",description:"Public, customer-visible note"},internal_note:{type:"string",description:"Staff-only note"},metadata:{type:"object",description:"Arbitrary key/value metadata"},shipping_address:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string"},state_abbr:{type:"string"},phone:{type:"string"}}},shipping_address_id:{type:"string",description:"Existing customer address ID"},billing_address:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string"},state_abbr:{type:"string"},phone:{type:"string"}}},billing_address_id:{type:"string",description:"Existing customer address ID"},items:{type:"array",items:{type:"object",required:["variant_id","quantity"],properties:{variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer"},metadata:{type:"object"}}}},coupon_code:{type:"string",description:"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{get:{summary:"Show an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID (e.g., or_xxx)",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"order found",content:{"application/json":{}}},"404":{description:"order not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},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"},metadata:{type:"object"}}}}}}}}}},delete:{summary:"Delete a draft order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"204":{description:"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{patch:{summary:"Complete an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order completed",content:{"application/json":{}}},"422":{description:"order cannot be completed",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{notify_customer:{type:"boolean",description:"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{patch:{summary:"Cancel an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Cancels a completed order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order canceled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/approve":{patch:{summary:"Approve an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order approved",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{patch:{summary:"Resume a canceled order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order resumed",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{post:{summary:"Resend confirmation email",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"confirmation resent",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{get:{summary:"List payment methods",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., name,type,active). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment methods found",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{get:{summary:"List available payment provider types",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:'Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a "Provider" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"provider types found",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{get:{summary:"Show a payment method",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., name,type,active). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment method found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{get:{summary:"List payments",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payments found",content:{"application/json":{}}}}},post:{summary:"Create a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"payment created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["payment_method_id"],properties:{payment_method_id:{type:"string",description:"Payment method ID"},amount:{type:"number"},source_id:{type:"string",description:"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{get:{summary:"Show a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{patch:{summary:"Capture a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}}],responses:{"200":{description:"payment captured",content:{"application/json":{}}},"422":{description:"capture failed",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{patch:{summary:"Void a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}}],responses:{"200":{description:"payment voided",content:{"application/json":{}}}}}},"/api/v3/admin/price_lists":{get:{summary:"List price lists",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"page",in:"query",required:!1,schema:{type:"integer"}},{name:"limit",in:"query",required:!1,schema:{type:"integer"}},{name:"q[name_cont]",in:"query",required:!1,schema:{type:"string"}},{name:"q[status_eq]",in:"query",required:!1,schema:{type:"string"}},{name:"sort",in:"query",required:!1,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to embed. Supported: `price_rules`.",schema:{type:"string"}}],responses:{"200":{description:"price lists found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/PriceList"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}}}},post:{summary:"Create a price list",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"price list created (server-to-server \u2014 rules + prices, no product_ids)",content:{"application/json":{schema:{$ref:"#/components/schemas/PriceList"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},match_policy:{type:"string",enum:["all","any"]},position:{type:"integer"},product_ids:{type:"array",items:{type:"string"},description:"Prefixed product ids to seed the list with."},rules:{type:"array",description:"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.",items:{type:"object",required:["type"],properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},prices:{type:"array",description:"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary \u2014 `prices` alone tells the server which variants belong to the list and what the override amount is.",items:{type:"object",required:["variant_id","currency"],properties:{variant_id:{type:"string"},currency:{type:"string"},amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{parameters:[{name:"id",in:"path",required:!0,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:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,schema:{type:"string"}}],responses:{"200":{description:"price list found",content:{"application/json":{schema:{$ref:"#/components/schemas/PriceList"}}}},"404":{description:"price list not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a price list",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:`Updates a price list. The optional \`rules:\` array reconciles nested
|
|
193
|
+
**Required scope:** \`write_orders\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"order created with preferred_stock_location_id",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},customer_id:{type:"string",description:"Customer ID. Alias: user_id (legacy)."},use_customer_default_address:{type:"boolean",description:"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},currency:{type:"string"},market_id:{type:"string",description:"Market ID"},channel_id:{type:"string",description:"Channel ID. Defaults to the store primary channel when omitted."},preferred_stock_location_id:{type:"string",description:"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},locale:{type:"string"},customer_note:{type:"string",description:"Public, customer-visible note"},internal_note:{type:"string",description:"Staff-only note"},metadata:{type:"object",description:"Arbitrary key/value metadata"},shipping_address:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string"},state_abbr:{type:"string"},phone:{type:"string"}}},shipping_address_id:{type:"string",description:"Existing customer address ID"},billing_address:{type:"object",properties:{first_name:{type:"string"},last_name:{type:"string"},address1:{type:"string"},city:{type:"string"},postal_code:{type:"string"},country_iso:{type:"string"},state_abbr:{type:"string"},phone:{type:"string"}}},billing_address_id:{type:"string",description:"Existing customer address ID"},items:{type:"array",items:{type:"object",required:["variant_id","quantity"],properties:{variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer"},metadata:{type:"object"}}}},coupon_code:{type:"string",description:"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{get:{summary:"Show an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID (e.g., or_xxx)",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"order found",content:{"application/json":{}}},"404":{description:"order not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{email:{type:"string"},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"},metadata:{type:"object"}}}}}}}}}},delete:{summary:"Delete a draft order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"204":{description:"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{patch:{summary:"Complete an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order completed",content:{"application/json":{}}},"422":{description:"order cannot be completed",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{notify_customer:{type:"boolean",description:"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{patch:{summary:"Cancel an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Cancels a completed order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order canceled",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/approve":{patch:{summary:"Approve an order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order approved",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{patch:{summary:"Resume a canceled order",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"order resumed",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{post:{summary:"Resend confirmation email",tags:["Orders"],security:[{api_key:[],bearer_auth:[]}],description:"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"200":{description:"confirmation resent",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{get:{summary:"List payment methods",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., name,type,active). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment methods found",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{get:{summary:"List available payment provider types",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:'Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a "Provider" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"provider types found",content:{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{get:{summary:"Show a payment method",tags:["Payment Methods"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., name,type,active). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment method found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{get:{summary:"List payments",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payments found",content:{"application/json":{}}}}},post:{summary:"Create a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"payment created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["payment_method_id"],properties:{payment_method_id:{type:"string",description:"Payment method ID"},amount:{type:"string"},source_id:{type:"string",description:"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{get:{summary:"Show a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"payment found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{patch:{summary:"Capture a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}}],responses:{"200":{description:"payment captured",content:{"application/json":{}}},"422":{description:"capture failed",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{patch:{summary:"Void a payment",tags:["Payments"],security:[{api_key:[],bearer_auth:[]}],description:"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Payment ID",schema:{type:"string"}}],responses:{"200":{description:"payment voided",content:{"application/json":{}}}}}},"/api/v3/admin/price_lists":{get:{summary:"List price lists",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"page",in:"query",required:!1,schema:{type:"integer"}},{name:"limit",in:"query",required:!1,schema:{type:"integer"}},{name:"q[name_cont]",in:"query",required:!1,schema:{type:"string"}},{name:"q[status_eq]",in:"query",required:!1,schema:{type:"string"}},{name:"sort",in:"query",required:!1,schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to embed. Supported: `price_rules`.",schema:{type:"string"}}],responses:{"200":{description:"price lists found",content:{"application/json":{schema:{type:"object",properties:{data:{type:"array",items:{$ref:"#/components/schemas/PriceList"}},meta:{$ref:"#/components/schemas/PaginationMeta"}},required:["data","meta"]}}}}}},post:{summary:"Create a price list",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"price list created (server-to-server \u2014 rules + prices, no product_ids)",content:{"application/json":{schema:{$ref:"#/components/schemas/PriceList"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},match_policy:{type:"string",enum:["all","any"]},position:{type:"integer"},product_ids:{type:"array",items:{type:"string"},description:"Prefixed product ids to seed the list with."},rules:{type:"array",description:"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.",items:{type:"object",required:["type"],properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},prices:{type:"array",description:"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary \u2014 `prices` alone tells the server which variants belong to the list and what the override amount is.",items:{type:"object",required:["variant_id","currency"],properties:{variant_id:{type:"string"},currency:{type:"string"},amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{parameters:[{name:"id",in:"path",required:!0,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:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"expand",in:"query",required:!1,schema:{type:"string"}}],responses:{"200":{description:"price list found",content:{"application/json":{schema:{$ref:"#/components/schemas/PriceList"}}}},"404":{description:"price list not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a price list",tags:["Pricing"],security:[{api_key:[],bearer_auth:[]}],description:`Updates a price list. The optional \`rules:\` array reconciles nested
|
|
194
194
|
STI-typed price rules in a single round-trip \u2014 existing rules update
|
|
195
195
|
by \`id\`, new rules build, missing rules destroy. Mirrors the
|
|
196
196
|
promotion editor's "save the whole thing on Save" pattern.
|
|
@@ -214,7 +214,7 @@ Option types and values are auto-created if they don't exist.
|
|
|
214
214
|
Prices are upserted by currency. Stock items are upserted by stock location.
|
|
215
215
|
|
|
216
216
|
|
|
217
|
-
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"product created",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string"},slug:{type:"string"},status:{type:"string",enum:["draft","active","archived"]},tax_category_id:{type:"string",description:"Tax category ID"},category_ids:{type:"array",items:{type:"string"},description:"Array of category IDs"},tags:{type:"array",items:{type:"string"}},variants:{type:"array",description:"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).",items:{type:"object",properties:{sku:{type:"string"},options:{type:"array",description:"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.",items:{type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"}}}},prices:{type:"array",description:"Per-currency prices. Upserted by currency.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"number"},compare_at_amount:{type:"number"}}}},stock_items:{type:"array",description:"Per-stock-location inventory. Upserted by stock_location_id.",items:{type:"object",required:["stock_location_id","count_on_hand"],properties:{stock_location_id:{type:"string",description:"Stock location ID (e.g. sloc_xxx)"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}},required:["name"]}}}}}},"/api/v3/admin/products/{id}":{get:{summary:"Get a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID (e.g., prod_xxx)",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"product found",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"404":{description:"product not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"200":{description:"product updated",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string"},slug:{type:"string"},status:{type:"string",enum:["draft","active","archived"]},tax_category_id:{type:"string",description:"Tax category ID"},category_ids:{type:"array",items:{type:"string"},description:"Array of category IDs"},tags:{type:"array",items:{type:"string"}},variants:{type:"array",description:"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).",items:{type:"object",properties:{sku:{type:"string"},options:{type:"array",description:"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.",items:{type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"}}}},prices:{type:"array",description:"Per-currency prices. Upserted by currency.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"number"},compare_at_amount:{type:"number"}}}},stock_items:{type:"array",description:"Per-stock-location inventory. Upserted by stock_location_id.",items:{type:"object",required:["stock_location_id","count_on_hand"],properties:{stock_location_id:{type:"string",description:"Stock location ID (e.g. sloc_xxx)"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}}}}}}},delete:{summary:"Delete a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"204":{description:"product deleted"}}}},"/api/v3/admin/products/bulk_status_update":{post:{summary:"Bulk-update product status",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"cross-store products silently dropped",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},status:{type:"string"}}}}}},"422":{description:"invalid status",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","status"],properties:{ids:{type:"array",items:{type:"string"}},status:{type:"string",enum:["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{post:{summary:"Bulk-add products to categories",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Attaches each product in `ids` to every category (taxon) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products added to categories",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},category_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","category_ids"],properties:{ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{post:{summary:"Bulk-remove products from categories",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products removed from categories",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","category_ids"],properties:{ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{post:{summary:"Bulk-add products to channels",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent \u2014\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products published on channels",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},channel_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","channel_ids"],properties:{ids:{type:"array",items:{type:"string"}},channel_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{post:{summary:"Bulk-remove products from channels",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products unpublished from channels",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},channel_count:{type:"integer"},removed:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","channel_ids"],properties:{ids:{type:"array",items:{type:"string"}},channel_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{post:{summary:"Bulk-add tags to products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags added",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{post:{summary:"Bulk-remove tags from products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags removed",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{delete:{summary:"Bulk-delete products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products deleted",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids"],properties:{ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List coupon codes for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"coupon codes found",content:{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List actions for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"actions found",content:{"application/json":{}}}}},post:{summary:"Create an action on a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"action created",content:{"application/json":{}}},"422":{description:"unknown action type",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}},required:["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],delete:{summary:"Delete an action from a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List rules for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rules found",content:{"application/json":{}}}}},post:{summary:"Create a rule on a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"rule created with preferences",content:{"application/json":{}}},"422":{description:"unknown rule type",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}},required:["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],patch:{summary:"Update a rule's preferences",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rule updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{preferences:{type:"object",additionalProperties:!0}}}}}}},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:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"rule deleted"}}}},"/api/v3/admin/promotions":{get:{summary:"List promotions",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"promotions found",content:{"application/json":{}}}}},post:{summary:"Create a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new promotion. `code` is required for single-code coupon promotions;\npass `multi_codes: true` with `number_of_codes` to auto-generate a batch.\n\nRules and actions can be created in the same request by passing arrays of\n`{ type, preferences, ... }` rows. The server reconciles to the desired set:\nnew rows are built, existing rows (by `id`) are updated, omitted rows are removed.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"promotion created with rules and actions",content:{"application/json":{}}},"422":{description:"invalid params",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},starts_at:{type:"string",format:"date-time",nullable:!0},expires_at:{type:"string",format:"date-time",nullable:!0},usage_limit:{type:"integer",nullable:!0},match_policy:{type:"string",enum:["all","any"]},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"integer",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},rules:{type:"array",items:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0},product_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},customer_ids:{type:"array",items:{type:"string"}}},required:["type"]}},actions:{type:"array",items:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0},calculator:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},required:["type"]}}},required:["name"]}}}}}},"/api/v3/admin/promotions/{id}":{get:{summary:"Show a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"promotion found",content:{"application/json":{}}}}},patch:{summary:"Update a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a promotion. The `rules` and `actions` arrays are treated as\na *desired set* \u2014 rows with `id` update in place, rows without `id` are\nbuilt fresh, and any existing row not present in the array is destroyed.\nPass `rules: []` or `actions: []` to clear them.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rules and actions cleared with empty arrays",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",format:"date-time",nullable:!0},expires_at:{type:"string",format:"date-time",nullable:!0},usage_limit:{type:"integer",nullable:!0},match_policy:{type:"string",enum:["all","any"]},kind:{type:"string",enum:["coupon_code","automatic"]},promotion_category_id:{type:"string",nullable:!0},rules:{type:"array",items:{type:"object",properties:{id:{type:"string",nullable:!0,description:"Pass to update an existing rule; omit to build a new one"},type:{type:"string"},preferences:{type:"object",additionalProperties:!0},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:!0},type:{type:"string"},preferences:{type:"object",additionalProperties:!0},calculator:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},required:["type"]}}}}}}}},delete:{summary:"Delete a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{get:{summary:"List available promotion action types",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:'Returns the registered Spree::PromotionAction subclasses with their preference schemas. Used by admin UIs to populate the "Add action" picker and render generic preference forms.\n\n**Required scope:** `read_promotions` (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"action types found",content:{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{get:{summary:"List available promotion rule types",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rule types found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{get:{summary:"List refunds",tags:["Refunds"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"refunds found",content:{"application/json":{}}}}},post:{summary:"Create a refund",tags:["Refunds"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"refund created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["payment_id","amount"],properties:{payment_id:{type:"string",description:"Payment ID"},amount:{type:"number"},refund_reason_id:{type:"string",description:"Refund reason ID"}}}}}}}},"/api/v3/admin/store_credit_categories":{get:{summary:"List store credit categories",tags:["Settings"],security:[{api_key:[],bearer_auth:[]}],description:`Returns the configured store credit categories. Categories classify
|
|
217
|
+
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"201":{description:"product created",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string"},slug:{type:"string"},status:{type:"string",enum:["draft","active","archived"]},tax_category_id:{type:"string",description:"Tax category ID"},category_ids:{type:"array",items:{type:"string"},description:"Array of category IDs"},tags:{type:"array",items:{type:"string"}},prices:{type:"array",description:"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}}}},variants:{type:"array",description:"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).",items:{type:"object",properties:{sku:{type:"string"},options:{type:"array",description:"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.",items:{type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"}}}},prices:{type:"array",description:"Per-currency prices. Upserted by currency.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}}}},stock_items:{type:"array",description:"Per-stock-location inventory. Upserted by stock_location_id.",items:{type:"object",required:["stock_location_id","count_on_hand"],properties:{stock_location_id:{type:"string",description:"Stock location ID (e.g. sloc_xxx)"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}},required:["name"]}}}}}},"/api/v3/admin/products/{id}":{get:{summary:"Get a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID (e.g., prod_xxx)",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"product found",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"404":{description:"product not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"200":{description:"product updated",content:{"application/json":{schema:{$ref:"#/components/schemas/Product"}}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string"},slug:{type:"string"},status:{type:"string",enum:["draft","active","archived"]},tax_category_id:{type:"string",description:"Tax category ID"},category_ids:{type:"array",items:{type:"string"},description:"Array of category IDs"},tags:{type:"array",items:{type:"string"}},prices:{type:"array",description:"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}}}},variants:{type:"array",description:"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).",items:{type:"object",properties:{sku:{type:"string"},options:{type:"array",description:"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.",items:{type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"}}}},prices:{type:"array",description:"Per-currency prices. Upserted by currency.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}}}},stock_items:{type:"array",description:"Per-stock-location inventory. Upserted by stock_location_id.",items:{type:"object",required:["stock_location_id","count_on_hand"],properties:{stock_location_id:{type:"string",description:"Stock location ID (e.g. sloc_xxx)"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}}}}}}},delete:{summary:"Delete a product",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"204":{description:"product deleted"}}}},"/api/v3/admin/products/bulk_status_update":{post:{summary:"Bulk-update product status",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"cross-store products silently dropped",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},status:{type:"string"}}}}}},"422":{description:"invalid status",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","status"],properties:{ids:{type:"array",items:{type:"string"}},status:{type:"string",enum:["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{post:{summary:"Bulk-add products to categories",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Attaches each product in `ids` to every category (taxon) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products added to categories",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},category_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","category_ids"],properties:{ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{post:{summary:"Bulk-remove products from categories",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products removed from categories",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","category_ids"],properties:{ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{post:{summary:"Bulk-add products to channels",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent \u2014\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products published on channels",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},channel_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","channel_ids"],properties:{ids:{type:"array",items:{type:"string"}},channel_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{post:{summary:"Bulk-remove products from channels",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products unpublished from channels",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},channel_count:{type:"integer"},removed:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","channel_ids"],properties:{ids:{type:"array",items:{type:"string"}},channel_ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{post:{summary:"Bulk-add tags to products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags added",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"},tag_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{post:{summary:"Bulk-remove tags from products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"tags removed",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids","tags"],properties:{ids:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{delete:{summary:"Bulk-delete products",tags:["Products"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"products deleted",content:{"application/json":{schema:{type:"object",properties:{product_count:{type:"integer"}}}}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["ids"],properties:{ids:{type:"array",items:{type:"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List coupon codes for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"coupon codes found",content:{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List actions for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"actions found",content:{"application/json":{}}}}},post:{summary:"Create an action on a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"action created",content:{"application/json":{}}},"422":{description:"unknown action type",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}},required:["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],delete:{summary:"Delete an action from a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}}],get:{summary:"List rules for a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rules found",content:{"application/json":{}}}}},post:{summary:"Create a rule on a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"rule created with preferences",content:{"application/json":{}}},"422":{description:"unknown rule type",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}},required:["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{parameters:[{name:"promotion_id",in:"path",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],patch:{summary:"Update a rule's preferences",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rule updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{preferences:{type:"object",additionalProperties:!0}}}}}}},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:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"204":{description:"rule deleted"}}}},"/api/v3/admin/promotions":{get:{summary:"List promotions",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"promotions found",content:{"application/json":{}}}}},post:{summary:"Create a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a new promotion. `code` is required for single-code coupon promotions;\npass `multi_codes: true` with `number_of_codes` to auto-generate a batch.\n\nRules and actions can be created in the same request by passing arrays of\n`{ type, preferences, ... }` rows. The server reconciles to the desired set:\nnew rows are built, existing rows (by `id`) are updated, omitted rows are removed.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"201":{description:"promotion created with rules and actions",content:{"application/json":{}}},"422":{description:"invalid params",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},starts_at:{type:"string",format:"date-time",nullable:!0},expires_at:{type:"string",format:"date-time",nullable:!0},usage_limit:{type:"integer",nullable:!0},match_policy:{type:"string",enum:["all","any"]},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"integer",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},rules:{type:"array",items:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0},product_ids:{type:"array",items:{type:"string"}},category_ids:{type:"array",items:{type:"string"}},customer_ids:{type:"array",items:{type:"string"}}},required:["type"]}},actions:{type:"array",items:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0},calculator:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},required:["type"]}}},required:["name"]}}}}}},"/api/v3/admin/promotions/{id}":{get:{summary:"Show a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"promotion found",content:{"application/json":{}}}}},patch:{summary:"Update a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a promotion. The `rules` and `actions` arrays are treated as\na *desired set* \u2014 rows with `id` update in place, rows without `id` are\nbuilt fresh, and any existing row not present in the array is destroyed.\nPass `rules: []` or `actions: []` to clear them.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rules and actions cleared with empty arrays",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",format:"date-time",nullable:!0},expires_at:{type:"string",format:"date-time",nullable:!0},usage_limit:{type:"integer",nullable:!0},match_policy:{type:"string",enum:["all","any"]},kind:{type:"string",enum:["coupon_code","automatic"]},promotion_category_id:{type:"string",nullable:!0},rules:{type:"array",items:{type:"object",properties:{id:{type:"string",nullable:!0,description:"Pass to update an existing rule; omit to build a new one"},type:{type:"string"},preferences:{type:"object",additionalProperties:!0},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:!0},type:{type:"string"},preferences:{type:"object",additionalProperties:!0},calculator:{type:"object",properties:{type:{type:"string"},preferences:{type:"object",additionalProperties:!0}}}},required:["type"]}}}}}}}},delete:{summary:"Delete a promotion",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"**Required scope:** `write_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}},{name:"id",in:"path",required:!0,schema:{type:"string"}}],responses:{"204":{description:"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{get:{summary:"List available promotion action types",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:'Returns the registered Spree::PromotionAction subclasses with their preference schemas. Used by admin UIs to populate the "Add action" picker and render generic preference forms.\n\n**Required scope:** `read_promotions` (for API-key authentication).',parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"action types found",content:{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{get:{summary:"List available promotion rule types",tags:["Promotions"],security:[{api_key:[],bearer_auth:[]}],description:"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,schema:{type:"string"}}],responses:{"200":{description:"rule types found",content:{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{get:{summary:"List refunds",tags:["Refunds"],security:[{api_key:[],bearer_auth:[]}],description:"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,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:!1,description:"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"refunds found",content:{"application/json":{}}}}},post:{summary:"Create a refund",tags:["Refunds"],security:[{api_key:[],bearer_auth:[]}],description:"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"order_id",in:"path",required:!0,description:"Order ID",schema:{type:"string"}}],responses:{"201":{description:"refund created",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",required:["payment_id","amount"],properties:{payment_id:{type:"string",description:"Payment ID"},amount:{type:"string"},refund_reason_id:{type:"string",description:"Refund reason ID"}}}}}}}},"/api/v3/admin/store_credit_categories":{get:{summary:"List store credit categories",tags:["Settings"],security:[{api_key:[],bearer_auth:[]}],description:`Returns the configured store credit categories. Categories classify
|
|
218
218
|
store credits (e.g., "Goodwill", "Gift Card", "Refund") and surface
|
|
219
219
|
in the admin UI as a dropdown when issuing or editing a store
|
|
220
220
|
credit. Category names matching \`Spree::Config[:non_expiring_credit_types]\`
|
|
@@ -239,7 +239,7 @@ Option types and values are auto-created if they don't exist.
|
|
|
239
239
|
Prices are upserted by currency. Stock items are upserted by stock location.
|
|
240
240
|
|
|
241
241
|
|
|
242
|
-
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"product_id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"201":{description:"variant created",content:{"application/json":{}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{sku:{type:"string"},price:{type:"
|
|
242
|
+
**Required scope:** \`write_products\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"product_id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}}],responses:{"201":{description:"variant created",content:{"application/json":{}}},"422":{description:"validation error",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{sku:{type:"string"},price:{type:"string"},compare_at_price:{type:"string"},cost_price:{type:"string"},cost_currency:{type:"string"},weight:{type:"number"},height:{type:"number"},width:{type:"number"},depth:{type:"number"},weight_unit:{type:"string"},dimensions_unit:{type:"string"},track_inventory:{type:"boolean"},tax_category_id:{type:"string"},options:{type:"array",description:"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.",items:{type:"object",required:["name","value"],properties:{name:{type:"string"},value:{type:"string"}}}},position:{type:"integer"},barcode:{type:"string"},prices:{type:"array",description:"Per-currency prices. Upserted by currency.",items:{type:"object",required:["currency","amount"],properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}}}},stock_items:{type:"array",description:"Per-stock-location inventory. Upserted by stock_location_id.",items:{type:"object",required:["stock_location_id","count_on_hand"],properties:{stock_location_id:{type:"string",description:"Stock location ID (e.g. sloc_xxx)"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}}}}},"/api/v3/admin/products/{product_id}/variants/{id}":{get:{summary:"Get a variant",tags:["Variants"],security:[{api_key:[],bearer_auth:[]}],description:"Returns a single variant by ID.\n\n**Required scope:** `read_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"product_id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Variant ID",schema:{type:"string"}},{name:"expand",in:"query",required:!1,description:"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).",schema:{type:"string"}},{name:"fields",in:"query",required:!1,description:"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.",schema:{type:"string"}}],responses:{"200":{description:"variant found",content:{"application/json":{}}},"404":{description:"variant not found",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}}}},patch:{summary:"Update a variant",tags:["Variants"],security:[{api_key:[],bearer_auth:[]}],description:"Updates a variant. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"product_id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Variant ID",schema:{type:"string"}}],responses:{"200":{description:"variant updated",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{sku:{type:"string"},price:{type:"string"},compare_at_price:{type:"string"},cost_price:{type:"string"},cost_currency:{type:"string"},weight:{type:"number"},height:{type:"number"},width:{type:"number"},depth:{type:"number"},weight_unit:{type:"string"},dimensions_unit:{type:"string"},track_inventory:{type:"boolean"},tax_category_id:{type:"string"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},value:{type:"string"}}}},total_on_hand:{type:"integer"},position:{type:"integer"},barcode:{type:"string"},prices:{type:"array",items:{type:"object",properties:{currency:{type:"string"},amount:{type:"string"},compare_at_amount:{type:"string",nullable:!0}},required:["currency","amount"]}},stock_items:{type:"array",items:{type:"object",properties:{stock_location_id:{type:"string"},count_on_hand:{type:"integer"},backorderable:{type:"boolean"}}}}}}}}}},delete:{summary:"Delete a variant",tags:["Variants"],security:[{api_key:[],bearer_auth:[]}],description:"Soft-deletes a variant.\n\n**Required scope:** `write_products` (for API-key authentication).",parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}},{name:"product_id",in:"path",required:!0,description:"Product ID",schema:{type:"string"}},{name:"id",in:"path",required:!0,description:"Variant ID",schema:{type:"string"}}],responses:{"204":{description:"variant deleted"}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries":{parameters:[{name:"webhook_endpoint_id",in:"path",required:!0,description:"Parent webhook endpoint ID",schema:{type:"string"}}],get:{summary:"List webhook deliveries",tags:["Webhooks"],security:[{api_key:[],bearer_auth:[]}],description:`Returns delivery attempts for the given endpoint, most recent first.
|
|
243
243
|
Each row carries the original request payload, the response code
|
|
244
244
|
(when the receiver replied), the execution time, and any transport
|
|
245
245
|
error \u2014 everything needed to audit failures and decide whether to
|
|
@@ -264,7 +264,7 @@ accepts Spree's payloads.
|
|
|
264
264
|
repeated delivery failures), no notification email is sent.
|
|
265
265
|
|
|
266
266
|
|
|
267
|
-
**Required scope:** \`write_webhooks\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"200":{description:"webhook endpoint disabled",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{reason:{type:"string"}}}}}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject class names, e.g. ["Spree::Product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},Address:{type:"object",properties:{id:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_iso:{type:"string"},state_text:{type:"string",nullable:!0},state_abbr:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_name:{type:"string",nullable:!0},label:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0}},required:["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_iso","state_text","state_abbr","quick_checkout","is_default_billing","is_default_shipping","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":!0},Adjustment:{type:"object",properties:{id:{type:"string"},label:{type:"string"},display_amount:{type:"string"},included:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","label","display_amount","included","created_at","updated_at","amount","order_id"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","roles"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string"},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","plaintext_token","created_by_email"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},preferred_order_routing_strategy:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","code","active","default","preferred_order_routing_strategy","created_at","updated_at"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},created_at:{type:"object"},updated_at:{type:"object"}},required:["iso","iso3","name","states_required","zipcode_required","created_at","updated_at"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},resource_type:{type:"string"},storefront_visible:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","namespace","key","label","field_type","resource_type","storefront_visible","created_at","updated_at"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},type:{type:"string",deprecated:!0},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},login:{type:"string",nullable:!0},metadata:{type:"object"},last_sign_in_at:{type:"string",nullable:!0},current_sign_in_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},sign_in_count:{type:"number"},failed_attempts:{type:"number"},last_sign_in_ip:{type:"string",nullable:!0},current_sign_in_ip:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","login","metadata","last_sign_in_at","current_sign_in_at","created_at","updated_at","sign_in_count","failed_attempts","last_sign_in_ip","current_sign_in_ip","tags","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","code","created_at","updated_at"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","created_at","updated_at"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},type:{type:"string",nullable:!0},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},done:{type:"boolean"},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","type","format","created_at","updated_at","user_id","done","filename","byte_size","download_url"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{type:"string"},fulfillment_type:{type:"string"},fulfilled_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}}},required:["id","number","tracking","tracking_url","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","items","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{type:"string"},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},acceptance_url:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}}},required:["id","variant_id","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_isos:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","currency","default_locale","tax_inclusive","default","country_isos","supported_locales","created_at","updated_at"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string"},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},viewable_id:{type:"string"},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string"}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fulfillment_status:{type:"string",nullable:!0},payment_status:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},discounts:{type:"array",items:{$ref:"#/components/schemas/Discount"}},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},status:{type:"string"},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},canceler_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},approver:{$ref:"#/components/schemas/Customer"},canceler:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/Customer"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}},return_authorizations:{type:"array",items:{$ref:"#/components/schemas/ReturnAuthorization"}},reimbursements:{type:"array",items:{$ref:"#/components/schemas/Reimbursement"}}},required:["id","market_id","channel_id","number","email","customer_note","currency","locale","total_quantity","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fulfillment_status","payment_status","completed_at","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","tags","internal_note","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string"},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},status:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{type:"string"},position:{type:"number"},match_policy:{type:"string"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},product_ids:{type:"array",items:{type:"string"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},description:{type:"string",nullable:!0},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},status:{type:"string"},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},tax_category_id:{type:"string",nullable:!0},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","purchasable","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","tax_category_id"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},reimbursement_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},payment:{$ref:"#/components/schemas/Payment"},reimbursement:{$ref:"#/components/schemas/Reimbursement"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","reimbursement_id","metadata","created_at","updated_at"],"x-typelizer":!0},Reimbursement:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reimbursement_status:{type:"string",nullable:!0},total:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},customer_return_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},order:{$ref:"#/components/schemas/Order"}},required:["id","number","reimbursement_status","total","order_id","customer_return_id","created_at","updated_at"],"x-typelizer":!0},ReturnAuthorization:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},return_authorization_reason_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","order_id","stock_location_id","return_authorization_reason_id","created_at","updated_at"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","created_at","updated_at"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"},created_at:{type:"object"},updated_at:{type:"object"}},required:["abbr","name","created_at","updated_at"],"x-typelizer":!0},StockItem:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},state_abbr:{type:"string",nullable:!0},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_iso:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{type:"string"},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string"},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","state_abbr","name","address1","city","zipcode","country_iso","country_name","state_text","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","pickup_ready_in_minutes","pickup_instructions","created_at","updated_at"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_item_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":!0},StoreCreditCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},non_expiring:{type:"boolean"}},required:["id","name","created_at","updated_at","non_expiring"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},category_id:{type:"string",nullable:!0},category_name:{type:"string",nullable:!0}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},default_currency:{type:"string"},default_locale:{type:"string"},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string"},preferred_unit_system:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},url:{type:"string"},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","created_at","updated_at","url","supported_currencies","supported_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},weight_unit:{type:"string",nullable:!0},dimensions_unit:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},tax_category_id:{type:"string",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_items:{type:"array",items:{$ref:"#/components/schemas/StockItem"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","thumbnail_url","purchasable","in_stock","backorderable","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","deleted_at","created_at","updated_at","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},payload:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","payload","created_at","updated_at","delivered_at","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0}}}};var Ll=new Set(["get","post","put","patch","delete"]);function Ni(){return jl}function yk(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function Ml(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[o,a]of Object.entries(n)){if(!Ll.has(o))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let c=a.summary??"";t.search&&!`${o} ${s} ${c}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:o.toUpperCase(),path:s,scope:yk(a),summary:c})}}return r}function Fl(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=dr(n),o=Dl(e,i,a=>a===s);return o.length>0?o:Dl(e,i,a=>fk(a,s))}function Dl(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let o=n.replace("/api/v3/admin","")||"/";if(r(o))for(let[a,c]of Object.entries(s))Ll.has(a)&&(t&&a!==t||i.push({method:a.toUpperCase(),path:o,summary:c.summary,description:c.description,parameters:jt(c.parameters,e),requestBody:jt(c.requestBody,e),responses:jt(c.responses,e)}))}return i}function fk(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var gk=8;function jt(e,t,r=[]){if(Array.isArray(e))return e.map(o=>jt(o,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let o=n.replace("#/components/schemas/","");return r.includes(o)||r.length>=gk||!(o in t.components.schemas)?{$ref:n}:jt(t.components.schemas[o],t,[...r,o])}let s={};for(let[o,a]of Object.entries(i))s[o]=jt(a,t,r);return s}function _k(e,t){return[...t,e]}function Gl(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function zl(){return new ea("--format <format>","output format").choices(["json","table"]).default("json")}function Ul(e){return Gl(e).addOption(zl())}async function Bl(e){let t=await cr({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:kr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function Vl(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee"}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
|
|
267
|
+
**Required scope:** \`write_webhooks\` (for API-key authentication).`,parameters:[{name:"x-spree-api-key",in:"header",required:!0,schema:{type:"string"}},{name:"Authorization",in:"header",required:!0,description:"Bearer token for admin authentication",schema:{type:"string"}}],responses:{"200":{description:"webhook endpoint disabled",content:{"application/json":{}}}},requestBody:{content:{"application/json":{schema:{type:"object",properties:{reason:{type:"string"}}}}}}}}},components:{schemas:{PaginationMeta:{type:"object",properties:{page:{type:"integer"},limit:{type:"integer"},count:{type:"integer",description:"Total number of records"},pages:{type:"integer",description:"Total number of pages"},from:{type:"integer",description:"Index of first record on this page"},to:{type:"integer",description:"Index of last record on this page"},in:{type:"integer",description:"Number of records on this page"},previous:{type:"integer",nullable:!0,description:"Previous page number"},next:{type:"integer",nullable:!0,description:"Next page number"}},required:["page","limit","count","pages","from","to","in"]},ErrorResponse:{type:"object",properties:{error:{type:"object",properties:{code:{type:"string"},message:{type:"string"},details:{type:"object",description:"Field-specific validation errors",nullable:!0}},required:["code","message"]}},required:["error"]},AuthResponse:{type:"object",properties:{token:{type:"string",description:"JWT access token"},user:{$ref:"#/components/schemas/AdminUser"}},required:["token","user"]},PermissionRule:{type:"object",description:"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.",properties:{allow:{type:"boolean",description:"true for `can`, false for `cannot`"},actions:{type:"array",items:{type:"string"},description:'Action names, e.g. ["read", "update"] or ["manage"]'},subjects:{type:"array",items:{type:"string"},description:'Subject class names, e.g. ["Spree::Product"] or ["all"]'},has_conditions:{type:"boolean",description:"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},required:["allow","actions","subjects","has_conditions"]},MeResponse:{type:"object",description:"Current admin user profile and serialized permissions",properties:{user:{$ref:"#/components/schemas/AdminUser"},permissions:{type:"array",items:{$ref:"#/components/schemas/PermissionRule"}}},required:["user","permissions"]},CheckoutRequirement:{type:"object",properties:{step:{type:"string",description:"Checkout step this requirement belongs to"},field:{type:"string",description:"Field that needs to be satisfied"},message:{type:"string",description:"Human-readable requirement message"}},required:["step","field","message"]},CartWarning:{type:"object",description:"A warning about a cart issue (e.g., item removed due to stock change)",properties:{code:{type:"string",description:"Machine-readable warning code"},message:{type:"string",description:"Human-readable warning message"},line_item_id:{type:"string",nullable:!0,description:"Prefixed line item ID (when applicable)"},variant_id:{type:"string",nullable:!0,description:"Prefixed variant ID (when applicable)"}},required:["code","message"]},FulfillmentManifestItem:{type:"object",description:"An item within a fulfillment \u2014 which line item and how many units are in this fulfillment",properties:{item_id:{type:"string",description:"Line item ID"},variant_id:{type:"string",description:"Variant ID"},quantity:{type:"integer",description:"Quantity in this fulfillment"}},required:["item_id","variant_id","quantity"]},AdminUserRoleAssignment:{type:"object",description:"A role assignment for the current store on a staff member",properties:{id:{type:"string",description:"Prefixed role ID"},name:{type:"string",description:"Role name"}},required:["id","name"]},PreferenceField:{type:"object",description:"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.",properties:{key:{type:"string"},type:{type:"string",description:"string | text | password | integer | decimal | boolean | array | hash"},default:{description:"Default value (any JSON type), null when there is no default",nullable:!0}},required:["key","type"]},PromotionActionCalculator:{type:"object",description:"The action's nested calculator (when the action carries one \u2014 null for actions like `free_shipping`)",properties:{type:{type:"string",description:"Wire shorthand for the calculator subclass"},label:{type:"string"},preferences:{type:"object",additionalProperties:!0},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}}},required:["type","label","preferences","preference_schema"]},PromotionActionLineItem:{type:"object",description:"One row in a `create_line_items` action \u2014 the variant added to the order and how many",properties:{variant_id:{type:"string"},quantity:{type:"integer"}},required:["variant_id","quantity"]},Address:{type:"object",properties:{id:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string"},address1:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},postal_code:{type:"string",nullable:!0},city:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},country_name:{type:"string"},country_iso:{type:"string"},state_text:{type:"string",nullable:!0},state_abbr:{type:"string",nullable:!0},quick_checkout:{type:"boolean"},is_default_billing:{type:"boolean"},is_default_shipping:{type:"boolean"},state_name:{type:"string",nullable:!0},label:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0}},required:["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_iso","state_text","state_abbr","quick_checkout","is_default_billing","is_default_shipping","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":!0},Adjustment:{type:"object",properties:{id:{type:"string"},label:{type:"string"},display_amount:{type:"string"},included:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","label","display_amount","included","created_at","updated_at","amount","order_id"],"x-typelizer":!0},AdminUser:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},full_name:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},roles:{type:"array",items:{$ref:"#/components/schemas/AdminUserRoleAssignment"}}},required:["id","email","first_name","last_name","full_name","created_at","updated_at","roles"],"x-typelizer":!0},AllowedOrigin:{type:"object",properties:{id:{type:"string"},origin:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","origin","created_at","updated_at"],"x-typelizer":!0},ApiKey:{type:"object",properties:{id:{type:"string"},name:{type:"string"},key_type:{type:"string"},token_prefix:{type:"string",nullable:!0},scopes:{type:"array",items:{type:"string"}},created_at:{type:"string"},updated_at:{type:"string"},revoked_at:{type:"string",nullable:!0},last_used_at:{type:"string",nullable:!0},plaintext_token:{type:"string",nullable:!0},created_by_email:{type:"string",nullable:!0}},required:["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","plaintext_token","created_by_email"],"x-typelizer":!0},Category:{type:"object",properties:{id:{type:"string"},name:{type:"string"},permalink:{type:"string"},position:{type:"number"},depth:{type:"number"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},children_count:{type:"number"},parent_id:{type:"string",nullable:!0},description:{type:"string"},description_html:{type:"string"},image_url:{type:"string",nullable:!0},square_image_url:{type:"string",nullable:!0},is_root:{type:"boolean"},is_child:{type:"boolean"},is_leaf:{type:"boolean"},parent:{$ref:"#/components/schemas/Category"},children:{type:"array",items:{$ref:"#/components/schemas/Category"}},ancestors:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},metadata:{type:"object"},pretty_name:{type:"string"},lft:{type:"number"},rgt:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","created_at","updated_at"],"x-typelizer":!0},Channel:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string"},active:{type:"boolean"},default:{type:"boolean"},preferred_order_routing_strategy:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","code","active","default","preferred_order_routing_strategy","created_at","updated_at"],"x-typelizer":!0},Country:{type:"object",properties:{iso:{type:"string"},iso3:{type:"string"},name:{type:"string"},states_required:{type:"boolean"},zipcode_required:{type:"boolean"},states:{type:"array",items:{$ref:"#/components/schemas/State"}},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},created_at:{type:"object"},updated_at:{type:"object"}},required:["iso","iso3","name","states_required","zipcode_required","created_at","updated_at"],"x-typelizer":!0},CouponCode:{type:"object",properties:{id:{type:"string"},code:{type:"string"},state:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},promotion_id:{type:"string"},order_id:{type:"string",nullable:!0}},required:["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":!0},CreditCard:{type:"object",properties:{id:{type:"string"},brand:{type:"string"},last4:{type:"string"},month:{type:"number"},year:{type:"number"},name:{type:"string",nullable:!0},default:{type:"boolean"},gateway_payment_profile_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},payment_method_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":!0},CustomFieldDefinition:{type:"object",properties:{id:{type:"string"},namespace:{type:"string"},key:{type:"string"},label:{type:"string"},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},resource_type:{type:"string"},storefront_visible:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","namespace","key","label","field_type","resource_type","storefront_visible","created_at","updated_at"],"x-typelizer":!0},CustomField:{type:"object",properties:{id:{type:"string"},label:{type:"string"},type:{type:"string",deprecated:!0},field_type:{type:"string",enum:["short_text","long_text","rich_text","number","boolean","json"]},key:{type:"string"},value:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},storefront_visible:{type:"boolean"},custom_field_definition_id:{type:"string"}},required:["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":!0},CustomerGroup:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},customers_count:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":!0},Customer:{type:"object",properties:{id:{type:"string"},email:{type:"string"},first_name:{type:"string",nullable:!0},last_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},accepts_email_marketing:{type:"boolean"},full_name:{type:"string"},available_store_credit_total:{type:"string"},display_available_store_credit_total:{type:"string"},addresses:{type:"array",items:{$ref:"#/components/schemas/Address"}},default_billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},default_shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},login:{type:"string",nullable:!0},metadata:{type:"object"},last_sign_in_at:{type:"string",nullable:!0},current_sign_in_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},sign_in_count:{type:"number"},failed_attempts:{type:"number"},last_sign_in_ip:{type:"string",nullable:!0},current_sign_in_ip:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note_html:{type:"string",nullable:!0},default_billing_address_id:{type:"string",nullable:!0},default_shipping_address_id:{type:"string",nullable:!0},orders_count:{type:"number"},total_spent:{type:"string"},display_total_spent:{type:"string"},last_order_completed_at:{type:"string",nullable:!0},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}},store_credits:{type:"array",items:{$ref:"#/components/schemas/StoreCredit"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}}},required:["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","login","metadata","last_sign_in_at","current_sign_in_at","created_at","updated_at","sign_in_count","failed_attempts","last_sign_in_ip","current_sign_in_ip","tags","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at"],"x-typelizer":!0},DeliveryMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},code:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","code","created_at","updated_at"],"x-typelizer":!0},DeliveryRate:{type:"object",properties:{id:{type:"string"},delivery_method_id:{type:"string"},name:{type:"string"},selected:{type:"boolean"},cost:{type:"string"},total:{type:"string"},additional_tax_total:{type:"string"},included_tax_total:{type:"string"},tax_total:{type:"string"},display_cost:{type:"string"},display_total:{type:"string"},display_additional_tax_total:{type:"string"},display_included_tax_total:{type:"string"},display_tax_total:{type:"string"},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","created_at","updated_at"],"x-typelizer":!0},DigitalLink:{type:"object",properties:{id:{type:"string"},access_counter:{type:"number"},filename:{type:"string"},content_type:{type:"string"},download_url:{type:"string"},authorizable:{type:"boolean"},expired:{type:"boolean"},access_limit_exceeded:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":!0},Discount:{type:"object",properties:{id:{type:"string"},promotion_id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},amount:{type:"string"},display_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":!0},Export:{type:"object",properties:{id:{type:"string"},number:{type:"string"},type:{type:"string",nullable:!0},format:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},user_id:{type:"string",nullable:!0},done:{type:"boolean"},filename:{type:"string",nullable:!0},byte_size:{type:"number",nullable:!0},download_url:{type:"string",nullable:!0}},required:["id","number","type","format","created_at","updated_at","user_id","done","filename","byte_size","download_url"],"x-typelizer":!0},Fulfillment:{type:"object",properties:{id:{type:"string"},number:{type:"string"},tracking:{type:"string",nullable:!0},tracking_url:{type:"string",nullable:!0},cost:{type:"string"},display_cost:{type:"string"},total:{type:"string"},display_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},status:{type:"string"},fulfillment_type:{type:"string"},fulfilled_at:{type:"string",nullable:!0},items:{type:"array",items:{$ref:"#/components/schemas/FulfillmentManifestItem"}},delivery_method:{$ref:"#/components/schemas/DeliveryMethod"},stock_location:{$ref:"#/components/schemas/StockLocation"},delivery_rates:{type:"array",items:{$ref:"#/components/schemas/DeliveryRate"}},metadata:{type:"object"},adjustment_total:{type:"string"},pre_tax_amount:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}}},required:["id","number","tracking","tracking_url","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","items","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id"],"x-typelizer":!0},GiftCardBatch:{type:"object",properties:{id:{type:"string"},codes_count:{type:"number"},currency:{type:"string",nullable:!0},prefix:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},amount:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0}},required:["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":!0},GiftCard:{type:"object",properties:{id:{type:"string"},code:{type:"string"},status:{type:"string"},currency:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_authorized:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},expires_at:{type:"string",nullable:!0},redeemed_at:{type:"string",nullable:!0},expired:{type:"boolean"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/AdminUser"},gift_card_batch:{$ref:"#/components/schemas/GiftCardBatch"},orders:{type:"array",items:{$ref:"#/components/schemas/Order"}}},required:["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":!0},Invitation:{type:"object",properties:{id:{type:"string"},email:{type:"string"},status:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},expires_at:{type:"string"},role_id:{type:"string"},role_name:{type:"string"},inviter_email:{type:"string"},acceptance_url:{type:"string"},invitee_exists:{type:"boolean"},store:{type:"object"}},required:["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":!0},LineItem:{type:"object",properties:{id:{type:"string"},variant_id:{type:"string"},quantity:{type:"number"},currency:{type:"string"},name:{type:"string"},slug:{type:"string"},options_text:{type:"string"},price:{type:"string"},display_price:{type:"string"},total:{type:"string"},display_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},pre_tax_amount:{type:"string"},display_pre_tax_amount:{type:"string"},discounted_amount:{type:"string"},display_discounted_amount:{type:"string"},display_compare_at_amount:{type:"string",nullable:!0},compare_at_amount:{type:"string",nullable:!0},thumbnail_url:{type:"string",nullable:!0},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},digital_links:{type:"array",items:{$ref:"#/components/schemas/DigitalLink"}},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},cost_price:{type:"string",nullable:!0},tax_category_id:{type:"string",nullable:!0},variant:{$ref:"#/components/schemas/Variant"},tax_category:{$ref:"#/components/schemas/TaxCategory"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}}},required:["id","variant_id","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":!0},Market:{type:"object",properties:{id:{type:"string"},name:{type:"string"},currency:{type:"string"},default_locale:{type:"string"},tax_inclusive:{type:"boolean"},default:{type:"boolean"},country_isos:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","currency","default_locale","tax_inclusive","default","country_isos","supported_locales","created_at","updated_at"],"x-typelizer":!0},Media:{type:"object",properties:{id:{type:"string"},product_id:{type:"string",nullable:!0},variant_ids:{type:"array",items:{type:"string"}},position:{type:"number"},alt:{type:"string",nullable:!0},media_type:{type:"string"},focal_point_x:{type:"number",nullable:!0},focal_point_y:{type:"number",nullable:!0},external_video_url:{type:"string",nullable:!0},original_url:{type:"string",nullable:!0},mini_url:{type:"string",nullable:!0},small_url:{type:"string",nullable:!0},medium_url:{type:"string",nullable:!0},large_url:{type:"string",nullable:!0},xlarge_url:{type:"string",nullable:!0},og_image_url:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},viewable_id:{type:"string"},download_url:{type:"string",nullable:!0},metadata:{type:"object"},viewable_type:{type:"string"}},required:["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":!0},OptionType:{type:"object",properties:{id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},kind:{type:"string"},metadata:{type:"object"},filterable:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}}},required:["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":!0},OptionValue:{type:"object",properties:{id:{type:"string"},option_type_id:{type:"string"},name:{type:"string"},label:{type:"string"},position:{type:"number"},color_code:{type:"string",nullable:!0},option_type_name:{type:"string"},option_type_label:{type:"string"},image_url:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},option_type:{$ref:"#/components/schemas/OptionType"}},required:["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":!0},Order:{type:"object",properties:{id:{type:"string"},market_id:{type:"string",nullable:!0},channel_id:{type:"string",nullable:!0},number:{type:"string"},email:{type:"string"},customer_note:{type:"string",nullable:!0},currency:{type:"string"},locale:{type:"string",nullable:!0},total_quantity:{type:"number"},item_total:{type:"string"},display_item_total:{type:"string"},adjustment_total:{type:"string"},display_adjustment_total:{type:"string"},discount_total:{type:"string"},display_discount_total:{type:"string"},tax_total:{type:"string"},display_tax_total:{type:"string"},included_tax_total:{type:"string"},display_included_tax_total:{type:"string"},additional_tax_total:{type:"string"},display_additional_tax_total:{type:"string"},total:{type:"string"},display_total:{type:"string"},gift_card_total:{type:"string"},display_gift_card_total:{type:"string"},amount_due:{type:"string"},display_amount_due:{type:"string"},delivery_total:{type:"string"},display_delivery_total:{type:"string"},fulfillment_status:{type:"string",nullable:!0},payment_status:{type:"string",nullable:!0},completed_at:{type:"string",nullable:!0},store_credit_total:{type:"string"},display_store_credit_total:{type:"string"},covered_by_store_credit:{type:"boolean"},discounts:{type:"array",items:{$ref:"#/components/schemas/Discount"}},items:{type:"array",items:{$ref:"#/components/schemas/LineItem"}},fulfillments:{type:"array",items:{$ref:"#/components/schemas/Fulfillment"}},payments:{type:"array",items:{$ref:"#/components/schemas/Payment"}},billing_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},shipping_address:{allOf:[{$ref:"#/components/schemas/Address"}],nullable:!0},gift_card:{allOf:[{$ref:"#/components/schemas/GiftCard"}],nullable:!0},market:{allOf:[{$ref:"#/components/schemas/Market"}],nullable:!0},status:{type:"string"},last_ip_address:{type:"string",nullable:!0},considered_risky:{type:"boolean"},confirmation_delivered:{type:"boolean"},store_owner_notification_delivered:{type:"boolean"},payment_total:{type:"string"},display_payment_total:{type:"string"},metadata:{type:"object"},canceled_at:{type:"string",nullable:!0},approved_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},preferred_stock_location_id:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},internal_note:{type:"string",nullable:!0},approver_id:{type:"string",nullable:!0},canceler_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},customer_id:{type:"string",nullable:!0},channel:{$ref:"#/components/schemas/Channel"},preferred_stock_location:{$ref:"#/components/schemas/StockLocation"},payment_methods:{type:"array",items:{$ref:"#/components/schemas/PaymentMethod"}},customer:{$ref:"#/components/schemas/Customer"},approver:{$ref:"#/components/schemas/Customer"},canceler:{$ref:"#/components/schemas/Customer"},created_by:{$ref:"#/components/schemas/Customer"},adjustments:{type:"array",items:{$ref:"#/components/schemas/Adjustment"}},return_authorizations:{type:"array",items:{$ref:"#/components/schemas/ReturnAuthorization"}},reimbursements:{type:"array",items:{$ref:"#/components/schemas/Reimbursement"}}},required:["id","market_id","channel_id","number","email","customer_note","currency","locale","total_quantity","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","fulfillment_status","payment_status","completed_at","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","tags","internal_note","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":!0},PaymentMethod:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},type:{type:"string"},session_required:{type:"boolean"},source_required:{type:"boolean"},metadata:{type:"object"},active:{type:"boolean"},auto_capture:{type:"boolean",nullable:!0},storefront_visible:{type:"boolean"},position:{type:"number"},created_at:{type:"string"},updated_at:{type:"string"},preferences:{type:"object"},preference_schema:{type:"object"}},required:["id","name","description","type","session_required","source_required","metadata","active","auto_capture","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":!0},Payment:{type:"object",properties:{id:{type:"string"},payment_method_id:{type:"string"},response_code:{type:"string",nullable:!0},number:{type:"string"},amount:{type:"string"},display_amount:{type:"string"},status:{type:"string"},source_type:{type:"string",nullable:!0,enum:["credit_card","store_credit","payment_source"]},source_id:{type:"string",nullable:!0},source:{anyOf:[{$ref:"#/components/schemas/CreditCard"},{$ref:"#/components/schemas/StoreCredit"},{$ref:"#/components/schemas/PaymentSource"}],nullable:!0},payment_method:{$ref:"#/components/schemas/PaymentMethod"},metadata:{type:"object"},avs_response:{type:"string",nullable:!0},cvv_response_code:{type:"string",nullable:!0},cvv_response_message:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},captured_amount:{type:"string"},order_id:{type:"string",nullable:!0},order:{$ref:"#/components/schemas/Order"},refunds:{type:"array",items:{$ref:"#/components/schemas/Refund"}}},required:["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":!0},PaymentSource:{type:"object",properties:{id:{type:"string"},gateway_payment_profile_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":!0},PriceHistory:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_in_cents:{type:"number"},currency:{type:"string"},display_amount:{type:"string"},recorded_at:{type:"string"},variant_id:{type:"string"},price_id:{type:"string"},compare_at_amount:{type:"string",nullable:!0},created_at:{type:"string"}},required:["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":!0},PriceList:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},status:{type:"string"},position:{type:"number"},match_policy:{type:"string"},starts_at:{type:"string",nullable:!0},ends_at:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},currently_active:{type:"boolean"},products_count:{type:"number"},prices_count:{type:"number"},product_ids:{type:"array",items:{type:"string"}},price_rules:{type:"array",items:{$ref:"#/components/schemas/PriceRule"}}},required:["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":!0},PriceRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},price_list_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},description:{type:"string",nullable:!0},markets:{type:"array",items:{$ref:"#/components/schemas/Market"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}}},required:["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":!0},Price:{type:"object",properties:{id:{type:"string"},amount:{type:"string",nullable:!0},amount_in_cents:{type:"number",nullable:!0},compare_at_amount:{type:"string",nullable:!0},compare_at_amount_in_cents:{type:"number",nullable:!0},currency:{type:"string",nullable:!0},display_amount:{type:"string",nullable:!0},display_compare_at_amount:{type:"string",nullable:!0},price_list_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":!0},ProductPublication:{type:"object",properties:{id:{type:"string"},published_at:{type:"string",nullable:!0},unpublished_at:{type:"string",nullable:!0},product_id:{type:"string"},channel_id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":!0},Product:{type:"object",properties:{id:{type:"string"},name:{type:"string"},slug:{type:"string"},meta_title:{type:"string",nullable:!0},meta_description:{type:"string",nullable:!0},meta_keywords:{type:"string",nullable:!0},variant_count:{type:"number"},available_on:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},available:{type:"boolean"},description:{type:"string",nullable:!0},description_html:{type:"string",nullable:!0},default_variant_id:{type:"string"},thumbnail_url:{type:"string",nullable:!0},tags:{type:"array",items:{type:"string"}},price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},variants:{type:"array",items:{$ref:"#/components/schemas/Variant"}},default_variant:{$ref:"#/components/schemas/Variant"},option_types:{type:"array",items:{$ref:"#/components/schemas/OptionType"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},status:{type:"string"},metadata:{type:"object"},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},tax_category_id:{type:"string",nullable:!0},product_publications:{type:"array",items:{$ref:"#/components/schemas/ProductPublication"}},channels:{type:"array",items:{$ref:"#/components/schemas/Channel"}}},required:["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","purchasable","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","tax_category_id"],"x-typelizer":!0},PromotionAction:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},calculator:{allOf:[{$ref:"#/components/schemas/PromotionActionCalculator"}],nullable:!0},line_items:{type:"array",items:{$ref:"#/components/schemas/PromotionActionLineItem"},nullable:!0}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":!0},PromotionRule:{type:"object",properties:{id:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},type:{type:"string"},promotion_id:{type:"string"},preferences:{type:"object"},preference_schema:{type:"array",items:{$ref:"#/components/schemas/PreferenceField"}},label:{type:"string"},product_ids:{type:"array",items:{type:"string"},nullable:!0},category_ids:{type:"array",items:{type:"string"},nullable:!0},customer_ids:{type:"array",items:{type:"string"},nullable:!0},products:{type:"array",items:{$ref:"#/components/schemas/Product"}},categories:{type:"array",items:{$ref:"#/components/schemas/Category"}},customers:{type:"array",items:{$ref:"#/components/schemas/Customer"}},customer_groups:{type:"array",items:{$ref:"#/components/schemas/CustomerGroup"}},countries:{type:"array",items:{$ref:"#/components/schemas/Country"}}},required:["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":!0},Promotion:{type:"object",properties:{id:{type:"string"},name:{type:"string"},description:{type:"string",nullable:!0},code:{type:"string",nullable:!0},starts_at:{type:"string",nullable:!0},expires_at:{type:"string",nullable:!0},usage_limit:{type:"number",nullable:!0},match_policy:{type:"string",enum:["all","any"]},path:{type:"string",nullable:!0},kind:{type:"string",enum:["coupon_code","automatic"]},multi_codes:{type:"boolean"},number_of_codes:{type:"number",nullable:!0},code_prefix:{type:"string",nullable:!0},promotion_category_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},action_ids:{type:"array",items:{type:"string"}},rule_ids:{type:"array",items:{type:"string"}}},required:["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":!0},Refund:{type:"object",properties:{id:{type:"string"},transaction_id:{type:"string",nullable:!0},amount:{type:"string",nullable:!0},payment_id:{type:"string",nullable:!0},refund_reason_id:{type:"string",nullable:!0},reimbursement_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},payment:{$ref:"#/components/schemas/Payment"},reimbursement:{$ref:"#/components/schemas/Reimbursement"}},required:["id","transaction_id","amount","payment_id","refund_reason_id","reimbursement_id","metadata","created_at","updated_at"],"x-typelizer":!0},Reimbursement:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reimbursement_status:{type:"string",nullable:!0},total:{type:"string",nullable:!0},order_id:{type:"string",nullable:!0},customer_return_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},order:{$ref:"#/components/schemas/Order"}},required:["id","number","reimbursement_status","total","order_id","customer_return_id","created_at","updated_at"],"x-typelizer":!0},ReturnAuthorization:{type:"object",properties:{id:{type:"string"},number:{type:"string"},status:{type:"string"},order_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},return_authorization_reason_id:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},order:{$ref:"#/components/schemas/Order"},stock_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","status","order_id","stock_location_id","return_authorization_reason_id","created_at","updated_at"],"x-typelizer":!0},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","created_at","updated_at"],"x-typelizer":!0},State:{type:"object",properties:{abbr:{type:"string"},name:{type:"string"},created_at:{type:"object"},updated_at:{type:"object"}},required:["abbr","name","created_at","updated_at"],"x-typelizer":!0},StockItem:{type:"object",properties:{id:{type:"string"},count_on_hand:{type:"number"},backorderable:{type:"boolean"},stock_location_id:{type:"string",nullable:!0},variant_id:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},allocated_count:{type:"number"},available_count:{type:"number"},stock_location:{$ref:"#/components/schemas/StockLocation"},variant:{$ref:"#/components/schemas/Variant"}},required:["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":!0},StockLocation:{type:"object",properties:{id:{type:"string"},state_abbr:{type:"string",nullable:!0},name:{type:"string"},address1:{type:"string",nullable:!0},city:{type:"string",nullable:!0},zipcode:{type:"string",nullable:!0},country_iso:{type:"string",nullable:!0},country_name:{type:"string",nullable:!0},state_text:{type:"string",nullable:!0},admin_name:{type:"string",nullable:!0},address2:{type:"string",nullable:!0},state_name:{type:"string",nullable:!0},phone:{type:"string",nullable:!0},company:{type:"string",nullable:!0},active:{type:"boolean"},default:{type:"boolean"},backorderable_default:{type:"boolean"},propagate_all_variants:{type:"boolean"},kind:{type:"string"},pickup_enabled:{type:"boolean"},pickup_stock_policy:{type:"string"},pickup_ready_in_minutes:{type:"number",nullable:!0},pickup_instructions:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","state_abbr","name","address1","city","zipcode","country_iso","country_name","state_text","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","pickup_ready_in_minutes","pickup_instructions","created_at","updated_at"],"x-typelizer":!0},StockReservation:{type:"object",properties:{id:{type:"string"},stock_item_id:{type:"string"},line_item_id:{type:"string"},order_id:{type:"string"},variant_id:{type:"string",nullable:!0},stock_location_id:{type:"string",nullable:!0},quantity:{type:"number"},expires_at:{type:"string"},active:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":!0},StockTransfer:{type:"object",properties:{id:{type:"string"},number:{type:"string"},reference:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},source_location_id:{type:"string",nullable:!0},destination_location_id:{type:"string",nullable:!0},source_location:{$ref:"#/components/schemas/StockLocation"},destination_location:{$ref:"#/components/schemas/StockLocation"}},required:["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":!0},StoreCreditCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},non_expiring:{type:"boolean"}},required:["id","name","created_at","updated_at","non_expiring"],"x-typelizer":!0},StoreCredit:{type:"object",properties:{id:{type:"string"},amount:{type:"string"},amount_used:{type:"string"},amount_remaining:{type:"string"},display_amount:{type:"string"},display_amount_used:{type:"string"},display_amount_remaining:{type:"string"},currency:{type:"string"},memo:{type:"string",nullable:!0},metadata:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},customer_id:{type:"string",nullable:!0},created_by_id:{type:"string",nullable:!0},category_id:{type:"string",nullable:!0},category_name:{type:"string",nullable:!0}},required:["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":!0},Store:{type:"object",properties:{id:{type:"string"},metadata:{type:"object"},name:{type:"string"},default_currency:{type:"string"},default_locale:{type:"string"},mail_from_address:{type:"string",nullable:!0},customer_support_email:{type:"string",nullable:!0},new_order_notifications_email:{type:"string",nullable:!0},preferred_send_consumer_transactional_emails:{type:"boolean"},preferred_admin_locale:{type:"string",nullable:!0},preferred_timezone:{type:"string"},preferred_weight_unit:{type:"string"},preferred_unit_system:{type:"string"},created_at:{type:"string"},updated_at:{type:"string"},url:{type:"string"},supported_currencies:{type:"array",items:{type:"string"}},supported_locales:{type:"array",items:{type:"string"}},logo_url:{type:"string",nullable:!0},mailer_logo_url:{type:"string",nullable:!0}},required:["id","metadata","name","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_unit_system","created_at","updated_at","url","supported_currencies","supported_locales","logo_url","mailer_logo_url"],"x-typelizer":!0},TaxCategory:{type:"object",properties:{id:{type:"string"},name:{type:"string"},tax_code:{type:"string",nullable:!0},description:{type:"string",nullable:!0},is_default:{type:"boolean"},created_at:{type:"string"},updated_at:{type:"string"}},required:["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":!0},Variant:{type:"object",properties:{id:{type:"string"},product_id:{type:"string"},sku:{type:"string",nullable:!0},options_text:{type:"string"},track_inventory:{type:"boolean"},media_count:{type:"number"},thumbnail_url:{type:"string",nullable:!0},purchasable:{type:"boolean"},in_stock:{type:"boolean"},backorderable:{type:"boolean"},weight:{type:"number",nullable:!0},height:{type:"number",nullable:!0},width:{type:"number",nullable:!0},depth:{type:"number",nullable:!0},price:{$ref:"#/components/schemas/Price"},original_price:{allOf:[{$ref:"#/components/schemas/Price"}],nullable:!0},primary_media:{$ref:"#/components/schemas/Media"},media:{type:"array",items:{$ref:"#/components/schemas/Media"}},option_values:{type:"array",items:{$ref:"#/components/schemas/OptionValue"}},custom_fields:{type:"array",items:{$ref:"#/components/schemas/CustomField"}},prior_price:{allOf:[{$ref:"#/components/schemas/PriceHistory"}],nullable:!0},metadata:{type:"object"},position:{type:"number"},cost_price:{type:"string",nullable:!0},cost_currency:{type:"string",nullable:!0},barcode:{type:"string",nullable:!0},weight_unit:{type:"string",nullable:!0},dimensions_unit:{type:"string",nullable:!0},deleted_at:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},tax_category_id:{type:"string",nullable:!0},available_stock:{type:"number",nullable:!0},reserved_quantity:{type:"number"},total_on_hand:{type:"number",nullable:!0},product_name:{type:"string"},prices:{type:"array",items:{$ref:"#/components/schemas/Price"}},stock_items:{type:"array",items:{$ref:"#/components/schemas/StockItem"}}},required:["id","product_id","sku","options_text","track_inventory","media_count","thumbnail_url","purchasable","in_stock","backorderable","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","deleted_at","created_at","updated_at","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":!0},WebhookDelivery:{type:"object",properties:{id:{type:"string"},event_name:{type:"string"},event_id:{type:"string",nullable:!0},response_code:{type:"number",nullable:!0},execution_time:{type:"number",nullable:!0},error_type:{type:"string",nullable:!0},request_errors:{type:"string",nullable:!0},response_body:{type:"string",nullable:!0},success:{type:"boolean",nullable:!0},payload:{type:"object"},created_at:{type:"string"},updated_at:{type:"string"},delivered_at:{type:"string",nullable:!0},webhook_endpoint_id:{type:"string"},webhook_endpoint_url:{type:"string"}},required:["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","payload","created_at","updated_at","delivered_at","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":!0},WebhookEndpoint:{type:"object",properties:{id:{type:"string"},name:{type:"string",nullable:!0},url:{type:"string"},active:{type:"boolean"},subscriptions:{type:"array",items:{type:"string"}},disabled_reason:{type:"string",nullable:!0},created_at:{type:"string"},updated_at:{type:"string"},disabled_at:{type:"string",nullable:!0},secret_key:{type:"string",nullable:!0},last_delivery_at:{type:"string",nullable:!0},recent_delivery_count:{type:"number"},recent_failure_count:{type:"number"},total_delivery_count:{type:"number"},successful_delivery_count:{type:"number"},failed_delivery_count:{type:"number"}},required:["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":!0}}}};var Ll=new Set(["get","post","put","patch","delete"]);function Ni(){return jl}function yk(e){let t=e.description?.match(/\*\*Required scope:\*\* (.+?) \(for API-key authentication\)\./);return t?t[1].replaceAll("`",""):"\u2014"}function Ml(e,t={}){let r=[];for(let[i,n]of Object.entries(e.paths)){let s=i.replace("/api/v3/admin","")||"/";for(let[o,a]of Object.entries(n)){if(!Ll.has(o))continue;if(t.resource){let d=s.split("/")[1]??"";if(d!==t.resource&&!d.startsWith(t.resource))continue}let c=a.summary??"";t.search&&!`${o} ${s} ${c}`.toLowerCase().includes(t.search.toLowerCase())||r.push({method:o.toUpperCase(),path:s,scope:yk(a),summary:c})}}return r}function Fl(e,t){let r=t.trim().split(/\s+/),i=r.length>1?r[0].toLowerCase():void 0,n=r.length>1?r[1]:r[0],s=dr(n),o=Dl(e,i,a=>a===s);return o.length>0?o:Dl(e,i,a=>fk(a,s))}function Dl(e,t,r){let i=[];for(let[n,s]of Object.entries(e.paths)){let o=n.replace("/api/v3/admin","")||"/";if(r(o))for(let[a,c]of Object.entries(s))Ll.has(a)&&(t&&a!==t||i.push({method:a.toUpperCase(),path:o,summary:c.summary,description:c.description,parameters:jt(c.parameters,e),requestBody:jt(c.requestBody,e),responses:jt(c.responses,e)}))}return i}function fk(e,t){if(e===t)return!0;let r=e.split("/"),i=t.split("/");return r.length!==i.length?!1:r.every((n,s)=>n.startsWith("{")&&n.endsWith("}")?i[s].length>0:n===i[s])}var gk=8;function jt(e,t,r=[]){if(Array.isArray(e))return e.map(o=>jt(o,t,r));if(!e||typeof e!="object")return e;let i=e,n=i.$ref;if(typeof n=="string"){let o=n.replace("#/components/schemas/","");return r.includes(o)||r.length>=gk||!(o in t.components.schemas)?{$ref:n}:jt(t.components.schemas[o],t,[...r,o])}let s={};for(let[o,a]of Object.entries(i))s[o]=jt(a,t,r);return s}function _k(e,t){return[...t,e]}function Gl(e){return e.option("--profile <name>","use a saved profile (see `spree auth`)").option("--base-url <url>","store URL (overrides profile/env/project)").option("--api-key <key>","secret API key (prefer SPREE_API_KEY \u2014 flags leak into shell history)").option("--store-id <id>","X-Spree-Store-Id for hosts serving multiple stores")}function zl(){return new ea("--format <format>","output format").choices(["json","table"]).default("json")}function Ul(e){return Gl(e).addOption(zl())}async function Bl(e){let t=await cr({baseUrl:e.baseUrl,apiKey:e.apiKey,profile:e.profile});return{client:kr({baseUrl:t.baseUrl,secretKey:t.apiKey,...e.storeId?{storeId:e.storeId}:{}}),credentials:t}}function Vl(e){let t=e.command("api").description("Call the Admin API directly (generic get/post/patch/delete)");t.addHelpText("after",["","Examples:"," spree api get /products -q status_eq=active --limit 10",` spree api post /products -d '{"name":"Classic Tee","prices":[{"currency":"USD","amount":"29.99"}]}'`," spree api get /orders/ord_x8k2J9aQ --expand items,payments","","Discover the surface (offline, no server needed):"," spree api endpoints --search <term> # find endpoints + required scopes",' spree api schema "POST /orders" # request/response schema for one operation'," spree completion zsh # tab-completion for paths, filters, scopes"].join(`
|
|
268
268
|
`)),Ul(t.command("get <path>").description("GET an Admin API path, e.g. `spree api get /products -q status_eq=active`").option("-q, --query <expr>","Ransack predicate key=value (repeatable)",_k,[]).option("--sort <fields>","sort, e.g. -created_at").option("--page <n>","page number").option("--limit <n>","page size (max 100)").option("--expand <relations>","expand relations, e.g. variants,variants.prices").option("--fields <fields>","sparse fields, e.g. id,name")).action(async(r,i)=>{let n;try{let s=Rl(i),{client:o,credentials:a}=await Bl(i);n=a.baseUrl;let c=await o.request("GET",dr(r),{params:s});pr(c,i.format)}catch(s){ut(s,{baseUrl:n})}});for(let r of["post","patch","delete"])Ul(t.command(`${r} <path>`).description(`${r.toUpperCase()} an Admin API path`).option("-d, --data <json>","request body: inline JSON, @file, or '-' for stdin")).action(async(i,n)=>{let s;try{let o=await va(n.data),{client:a,credentials:c}=await Bl(n);s=c.baseUrl;let d=await a.request(r.toUpperCase(),dr(i),{...o===Un?{}:{body:o}});pr(d,n.format)}catch(o){ut(o,{baseUrl:s})}});t.command("endpoints").description("List Admin API endpoints with their required scopes").option("--resource <name>","filter by first path segment, e.g. orders").option("--search <term>","filter by method, path, or summary").addOption(zl()).action(r=>{let i=Ml(Ni(),{resource:r.resource,search:r.search});if(i.length===0){process.stderr.write(`No endpoints match.
|
|
269
269
|
`),process.exitCode=1;return}if(r.format==="table"){(0,Nl.printTable)(i.map(n=>({Method:n.method,Path:n.path,Scope:n.scope,Summary:n.summary})));return}pr(i,"json")}),t.command("schema <operation>").description('Show the request/response schema for an operation, e.g. `spree api schema "POST /products"`').action(r=>{let i=Fl(Ni(),r);if(i.length===0){process.stderr.write(`No operation matches "${r}". Try \`spree api endpoints --search ${r.split(/\s+/).pop()}\`.
|
|
270
270
|
`),process.exitCode=1;return}let n=/\s/.test(r.trim());pr(n&&i.length===1?i[0]:i,"json")}),Gl(t.command("status").description("Show resolved credentials, server reachability, and the bundled spec version")).action(async r=>{try{let i=await cr({baseUrl:r.baseUrl,apiKey:r.apiKey,profile:r.profile},{allowMint:!1}),n=await ur(i.baseUrl,i.apiKey),s=Ni(),o=Bi(n),a=[`${Je.default.bold("Base URL:")} ${i.baseUrl}`,`${Je.default.bold("Credentials:")} ${i.source}${i.profileName?` (${i.profileName})`:""}, key ${i.tokenPrefix}${Je.default.dim("\u2026")}`];i.scopes?.length&&a.push(`${Je.default.bold("Scopes:")} ${i.scopes.join(", ")}`),a.push(`${Je.default.bold("Server:")} ${o}`),a.push(`${Je.default.bold("Bundled spec:")} ${s.info?.version??"unknown"} ${Je.default.dim("(spree api endpoints/schema reflect this snapshot, not the live server)")}`),process.stdout.write(`${a.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spree/cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "CLI for managing Spree Commerce projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
46
|
"vitest": "^4.1.5",
|
|
47
47
|
"yaml": "^2.8.4",
|
|
48
|
-
"@spree/admin-sdk": "^0.
|
|
48
|
+
"@spree/admin-sdk": "^0.3.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=20"
|