# Change a charge

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

`PATCH /v1/patient-billing/charges/{chargeId}`

Changes a charge that is not billed yet: its status, its quantity or its price. Fields left out stay as they are.

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

## Behaviour

- Your access policy must grant `patient_billing_charges` `update` and let you read the charge's patient, else **403** `PATIENT_BILLING_NOT_ALLOWED`. A charge you cannot see answers **404** `CHARGE_NOT_FOUND`.
- `status` is `billable`, `not-billable` (not to be billed) or `entered-in-error`. A billed charge no longer changes: **409** `CHARGE_BILLED`.
- `priceOverride` sets the unit price and needs an `overrideReason`; `priceOverride: null` returns the charge to the price list, as it applies on the day of the service, else **422** `CHARGE_PRICE_MISSING`.
- Changes to one patient's charges 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** `CHARGE_VERSION_MISMATCH`.

## Example

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