{ "opencollection": "1.0.0", "info": { "name": "Admin Account / Address Orders API", "version": "v3" }, "items": [ { "info": { "name": "Orders", "type": "folder" }, "items": [ { "info": { "name": "Apply a gift card to an order", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/gift_cards", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication)." }, { "info": { "name": "Remove a gift card from an order", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/gift_cards/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" }, { "name": "id", "value": "", "type": "path", "description": "Gift card ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication)." }, { "info": { "name": "List order items", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/items", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., quantity,price,total). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication)." }, { "info": { "name": "Add an item", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/items", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Show an item", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/items/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" }, { "name": "id", "value": "", "type": "path", "description": "Item ID" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., quantity,price,total). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication)." }, { "info": { "name": "Update an item", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/items/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" }, { "name": "id", "value": "", "type": "path", "description": "Item ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Remove an item", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/items/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" }, { "name": "id", "value": "", "type": "path", "description": "Item ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Apply customer's store credit to an order", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/store_credits", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "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)." }, { "info": { "name": "Remove store credit from an order", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/orders/:order_id/store_credits", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "order_id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication)." }, { "info": { "name": "List orders", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/orders", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "page", "value": "", "type": "query", "description": "Page number" }, { "name": "limit", "value": "", "type": "query", "description": "Number of records per page" }, { "name": "sort", "value": "", "type": "query", "description": "Sort field (e.g., created_at, -created_at, completed_at)" }, { "name": "q[state_eq]", "value": "", "type": "query", "description": "Filter by state (cart, address, delivery, payment, confirm, complete, canceled)" }, { "name": "q[email_cont]", "value": "", "type": "query", "description": "Filter by email (contains)" }, { "name": "q[number_eq]", "value": "", "type": "query", "description": "Filter by order number" }, { "name": "q[completed_at_gt]", "value": "", "type": "query", "description": "Filter by completed after date" }, { "name": "expand", "value": "", "type": "query", "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)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication)." }, { "info": { "name": "Create a draft order", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/orders", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Creates a new draft order in one shot. Customer, items, addresses, currency,\nmarket, channel, locale, notes, metadata, and a coupon code can all be\nprovided inline.\n\nSetting `preferred_stock_location_id` pins the order's preferred fulfillment\nlocation — Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal — the order is created and the failure\nis reported on the service result (not in the API resp" }, { "info": { "name": "Show an order", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/admin/orders/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID (e.g., or_xxx)" }, { "name": "expand", "value": "", "type": "query", "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)." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication)." }, { "info": { "name": "Update an order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Delete a draft order", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v3/admin/orders/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Complete an order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:id/complete", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "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)." }, { "info": { "name": "Cancel an order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:id/cancel", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Cancels a completed order.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Approve an order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:id/approve", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Resume a canceled order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v3/admin/orders/:id/resume", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Resend confirmation email", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v3/admin/orders/:id/resend_confirmation", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order ID" } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication)." }, { "info": { "name": "Return a list of Orders", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/orders", "params": [ { "name": "page", "value": "1", "type": "query" }, { "name": "per_page", "value": "50", "type": "query" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" }, { "name": "filter[state_eq]", "value": "complete", "type": "query" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns a list of Orders" }, { "info": { "name": "Creates an Order", "type": "http" }, "http": { "method": "POST", "url": "http://{defaultHost}/api/v2/platform/orders", "params": [ { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Creates an Order" }, { "info": { "name": "Return an Order", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v2/platform/orders/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns an Order" }, { "info": { "name": "Update an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Updates an Order" }, { "info": { "name": "Delete an Order", "type": "http" }, "http": { "method": "DELETE", "url": "http://{defaultHost}/api/v2/platform/orders/:id", "params": [ { "name": "id", "value": "", "type": "path" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Deletes an Order" }, { "info": { "name": "Advances an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/advance", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Advances an Order" }, { "info": { "name": "Next an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/next", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Moves an Order to the next state" }, { "info": { "name": "Completes an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/complete", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Marks an Order as completed" }, { "info": { "name": "Empties an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/empty", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Removes all line items, promotions, shipment and payments from an Order" }, { "info": { "name": "Approves an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/approve", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Approves an Order, when using a token created for a user, it will save this user as the approver" }, { "info": { "name": "Cancels an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/cancel", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Cancels an Order, when using a token created for a user, it will save this user as the canceler" }, { "info": { "name": "Use Store Credit for an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/use_store_credit", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Creates Store Credit payment for an Order" }, { "info": { "name": "Apply Coupon Code for an Order", "type": "http" }, "http": { "method": "PATCH", "url": "http://{defaultHost}/api/v2/platform/orders/:id/apply_coupon_code", "params": [ { "name": "id", "value": "", "type": "path" }, { "name": "include", "value": "line_items,variants,product", "type": "query", "description": "Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes" } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Creates Store Credit payment for an Order" }, { "info": { "name": "Get an order", "type": "http" }, "http": { "method": "GET", "url": "http://{defaultHost}/api/v3/store/orders/:id", "headers": [ { "name": "x-spree-api-key", "value": "" }, { "name": "Authorization", "value": "" }, { "name": "x-spree-token", "value": "" } ], "params": [ { "name": "id", "value": "", "type": "path", "description": "Order prefixed ID" }, { "name": "expand", "value": "", "type": "query", "description": "Comma-separated associations to expand (items, fulfillments, payments, discounts, billing_address, shipping_address, gift_card). Use \"none\" to skip associations." }, { "name": "fields", "value": "", "type": "query", "description": "Comma-separated list of fields to include (e.g., total,amount_due,item_count). id is always included." } ], "auth": { "type": "apikey", "key": "x-spree-api-key", "value": "{{x-spree-api-key}}", "placement": "header" } }, "docs": "Returns a single completed order by prefixed ID. Accessible via JWT (authenticated users) or order token header (guests)." } ] } ], "bundled": true }