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

# Update Work Order

> This endpoint updates an existing work order.

### Body

<ParamField body="id" type="string">
  This is the id of the work order you want to update.
</ParamField>

### Response

<ResponseField name="bill_of_materials_number" type="string">
  Number associated with the bill of materials related to the work order
</ResponseField>

<ResponseField name="created_at" type="string">
  Date and time when the work order was created
</ResponseField>

<ResponseField name="created_by" type="string">
  Name or identifier of the person who created the work order
</ResponseField>

<ResponseField name="expected_completion_date" type="string">
  Expected completion date for the work order
</ResponseField>

<ResponseField name="id" type="string">
  Unique identifier for the work order
</ResponseField>

<ResponseField name="issue_date" type="string">
  Date when the work order was issued
</ResponseField>

<ResponseField name="location" type="string">
  Location or site where the work order is applicable
</ResponseField>

<ResponseField name="manufacture_order" type="string">
  Identifier or reference to the manufacturing order associated with the work order
</ResponseField>

<ResponseField name="memo" type="string">
  Memo or additional notes related to the work order
</ResponseField>

<ResponseField name="number" type="string">
  Number associated with the work order
</ResponseField>

<ResponseField name="order_number" type="string">
  Identifier or reference to the order associated with the work order
</ResponseField>

<ResponseField name="part" type="string">
  Part or item associated with the work order
</ResponseField>

<ResponseField name="priority" type="string">
  Priority level or urgency of the work order
</ResponseField>

<ResponseField name="site" type="string">
  Site or location where the work order is being executed
</ResponseField>

<ResponseField name="status" type="string">
  Current status or state of the work order
</ResponseField>

<ResponseField name="updated_at" type="string">
  Date and time when the work order was last updated
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/work_order' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "wo_ODkRWQtx9NVsRX",
      "work_order": {
          "bill_of_materials_number": "123",
          "created_at": "2021-01-01T00:00:00.000Z",
          "created_by": "John Doe",
          "expected_completion_date": "2021-01-01T00:00:00.000Z",
          "id": "wo_123",
          "issue_date": "2021-01-01T00:00:00.000Z",
          "location": "123",
          "manufacture_order": "123",
          "memo": "123",
          "number": "123",
          "order_number": "123",
          "part": "123",
          "priority": "123",
          "site": "123",
          "status": "123",
          "updated_at": "2021-01-01T00:00:00.000Z",
          "work_order_line_items": [
              {
                  "id": "wo_123",
                  "line_status": "123",
                  "line_type": "123",
                  "part_name": "123",
                  "part_number": "123",
                  "total_quantity": "123",
                  "unit_quantity": "123",
                  "work_order_number": "123"
              }
          ]
      }
  }'
  ```

  ```graphQL GraphQL theme={null}

      mutation (
        $id: String
        $work_order: work_orders_set_input!
      ) {
        update_work_orders (
          where: { id: { _eq: $id } }
          _set: $work_order
        ) {
          returning {
            id
          }
        }
      }
  ```

  ```javascript Node.js theme={null}

  const updated = await stateset.workorders.update(
    'wo_ODkRWQtx9NVsRX'
  );

  ```

  ```python Python theme={null}

  updated = stateset.workorders.modify(
    'wo_ODkRWQtx9NVsRX'
  )

  ```

  ```ruby Ruby theme={null}

  updated = Stateset::Workorders.update(
    'wo_ODkRWQtx9NVsRX'
  )

  ```

  ```php PHP theme={null}

  $updated = $stateset->workorders->update(
    'wo_ODkRWQtx9NVsRX'
  );

  ```

  ```go Go theme={null}

  WorkOrder, err := stateset.WorkOrders.Update(
    "wo_ODkRWQtx9NVsRX"
  )

  ```

  ```java Java theme={null}

  WorkOrder workOrder = stateset.workOrders.update(
    "wo_ODkRWQtx9NVsRX"
  );

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    {
      "bill_of_materials_number": "123",
      "created_at": "2021-01-01T00:00:00.000Z",
      "created_by": "John Doe",
      "expected_completion_date": "2021-01-01T00:00:00.000Z",
      "id": "wo_123",
      "issue_date": "2021-01-01T00:00:00.000Z",
      "location": "123",
      "manufacture_order": "123",
      "memo": "123",
      "number": "123",
      "order_number": "123",
      "part": "123",
      "priority": "123",
      "site": "123",
      "status": "123",
      "updated_at": "2021-01-01T00:00:00.000Z",
      "work_order_line_items": [
        {
          "id": "wo_123",
          "line_status": "123",
          "line_type": "123",
          "part_name": "123",
          "part_number": "123",
          "total_quantity": "123",
          "unit_quantity": "123",
          "work_order_number": "123"
        }
      ]
    }
  }
  ```
</ResponseExample>
