# notion.invoices.import

Link existing Notion invoice rows to Oatmilk invoices. Status differences become suggestions for review; nothing is overwritten. Supply selections of pageId and invoiceId, plus idempotencyKey.

`POST /api/v1/accounting/notion.invoices.import`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required · Reaches outside Oatmilk (email or a provider)

MCP tool: `accounting_notion_invoices_import`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `selections` | array of objects | Yes | 1–100 items. |
| `selections[].pageId` | string | Yes | 32–36 characters. |
| `selections[].invoiceId` | string (ID) | Yes | The ID of the related record. |
| `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/notion.invoices.import \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "selections": [
    {
      "pageId": "9f2b5c1d7e3a4b6c8d0e2f4a6b8c0d2e",
      "invoiceId": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a"
    }
  ]
}'
```

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