Changes the sale status. The status determines whether the sale's products and materials are deducted from stock.

```
v1/orders/update_status.php
```

## Parameters

| Field | Type | Required | Description |
|---|---|---|---|
| order_id | int | Yes | Sale ID |
| status | int | Yes | New status: **0** — New, **1** — Packed, **3** — Shipped, **4** — Canceled |
| date_shipped | string | No | Shipping date. Used when moving to the Shipped status |

The **Partially shipped** status (2) cannot be set via the API: it appears when part of the sale is shipped in the Controlata interface.

date_shipped is used when moving to **Shipped**: it is written to the sale and the deduction is dated to it. In other statuses date_shipped is ignored.

## Example request

```
{
    "order_id": 43727,
    "status": 3,
    "date_shipped": "2026-10-08"
}
```

## Example response

```
{
    "success": true
}
```

## Errors

| Error | Reason |
|---|---|
| No order_id in input | A required field is missing (instead of order_id, the field's name) |
| Invalid status value. Must be one of: 0, 1, 3, 4 | Invalid status, including 2 |
| Order not found or access denied | Sale not found or deleted |
| Date is not a valid date in format YYYY-MM-DD | Invalid date_shipped |
