---
title: "Replace a order (full update)"
method: PUT
path: "/api/v1/orders/{id}"
tags: ["Orders"]
---

# Replace a order (full update)

`PUT /api/v1/orders/{id}`

Full replacement — all required fields must be supplied. Missing optional fields revert to defaults.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `user_id` string, uuid — ID of the user placing the order
  - `product_id` string, uuid — ID of the product being ordered
  - `quantity` integer — Quantity ordered
  - `status` 'pending' | 'processing' | 'completed' | 'cancelled' — Order status
  - `notes` string — Optional order notes

## Response `200`

Default Response

- object
  - `success` boolean
  - `data` object
    - `id` string, uuid
    - `user_id` string, uuid, nullable
    - `product_id` string, uuid, nullable
    - `quantity` integer
    - `status` 'pending' | 'processing' | 'completed' | 'cancelled'
    - `notes` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `user` object, nullable — Populated when ?expand=user
      - `id` string, uuid
      - `name` string
      - `email` string, email
      - `role` 'user' | 'admin' | 'moderator'
      - `age` integer, nullable
      - `created_at` string, date-time
      - `updated_at` string, date-time
    - `product` object, nullable — Populated when ?expand=product
      - `id` string, uuid
      - `name` string
      - `price` number
      - `description` string
      - `stock` integer
      - `category` string
      - `created_at` string, date-time
      - `updated_at` string, date-time

## Other responses

- `400` — Validation failed
- `404` — Record not found

---

[API](https://skmtc.net/totalshiftleft/apis/api-learning-sandbox.md) · [All operations](https://skmtc.net/totalshiftleft/apis/api-learning-sandbox/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/totalshiftleft/api-learning-sandbox/revisions/3b3179c504b0/schema)
