# invoices.update

Edit a draft, scheduled, or awaiting-approval invoice with its expectedRevision. Editing an approved invoice returns it for approval. Issued invoices can't be edited; void and duplicate them instead. Their memo and project (projectId) can still change.

`POST /api/v1/accounting/invoices.update`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required · Send `expectedRevision`

MCP tool: `accounting_invoices_update`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | string (ID) | Yes | The record's ID. |
| `expectedRevision` | integer | Yes | The record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again. at most 9007199254740991; greater than 0. |
| `partyId` | string (ID) |  | The ID of a customer or vendor account, from parties.list. |
| `title` | string |  | A short title. at most 200 characters. |
| `issueDate` | string or null |  | The date the document was issued, as YYYY-MM-DD. |
| `dueDate` | string or null |  | The date payment is due, as YYYY-MM-DD. |
| `currency` | string |  | Three-letter currency code, such as CAD or USD. |
| `lines` | array of objects |  | at most 100 items. |
| `lines[].id` | string |  | The record's ID. at most 64 characters. |
| `lines[].description` | string | Yes | A short description. 1–500 characters. |
| `lines[].quantity` | string |  |  |
| `lines[].unitAmountMinor` | string |  | An amount in cents (the currency's smallest unit), written as a whole-number string such as "1250" for $12.50. Whole number written as a string, may be negative. |
| `lines[].isHeader` | boolean |  |  |
| `lines[].taxCode` | enum |  | One of: `standard`, `exempt`, `zero_rated`. |
| `taxTreatment` | enum or null |  | One of: `auto`, `hst`, `gst`, `gst_qst`, `zero_rated`, `exempt`, `none`, `custom`. |
| `taxRateCode` | enum or string or null |  |  |
| `paymentMethodIds` | array of strings (ID) |  | A list of record IDs. at most 10 items. |
| `payUrl` | string (uri) or null |  |  |
| `notes` | string |  | Notes kept with the record. at most 4000 characters. |
| `memo` | string |  | at most 4000 characters. |
| `terms` | object |  | No other fields. |
| `terms.code` | enum | Yes | One of: `due_on_receipt`, `net_7`, `net_15`, `net_30`, `net_45`, `net_60`, `custom`, `split_50_50`, `monthly`. |
| `terms.days` | integer or null |  |  |
| `billToContactId` | string or null |  |  |
| `projectId` | string (ID) or null |  |  |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/invoices.update \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "expectedRevision": 3
}'
```

Reference page: https://app.getoatmilk.com/docs/api/invoices.update
