# PATCH /inventory/purchase-orders/:purchase_order_id

**Resource:** [INVENTORY](./inventory.md)  
**MCP tool:** `update_purchase_order`  
**Scopes:** `purchase_orders:write`  
**Write operation:** yes

Change a purchase order: mark it sent (status "sent"), cancel it (status "cancelled", anything already received stays in stock), or change the supplier, delivery location, expected date, reference or notes. A received or cancelled order cannot be changed.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `purchase_order_id` | path | string | yes | The purchase order (its UUID). |
| `status` | body | string | no | "sent" once it has gone to the supplier; "cancelled" to stop waiting for it (anything already received stays in stock). Received statuses are set by receive_purchase_order. |
| `supplier_id` | body | string | no | Change the supplier (company UUID). |
| `supplier_name` | body | string | no | Change the supplier name. |
| `location_id` | body | string | no | Change where the delivery goes. |
| `expected_date` | body | string | no | Change the expected delivery date (YYYY-MM-DD). |
| `reference` | body | string | no | Change the supplier reference. |
| `notes` | body | string | no | Change the notes. |
| `opportunity_id` | body | string | no | The job this order buys for: an opportunity (UUID, from list_opportunities); an empty string unlinks it. Its lines then count as actual cost in the job costing of that opportunity (get_job_costing). |
| `work_order_id` | body | string | no | The work order this order buys for (UUID); an empty string unlinks it. Its opportunity becomes the job when opportunity_id is not sent. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/inventory/purchase-orders/:purchase_order_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"status":"...","supplier_id":"...","supplier_name":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`