Spree Commerce Orders API

Order management — orders, items, payments, fulfillments, refunds, gift cards, store credits

Operations 47

GET /api/v3/admin/orders/{order_id}/fulfillments List fulfillments
GET /api/v3/admin/orders/{order_id}/fulfillments/{id} Show a shipment
PATCH /api/v3/admin/orders/{order_id}/fulfillments/{id} Update a shipment
PATCH /api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill Fulfill a fulfillment
PATCH /api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel Cancel a fulfillment
PATCH /api/v3/admin/orders/{order_id}/fulfillments/{id}/resume Resume a fulfillment
PATCH /api/v3/admin/orders/{order_id}/fulfillments/{id}/split Split a fulfillment
POST /api/v3/admin/orders/{order_id}/gift_cards Apply a gift card to an order
DELETE /api/v3/admin/orders/{order_id}/gift_cards/{id} Remove a gift card from an order
GET /api/v3/admin/orders/{order_id}/items List order items
POST /api/v3/admin/orders/{order_id}/items Add an item
GET /api/v3/admin/orders/{order_id}/items/{id} Show an item
PATCH /api/v3/admin/orders/{order_id}/items/{id} Update an item
DELETE /api/v3/admin/orders/{order_id}/items/{id} Remove an item
GET /api/v3/admin/orders/{order_id}/payments List payments
POST /api/v3/admin/orders/{order_id}/payments Create a payment
GET /api/v3/admin/orders/{order_id}/payments/{id} Show a payment
PATCH /api/v3/admin/orders/{order_id}/payments/{id}/capture Capture a payment
PATCH /api/v3/admin/orders/{order_id}/payments/{id}/void Void a payment
GET /api/v3/admin/orders/{order_id}/refunds List refunds
POST /api/v3/admin/orders/{order_id}/refunds Create a refund
POST /api/v3/admin/orders/{order_id}/store_credits Apply customer's store credit to an order
DELETE /api/v3/admin/orders/{order_id}/store_credits Remove store credit from an order
GET /api/v3/admin/orders List orders
POST /api/v3/admin/orders Create a draft order
GET /api/v3/admin/orders/{id} Show an order
PATCH /api/v3/admin/orders/{id} Update an order
DELETE /api/v3/admin/orders/{id} Delete a draft order
PATCH /api/v3/admin/orders/{id}/complete Complete an order
PATCH /api/v3/admin/orders/{id}/cancel Cancel an order
PATCH /api/v3/admin/orders/{id}/approve Approve an order
PATCH /api/v3/admin/orders/{id}/resume Resume a canceled order
POST /api/v3/admin/orders/{id}/resend_confirmation Resend confirmation email
GET /api/v2/platform/orders Return a list of Orders #
POST /api/v2/platform/orders Creates an Order #
GET /api/v2/platform/orders/{id} Return an Order #
PATCH /api/v2/platform/orders/{id} Update an Order #
DELETE /api/v2/platform/orders/{id} Delete an Order #
PATCH /api/v2/platform/orders/{id}/advance Advances an Order #
PATCH /api/v2/platform/orders/{id}/next Next an Order #
PATCH /api/v2/platform/orders/{id}/complete Completes an Order #
PATCH /api/v2/platform/orders/{id}/empty Empties an Order #
PATCH /api/v2/platform/orders/{id}/approve Approves an Order #
PATCH /api/v2/platform/orders/{id}/cancel Cancels an Order #
PATCH /api/v2/platform/orders/{id}/use_store_credit Use Store Credit for an Order #
PATCH /api/v2/platform/orders/{id}/apply_coupon_code Apply Coupon Code for an Order #
GET /api/v3/store/orders/{id} Get an order

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/spree-commerce-orders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

spree-commerce-orders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Spree Commerce Orders API
  version: '1.0'
  description: 'Operations tagged Orders across 3 of this provider''s published API definitions: spree-commerce-admin-api-openapi.yml, spree-commerce-platform-api-openapi.yml, spree-commerce-store-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: http://{defaultHost}
  variables:
    defaultHost:
      default: localhost:3000
