# invoices.filesCommit

Import reviewed invoice files with their original numbers, dates, lines, taxes, and status. Paid imports record a matching payment and PDFs become the invoice's permanent file. Nothing is emailed.

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

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

MCP tool: `accounting_invoices_files_commit`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `items` | array of objects | Yes | 1–50 items. |
| `items[].sha256` | string | Yes | The SHA-256 hash of the file's exact bytes, as 64 lowercase hex characters. SHA-256 hash as 64 lowercase hex characters. |
| `items[].filename` | string | Yes | The file's name, including its extension. 1–200 characters. |
| `items[].mimeType` | string | Yes | The file's type, such as image/jpeg or application/pdf. at most 150 characters. |
| `items[].partyId` | string (ID) |  | The ID of a customer or vendor account, from parties.list. |
| `items[].newPartyName` | string |  | 1–200 characters. |
| `items[].number` | string | Yes | 1–60 characters. |
| `items[].issueDate` | string | Yes | The date the document was issued, as YYYY-MM-DD. |
| `items[].dueDate` | string |  | The date payment is due, as YYYY-MM-DD. |
| `items[].currency` | string |  | Three-letter currency code, such as CAD or USD. |
| `items[].title` | string |  | A short title. at most 200 characters. |
| `items[].notes` | string |  | Notes kept with the record. at most 4000 characters. |
| `items[].lines` | array of objects | Yes | 1–100 items. |
| `items[].lines[].id` | string |  | The record's ID. at most 64 characters. |
| `items[].lines[].description` | string | Yes | A short description. 1–500 characters. |
| `items[].lines[].quantity` | string |  |  |
| `items[].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. |
| `items[].lines[].isHeader` | boolean |  |  |
| `items[].lines[].taxCode` | enum |  | One of: `standard`, `exempt`, `zero_rated`. |
| `items[].taxes` | array of objects |  | at most 5 items. |
| `items[].taxes[].label` | string | Yes | 1–80 characters. |
| `items[].taxes[].rate` | string |  | Matches ^\d{1,3}(?:\.\d{1,4})?$. Default `"0"`. |
| `items[].taxes[].amountMinor` | string | Yes | An amount in cents (the currency's smallest unit), written as a whole-number string such as "1250" for $12.50. Matches ^\d{1,18}$. |
| `items[].status` | enum |  | Only include records with this status. One of: `sent`, `paid`, `void`. Default `"sent"`. |
| `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.filesCommit \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "items": [
    {
      "sha256": "9f2b5c1d7e3a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b4c",
      "filename": "receipt.pdf",
      "mimeType": "example",
      "number": "example",
      "issueDate": "2026-09-30",
      "lines": [
        {
          "description": "Synthetic example from the docs",
          "unitAmountMinor": "1250"
        }
      ],
      "partyId": "7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10"
    }
  ]
}'
```

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