> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete an order

> Completes an order in the `confirm` state, marking it as placed.

Set `notify_customer: true` to send the order confirmation email.


**Required scope:** `write_orders` (for API-key authentication).



## OpenAPI

````yaml /api-reference/admin.yaml patch /api/v3/admin/orders/{id}/complete
openapi: 3.0.3
info:
  title: Admin API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: >
    Spree Admin API v3 - Administrative API for managing products, orders, and
    store settings.


    ## Authentication


    The Admin API requires a secret API key passed in the `x-spree-api-key`
    header.

    Secret API keys can be generated in the Spree admin dashboard.


    ## Response Format


    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.

    Single resource endpoints return a flat JSON object.


    ## Resource IDs


    Every resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,

    `variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,

    request bodies, and Ransack filters all accept them directly.


    ## Error Handling


    Errors return a consistent format:

    ```json

    {
      "error": {
        "code": "validation_error",
        "message": "Validation failed",
        "details": { "name": ["can't be blank"] }
      }
    }

    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Admin user authentication
  - name: Product Catalog
    description: Products, variants, and option types
  - name: Orders
    description: >-
      Order management — orders, items, payments, fulfillments, refunds, gift
      cards, store credits
  - name: Customers
    description: Customer management — profiles, addresses, store credits, credit cards
  - name: Configuration
    description: Store configuration — payment methods, tag autocomplete
paths:
  /api/v3/admin/orders/{id}/complete:
    patch:
      tags:
        - Orders
      summary: Complete an order
      description: |-
        Completes an order in the `confirm` state, marking it as placed.

        Set `notify_customer: true` to send the order confirmation email.


        **Required scope:** `write_orders` (for API-key authentication).
      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: id
          in: path
          required: true
          description: Order ID
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                notify_customer:
                  type: boolean
                  description: Send the order confirmation email after completion.
      responses:
        '200':
          description: order completed
          content:
            application/json:
              example:
                id: or_UkLWZg9DAJ
                market_id: null
                channel_id: ch_UkLWZg9DAJ
                number: R016462732
                email: dexter@lednerbarton.us
                customer_note: null
                currency: USD
                locale: en
                total_quantity: 1
                item_total: '10.0'
                display_item_total: $10.00
                adjustment_total: '0.0'
                display_adjustment_total: $0.00
                discount_total: '0.0'
                display_discount_total: $0.00
                tax_total: '0.0'
                display_tax_total: $0.00
                included_tax_total: '0.0'
                display_included_tax_total: $0.00
                additional_tax_total: '0.0'
                display_additional_tax_total: $0.00
                total: '110.0'
                display_total: $110.00
                gift_card_total: '0.0'
                display_gift_card_total: $0.00
                amount_due: '0.0'
                display_amount_due: $0.00
                delivery_total: '100.0'
                display_delivery_total: $100.00
                fulfillment_status: ready
                payment_status: paid
                completed_at: '2026-05-17T22:58:06.625Z'
                store_credit_total: '0.0'
                display_store_credit_total: $0.00
                covered_by_store_credit: false
                gift_card: null
                market: null
                status: draft
                last_ip_address: null
                considered_risky: false
                confirmation_delivered: false
                store_owner_notification_delivered: null
                payment_total: '110.0'
                display_payment_total: $110.00
                metadata: {}
                canceled_at: null
                approved_at: null
                created_at: '2026-05-17T22:58:06.570Z'
                updated_at: '2026-05-17T22:58:06.651Z'
                preferred_stock_location_id: null
                tags: []
                internal_note: null
                approver_id: null
                canceler_id: null
                created_by_id: null
                customer_id: cus_UkLWZg9DAJ
        '422':
          description: order cannot be completed
          content:
            application/json:
              example:
                error:
                  code: order_cannot_complete
                  message: No payment found
                  details:
                    base:
                      - No payment found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key: []
          bearer_auth: []
      x-codeSamples:
        - lang: javascript
          label: Spree Admin SDK
          source: |-
            import { createAdminClient } from '@spree/admin-sdk'

            const client = createAdminClient({
              baseUrl: 'https://your-store.com',
              secretKey: 'sk_xxx',
            })

            const order = await client.orders.complete('or_UkLWZg9DAJ', {
              notify_customer: true,
            })
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: record_not_found
            message:
              type: string
              example: Record not found
            details:
              type: object
              description: Field-specific validation errors
              nullable: true
              example:
                name:
                  - is too short
                  - is required
                email:
                  - is invalid
          required:
            - code
            - message
      required:
        - error
      example:
        error:
          code: validation_error
          message: Validation failed
          details:
            name:
              - is too short
            email:
              - is invalid
  securitySchemes:
    api_key:
      type: apiKey
      name: x-spree-api-key
      in: header
      description: Secret API key for admin access
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for admin user authentication

````