tags:
- name: Orders
  description: Order management — orders, items, payments, fulfillments, refunds, gift cards, store credits
paths:
  /api/v3/admin/orders/{order_id}/fulfillments:
    get:
      summary: List fulfillments
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Returns all shipments for an order.


        **Required scope:** `read_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst { data: fulfillments } = await client.orders.fulfillments.list('or_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: expand
        in: query
        required: false
        description: Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).
        schema:
          type: string
      - name: fields
        in: query
        required: false
        description: Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.
        schema:
          type: string
      responses:
        '200':
          description: fulfillments found
          content:
            application/json:
              example:
                data:
                - id: ful_UkLWZg9DAJ
                  number: H88303288332
                  tracking: U10000
                  tracking_url: null
                  cost: '10.0'
                  display_cost: $10.00
                  total: '10.0'
                  display_total: $10.00
                  discount_total: '0.0'
                  display_discount_total: $0.00
                  additional_tax_total: '0.0'
                  display_additional_tax_total: $0.00
                  included_tax_total: '0.0'
                  display_included_tax_total: $0.00
                  tax_total: '0.0'
                  display_tax_total: $0.00
                  status: ready
                  fulfillment_type: shipping
                  fulfilled_at: null
                  items:
                  - item_id: li_UkLWZg9DAJ
                    variant_id: variant_UkLWZg9DAJ
                    quantity: 1
                  metadata: {}
                  adjustment_total: '0.0'
                  pre_tax_amount: '0.0'
                  created_at: '2026-05-24T17:37:06.032Z'
                  updated_at: '2026-05-24T17:37:06.286Z'
                  order_id: or_UkLWZg9DAJ
                  stock_location_id: sloc_UkLWZg9DAJ
                meta:
                  page: 1
                  limit: 25
                  count: 1
                  pages: 1
                  from: 1
                  to: 1
                  in: 1
                  previous: null
                  next: null
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/fulfillments/{id}:
    get:
      summary: Show a shipment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Returns details of a specific shipment.


        **Required scope:** `read_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.get('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      - name: expand
        in: query
        required: false
        description: Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).
        schema:
          type: string
      - name: fields
        in: query
        required: false
        description: Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.
        schema:
          type: string
      responses:
        '200':
          description: shipment found
          content:
            application/json:
              example:
                id: ful_UkLWZg9DAJ
                number: H51674325797
                tracking: U10000
                tracking_url: null
                cost: '10.0'
                display_cost: $10.00
                total: '10.0'
                display_total: $10.00
                discount_total: '0.0'
                display_discount_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                status: ready
                fulfillment_type: shipping
                fulfilled_at: null
                items:
                - item_id: li_UkLWZg9DAJ
                  variant_id: variant_UkLWZg9DAJ
                  quantity: 1
                metadata: {}
                adjustment_total: '0.0'
                pre_tax_amount: '0.0'
                created_at: '2026-05-24T17:37:07.105Z'
                updated_at: '2026-05-24T17:37:07.185Z'
                order_id: or_UkLWZg9DAJ
                stock_location_id: sloc_UkLWZg9DAJ
    patch:
      summary: Update a shipment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Updates a shipment (tracking, shipping rate).


        **Required scope:** `write_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.update('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {\n  tracking: '1Z999AA10123456784',\n})"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      responses:
        '200':
          description: shipment updated
          content:
            application/json:
              example:
                id: ful_UkLWZg9DAJ
                number: H16091268662
                tracking: 1Z999AA10123456784
                tracking_url: https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1Z999AA10123456784
                cost: '10.0'
                display_cost: $10.00
                total: '10.0'
                display_total: $10.00
                discount_total: '0.0'
                display_discount_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                status: ready
                fulfillment_type: shipping
                fulfilled_at: null
                items:
                - item_id: li_UkLWZg9DAJ
                  variant_id: variant_UkLWZg9DAJ
                  quantity: 1
                metadata: {}
                adjustment_total: '0.0'
                pre_tax_amount: '0.0'
                created_at: '2026-05-24T17:37:07.854Z'
                updated_at: '2026-05-24T17:37:08.221Z'
                order_id: or_UkLWZg9DAJ
                stock_location_id: sloc_UkLWZg9DAJ
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tracking:
                  type: string
                  example: 1Z999AA10123456784
                selected_shipping_rate_id:
                  type: string
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill:
    patch:
      summary: Fulfill a fulfillment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Marks a fulfillment as fulfilled.


        **Required scope:** `write_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.fulfill('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      responses:
        '200':
          description: fulfillment fulfilled
          content:
            application/json:
              example:
                id: ful_UkLWZg9DAJ
                number: H47615606663
                tracking: U10000
                tracking_url: null
                cost: '10.0'
                display_cost: $10.00
                total: '10.0'
                display_total: $10.00
                discount_total: '0.0'
                display_discount_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                status: shipped
                fulfillment_type: shipping
                fulfilled_at: '2026-05-24T17:37:08Z'
                items:
                - item_id: li_UkLWZg9DAJ
                  variant_id: variant_UkLWZg9DAJ
                  quantity: 1
                metadata: {}
                adjustment_total: '0.0'
                pre_tax_amount: '0.0'
                created_at: '2026-05-24T17:37:08.572Z'
                updated_at: '2026-05-24T17:37:08.932Z'
                order_id: or_UkLWZg9DAJ
                stock_location_id: sloc_UkLWZg9DAJ
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel:
    patch:
      summary: Cancel a fulfillment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Cancels a fulfillment.


        **Required scope:** `write_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.cancel('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      responses:
        '200':
          description: fulfillment canceled
          content:
            application/json:
              example:
                id: ful_UkLWZg9DAJ
                number: H68010739823
                tracking: U10000
                tracking_url: null
                cost: '10.0'
                display_cost: $10.00
                total: '10.0'
                display_total: $10.00
                discount_total: '0.0'
                display_discount_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                status: canceled
                fulfillment_type: shipping
                fulfilled_at: null
                items:
                - item_id: li_UkLWZg9DAJ
                  variant_id: variant_UkLWZg9DAJ
                  quantity: 1
                metadata: {}
                adjustment_total: '0.0'
                pre_tax_amount: '0.0'
                created_at: '2026-05-24T17:37:09.263Z'
                updated_at: '2026-05-24T17:37:09.602Z'
                order_id: or_UkLWZg9DAJ
                stock_location_id: sloc_UkLWZg9DAJ
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/fulfillments/{id}/resume:
    patch:
      summary: Resume a fulfillment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Resumes a canceled fulfillment.


        **Required scope:** `write_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.resume('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      responses:
        '200':
          description: fulfillment resumed
          content:
            application/json:
              example:
                id: ful_UkLWZg9DAJ
                number: H15965565794
                tracking: U10000
                tracking_url: null
                cost: '10.0'
                display_cost: $10.00
                total: '10.0'
                display_total: $10.00
                discount_total: '0.0'
                display_discount_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                status: pending
                fulfillment_type: shipping
                fulfilled_at: null
                items:
                - item_id: li_UkLWZg9DAJ
                  variant_id: variant_UkLWZg9DAJ
                  quantity: 1
                metadata: {}
                adjustment_total: '0.0'
                pre_tax_amount: '0.0'
                created_at: '2026-05-24T17:37:09.918Z'
                updated_at: '2026-05-24T17:37:10.280Z'
                order_id: or_UkLWZg9DAJ
                stock_location_id: sloc_UkLWZg9DAJ
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/fulfillments/{id}/split:
    patch:
      summary: Split a fulfillment
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Transfers items from this shipment to a new shipment at a different stock location.


        **Required scope:** `write_fulfillments` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst fulfillment = await client.orders.fulfillments.split('or_UkLWZg9DAJ', 'ful_UkLWZg9DAJ', {\n  quantity: 1,\n})"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Fulfillment ID
        schema:
          type: string
      responses:
        '200':
          description: fulfillment split
          content:
            application/json:
              example:
                data:
                - id: ful_gbHJdmfrXB
                  number: H74934116654
                  tracking: null
                  tracking_url: null
                  cost: '10.0'
                  display_cost: $10.00
                  total: '10.0'
                  display_total: $10.00
                  discount_total: '0.0'
                  display_discount_total: $0.00
                  additional_tax_total: '0.0'
                  display_additional_tax_total: $0.00
                  included_tax_total: '0.0'
                  display_included_tax_total: $0.00
                  tax_total: '0.0'
                  display_tax_total: $0.00
                  status: ready
                  fulfillment_type: shipping
                  fulfilled_at: null
                  items:
                  - item_id: li_UkLWZg9DAJ
                    variant_id: variant_UkLWZg9DAJ
                    quantity: 1
                  metadata: {}
                  adjustment_total: '0.0'
                  pre_tax_amount: '0.0'
                  created_at: '2026-05-24T17:37:10.976Z'
                  updated_at: '2026-05-24T17:37:11.028Z'
                  order_id: or_UkLWZg9DAJ
                  stock_location_id: sloc_gbHJdmfrXB
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - variant_id
              - quantity
              properties:
                variant_id:
                  type: string
                  description: Variant ID
                quantity:
                  type: integer
                  example: 1
                stock_location_id:
                  type: string
                  description: Target stock location ID
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/gift_cards:
    post:
      summary: Apply a gift card to an order
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Applies a gift card by code to the order. Returns the gift card.


        **Required scope:** `write_gift_cards` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nawait client.orders.giftCards.apply('or_UkLWZg9DAJ', {\n  code: 'GIFT-XXXX-YYYY',\n})"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      responses:
        '201':
          description: gift card applied
          content:
            application/json:
              example:
                id: gc_UkLWZg9DAJ
                code: 0F0327B1613F79BD
                status: active
                currency: USD
                amount: '10.0'
                amount_used: '10.0'
                amount_authorized: '0.0'
                amount_remaining: '0.0'
                display_amount: $10.00
                display_amount_used: $10.00
                display_amount_remaining: $0.00
                expires_at: null
                redeemed_at: null
                expired: false
                active: true
                created_at: '2026-05-24T17:37:11.389Z'
                updated_at: '2026-05-24T17:37:11.722Z'
                customer_id: null
                created_by_id: null
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - code
              properties:
                code:
                  type: string
                  description: Gift card code
                  example: GIFT-XXXX-YYYY
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/gift_cards/{id}:
    delete:
      summary: Remove a gift card from an order
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Removes the gift card from the order.


        **Required scope:** `write_gift_cards` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nawait client.orders.giftCards.remove('or_UkLWZg9DAJ', 'gc_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Gift card ID
        schema:
          type: string
      responses:
        '204':
          description: gift card removed
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/items:
    get:
      summary: List order items
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Returns all line items for an order.


        **Required scope:** `read_orders` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst { data: items } = await client.orders.items.list('or_UkLWZg9DAJ')"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      - name: expand
        in: query
        required: false
        description: Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).
        schema:
          type: string
      - name: fields
        in: query
        required: false
        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:
              example:
                data:
                - id: li_UkLWZg9DAJ
                  variant_id: variant_gbHJdmfrXB
                  quantity: 2
                  currency: USD
                  name: Product 106366
                  slug: product-106366
                  options_text: 'Size: S'
                  price: '10.0'
                  display_price: $10.00
                  total: '20.0'
                  display_total: $20.00
                  adjustment_total: '0.0'
                  display_adjustment_total: $0.00
                  additional_tax_total: '0.0'
                  display_additional_tax_total: $0.00
                  included_tax_total: '0.0'
                  display_included_tax_total: $0.00
                  discount_total: '0.0'
                  display_discount_total: $0.00
                  pre_tax_amount: '20.0'
                  display_pre_tax_amount: $20.00
                  discounted_amount: '20.0'
                  display_discounted_amount: $20.00
                  display_compare_at_amount: $0.00
                  compare_at_amount: null
                  thumbnail_url: null
                  option_values:
                  - id: optval_UkLWZg9DAJ
                    option_type_id: opt_UkLWZg9DAJ
                    name: size-1
                    label: S
                    position: 1
                    color_code: null
                    option_type_name: foo-size-10
                    option_type_label: Size
                    image_url: null
                    metadata: {}
                    created_at: '2026-05-24T17:37:12.441Z'
                    updated_at: '2026-05-24T17:37:12.441Z'
                  digital_links: []
                  metadata: {}
                  created_at: '2026-05-24T17:37:12.736Z'
                  updated_at: '2026-05-24T17:37:12.736Z'
                  cost_price: '17.0'
                  tax_category_id: taxcat_UkLWZg9DAJ
                meta:
                  page: 1
                  limit: 25
                  count: 1
                  pages: 1
                  from: 1
                  to: 1
                  in: 1
                  previous: null
                  next: null
    post:
      summary: Add an item
      tags:
      - Orders
      security:
      - api_key: []
        bearer_auth: []
      description: 'Adds a new line item to the order.


        **Required scope:** `write_orders` (for API-key authentication).'
      x-codeSamples:
      - lang: javascript
        label: Spree Admin SDK
        source: "import { createAdminClient } from '@spree/admin-sdk'\n\nconst client = createAdminClient({\n  baseUrl: 'https://your-store.com',\n  secretKey: 'sk_xxx',\n})\n\nconst item = await client.orders.items.create('or_UkLWZg9DAJ', {\n  variant_id: 'variant_k5nR8xLq',\n  quantity: 2,\n})"
      parameters:
      - name: x-spree-api-key
        in: header
        required: true
        schema:
          type: string
      - name: Authorization
        in: header
        required: true
        description: Bearer token for admin authentication
        schema:
          type: string
      - name: order_id
        in: path
        required: true
        description: Order ID
        schema:
          type: string
      responses:
        '201':
          description: item added
          content:
            application/json:
              example:
                id: li_gbHJdmfrXB
                variant_id: variant_VqXmZF31wY
                quantity: 3
                currency: USD
                name: Product 12521
                slug: product-12521
                options_text: 'Size: S'
                price: '19.99'
                display_price: $19.99
                total: '59.97'
                display_total: $59.97
                adjustment_total: '0.0'
                display_adjustment_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                discount_total: '0.0'
                display_discount_total: $0.00
                pre_tax_amount: '59.97'
                display_pre_tax_amount: $59.97
                discounted_amount: '59.97'
                display_discounted_amount: $59.97
                display_compare_at_amount: $0.00
                compare_at_amount: null
                thumbnail_url: null
                option_values:
                - id: optval_gbHJdmfrXB
                  option_type_id: opt_gbHJdmfrXB
                  name: size-3
                  label: S
                  position: 1
                  color_code: null
                  option_type_name: foo-size-12
                  option_type_label: Size
                  image_url: null
                  metadata: {}
                  created_at: '2026-05-24T17:37:13.688Z'
                  updated_at: '2026-05-24T17:37:13.688Z'
                digital_links: []
                metadata: {}
                created_at: '2026-05-24T17:37:13.721Z'
                updated_at: '2026-05-24T17:37:13.721Z'
                cost_price: '17.0'
                tax_category_id: taxcat_UkLWZg9DAJ
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - variant_id
              properties:
                variant_id:
                  type: string
                  description: Prefixed variant ID
                quantity:
                  type: integer
                  default: 1
    servers:
    - url: http://{defaultHost}
      variables:
        defaultHost:
          default: localhost:3000
  /api/v3/admin/orders/{order_id}/items/

# --- truncated at 32 KB (211 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/spree-commerce/refs/heads/main/openapi/spree-commerce-orders-api-openapi.yml