# tax.treatment.apply

Confirm a whole group of records at once for { period, code, entryIds, idempotencyKey }: each record listed that is still in the group gets the treatment Oatmilk suggests for that reason (for example no tax credit for purchases without a receipt), saved as a tax review in the caller's name and marked as confirmed together. Records that changed or are no longer in the group are skipped and reported. The closed-period and revision guards still apply.

`POST /api/v1/accounting/tax.treatment.apply`

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

Not available over MCP: Accountants' corrections grant isn't offered over MCP yet: phase 1 is read and comment only.

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `period` | object | Yes | The period to cover. No other fields. |
| `period.from` | string | Yes | The first date to include, as YYYY-MM-DD. |
| `period.to` | string | Yes | The last date to include, as YYYY-MM-DD. |
| `period.kind` | enum | Yes | Which kind of record or job this is. One of: `corporate`, `gst_hst`. |
| `code` | enum | Yes | One of: `bank_fee`, `exempt_category`, `interest`, `contractor`, `receipt_no_tax`, `receipt_tax`, `foreign_vendor`, `same_as_before`, `small_no_receipt`, `no_receipt`, `receipt_unread`, `recorded_tax`, `recorded_sale_tax`, `sale_no_tax`. |
| `entryIds` | array of strings (ID) | Yes | IDs of accounting entries, from entries.list or attention.mine. 1–1000 items. |
| `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/tax.treatment.apply \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "period": {
    "from": "2026-09-01",
    "to": "2026-09-30",
    "kind": "corporate"
  },
  "code": "bank_fee",
  "entryIds": [
    "7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10"
  ]
}'
```

Reference page: https://app.getoatmilk.com/docs/api/tax.treatment.apply
