# Update a production order (/docs/api-reference/production-orders/ProductionOrdersController_update)

`PATCH /api/factories/{factoryId}/production-orders/{id}`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory ID |
| `id` | path | yes | string | Production Order ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "methodId": {
      "type": "string",
      "description": "Production method ID"
    },
    "quantityTarget": {
      "type": "number",
      "description": "Target quantity. Must be positive. Accepts decimals for measure-unit products (kg, L, m); integer for count-based products.",
      "example": 1000
    },
    "plannedStart": {
      "type": "string",
      "description": "Planned start date"
    },
    "plannedEnd": {
      "type": "string",
      "description": "Planned end date"
    },
    "shipDate": {
      "type": "string",
      "description": "Customer ship date"
    },
    "batchNumber": {
      "type": "string",
      "description": "Customer batch identifier (free text). Empty string clears it.",
      "example": "M062026-UBH"
    },
    "priority": {
      "type": "string",
      "description": "Order priority",
      "enum": [
        "standard",
        "rush"
      ],
      "example": "standard"
    }
  }
}
```

## Responses

### 200: Production order updated

### 404: Production order not found