Updates the audit lines. The audit's date, storage location and type do not change.

```
v1/audits/edit.php
```

## Parameters

| Field | Type | Required | Description |
|---|---|---|---|
| audit_id | int | Yes | Audit ID |
| materials | array | No | Material audit lines: id or sku, actual, notes |
| products | array | No | Product audit lines: id or sku, actual, notes |

Lines are passed as in [v1/audits/add](https://developers.controlata.com/hc/api-docs/articles/api-audits-add), and only in the array of the type the audit counts. Lines are replaced as a whole.

## Example request

```
{
    "audit_id": 1699,
    "materials": [
        {
            "id": 2051,
            "actual": 4
        },
        {
            "sku": "M022",
            "actual": 0,
            "notes": "Not found at the storage location"
        }
    ]
}
```

## Example response

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

## Errors

| Error | Reason |
|---|---|
| No audit_id in input | audit_id is missing |
| Audit not found or access denied | Audit not found or deleted |
| This audit counts materials. Its type cannot be changed | Lines were passed in the array of the other type (for products: This audit counts products) |
| An audit counts either materials or products. Create separate audits | Both materials and products were passed |
| No products or materials in input | The line arrays were passed but empty |
| Material with id 2051 not found | Material not found or deleted |
| Actual must be 0 or greater for material with id 2051 | actual is missing, not a number or below 0 |
| Material with id 2051 is listed twice | The item is listed in two lines |

Other line errors are the same as in [v1/audits/add](https://developers.controlata.com/hc/api-docs/articles/api-audits-add).
