# Change a coverage

Canonical page: https://docs.ovok.com/api/patient-billing/change-a-coverage

`PATCH /v1/patient-billing/coverages/{coverageId}`

Changes a coverage's insurer, member number, period or order. Fields left out stay as they are; its kind never changes, so remove it and add another instead.

**Scope:** the caller's project, with `PATIENT_BILLING_ENABLED` on.

## Behaviour

- Your access policy must grant `patient_billing_coverages` `update` and let you update the coverage's patient, else **403** `PATIENT_BILLING_NOT_ALLOWED`. A coverage you cannot see answers **404** `COVERAGE_NOT_FOUND`.
- The coverage is checked again as a whole, with the same rules and errors as adding one.
- `period: null` makes the coverage open-ended. `order` moves it; the others are renumbered in the same transaction.
- Changes to one patient's coverages run one at a time: another still running answers **409**; send yours again.
- `If-Match: W/"<version>"` is optional. With it, the change lands only on that version, else **412** `COVERAGE_VERSION_MISMATCH`.

## Example

```bash
curl -X PATCH 'https://api.sandbox.ovok.com/v1/patient-billing/coverages/<coverageId>' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'If-Match: W/"2"' \
  -H 'Content-Type: application/json' \
  -d '{ "order": 1 }'
```
