dist/cursor/saleor-commerce/skills/saleor-orders/SKILL.md
Manage the Saleor order lifecycle — order creation, fulfillments, returns, refunds, draft orders, and order events. Use when working with Saleor orders.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins saleor-ordersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
site:docs.saleor.io orders order lifecycle status for order model and state transitionssite:docs.saleor.io fulfillments order fulfillment for fulfillment creation and trackingsite:docs.saleor.io returns refunds order for return and refund workflowshttps://docs.saleor.io/docs/developer/orders and review order statuses, events, and mutationssite:docs.saleor.io draft orders for draft order creation and completion patternshttps://docs.saleor.io/docs/developer/fulfillment and review fulfillment line items and tracking| Status | Description |
|--------|-------------|
| UNCONFIRMED | Order created but not yet confirmed (e.g., pending payment) |
| UNFULFILLED | Order confirmed and paid; no items shipped yet |
| PARTIALLY_FULFILLED | Some items have been shipped |
| FULFILLED | All items have been shipped |
| PARTIALLY_RETURNED | Some items have been returned |
| RETURNED | All items have been returned |
| CANCELED | Order has been cancelled |
| Status | Description |
|--------|-------------|
| NONE | No payment authorized |
| PARTIAL | Partial amount authorized |
| FULL | Full amount authorized |
| Status | Description |
|--------|-------------|
| NONE | No payment charged |
| PARTIAL | Partial amount charged |
| FULL | Full amount charged |
| OVERCHARGED | Charged amount exceeds order total |
Orders in Saleor are typically created through the checkout completion process:
| Step | Description |
|------|-------------|
| 1. Checkout completed | Customer completes checkout with payment |
| 2. Order created | System generates order with status UNCONFIRMED or UNFULFILLED |
| 3. Payment confirmed | Transaction events confirm successful charge |
| 4. Ready for fulfillment | Order moves to UNFULFILLED status |
Orders can also be created via draft orders (see below) or programmatically through the
orderCreateFromCheckoutmutation.
Draft orders allow merchants and staff to create orders manually:
| Operation | Mutation | Notes |
|-----------|----------|-------|
| Create draft | draftOrderCreate | Specify lines, customer, addresses, channel |
| Update draft | draftOrderUpdate | Modify lines, addresses, discounts |
| Add lines | draftOrderLinesCreate | Add product variants to draft |
| Delete line | orderLineDelete | Remove a line from the draft |
| Complete draft | draftOrderComplete | Convert to a real order |
| Delete draft | draftOrderDelete | Remove draft before completion |
| Step | Description |
|------|-------------|
| 1. Query order | Retrieve unfulfilled order lines and warehouse info |
| 2. Create fulfillment | Use orderFulfill with line items and quantities |
| 3. Add tracking | Tracking number and URL included in fulfillment creation |
| 4. Notify customer | Optional email notification on fulfillment |
| Operation | Mutation | Notes |
|-----------|----------|-------|
| Fulfill order | orderFulfill | Specify lines, quantities, warehouse, tracking |
| Cancel fulfillment | orderFulfillmentCancel | Restock items optionally |
| Update tracking | orderFulfillmentUpdateTracking | Update tracking number and URL |
| Approve fulfillment | orderFulfillmentApprove | For orders requiring approval before shipping |
| Status | Description |
|--------|-------------|
| FULFILLED | Items shipped and tracking assigned |
| CANCELED | Fulfillment cancelled; items may be restocked |
| WAITING_FOR_APPROVAL | Fulfillment created but awaiting staff approval |
| REFUNDED | Fulfillment refunded |
| RETURNED | Items returned from this fulfillment |
| REFUNDED_AND_RETURNED | Items both returned and refunded |
| Step | Description |
|------|-------------|
| 1. Create return | Use orderFulfillmentReturnProducts with fulfillment lines |
| 2. Specify quantities | Indicate which items and how many are being returned |
| 3. Optional refund | Include refund amount or create refund separately |
| 4. Restock | Optionally restock returned items to warehouse |
| Operation | Mutation | Notes |
|-----------|----------|-------|
| Grant refund | orderGrantRefundCreate | Create a granted refund (amount or lines) |
| Update grant | orderGrantRefundUpdate | Modify granted refund before processing |
| Send refund | transactionRequestAction with REFUND | Process the actual refund via payment App |
Saleor separates the concept of "granting" a refund (merchant decision) from "sending" a refund (payment processing). This allows partial refunds and multi-step refund workflows.
Saleor maintains a comprehensive event log for every order:
| Event Type | Description |
|------------|-------------|
| PLACED | Order was placed |
| CONFIRMED | Order was confirmed |
| FULFILLMENT_CANCELED | A fulfillment was cancelled |
| FULFILLMENT_FULFILLED_ITEMS | Items were fulfilled |
| PAYMENT_CAPTURED | Payment was captured |
| PAYMENT_REFUNDED | Payment was refunded |
| NOTE_ADDED | Staff note was added |
| EMAIL_SENT | Notification email was sent |
| CANCELED | Order was cancelled |
Fetch live docs for the complete
OrderEventsEnum-- additional event types exist for tracking, returns, and transaction updates.
Each order contains OrderLine objects representing purchased items:
| Field | Description |
|-------|-------------|
| productName | Product name at time of purchase |
| variantName | Variant name at time of purchase |
| productSku | SKU at time of purchase |
| quantity | Number of units ordered |
| quantityFulfilled | Number of units already shipped |
| unitPrice | Price per unit (net and gross) |
| totalPrice | Line total (net and gross) |
| undiscountedUnitPrice | Original price before discounts |
Order lines store a snapshot of product data at the time of purchase. Changes to the product after the order do not affect existing orders.
| Discount Type | Description |
|---------------|-------------|
| Voucher | Applied via voucher code during checkout |
| Promotion | Automatic catalog or order promotion |
| Manual discount | Staff-applied discount via orderDiscountAdd |
| Operation | Mutation |
|-----------|----------|
| Add manual discount | orderDiscountAdd |
| Update discount | orderDiscountUpdate |
| Delete discount | orderDiscountDelete |
| Operation | Query | Notes |
|-----------|-------|-------|
| List orders | orders | Filter by status, date, customer, channel |
| Get order | order | By ID; includes lines, events, fulfillments |
| Order by token | orderByToken | Customer-facing order lookup |
chargeStatus and authorizeStatus before fulfillingorderFulfillmentReturnProducts for returns -- it handles restock and refund in one stepmetadata and privateMetadata fieldsFetch the Saleor order lifecycle documentation for exact mutation inputs, order event types, and fulfillment patterns before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.