# Record Notes

`GET` `POST` `PATCH` `DELETE` _(Table: Record Link)_

```
eOne/core/v1.0/notes
```

Attach a free-text note to almost any record. It writes to Business Central's standard **Record Link** table as a note (`Type = Note`), so the note shows up in the Notes factbox on the record and flows to posted documents like any manually added note.

## Identify the parent record

Send a `parentType` (the kind of record) plus one of two keys:

- [integrationId](https://eonesolutions.github.io/eone-bc-integration/integration-id.md) (the eOne external key already stamped on the record)
- `parentNumber` (the Business Central number). The `integrationId` takes precedence if you send both.

> **Tip:** For open sales/purchase documents, `parentType` also carries the document type (e.g. `salesOrder` vs `salesInvoice`) so it lands on the right document.

Staged [ledger documents](https://eonesolutions.github.io/eone-bc-integration/core-customerPayments.md) and [expenses](https://eonesolutions.github.io/eone-bc-integration/core-expenses.md) can be noted as well, under `stagedLedgerDocument` and `stagedExpense`. Note them by [integrationId](https://eonesolutions.github.io/eone-bc-integration/integration-id.md): these documents have no Business Central number, so `parentNumber` is their entry no., and the entry no. changes when the document is processed while the `integrationId` does not.

## Write the note

Put the text in `note`. That plus `parentType` and a key is all a create needs.

`POST` `/notes`

```
{
  "parentType": "salesOrder",
  "integrationId": "SHOPIFY-1001",
  "note": "Customer asked to hold shipment until 5 Jul."
}
```

## Editable: PATCH the text in place

Unlike [attachments](https://eonesolutions.github.io/eone-bc-integration/core-documentAttachments.md) (which are immutable), a note is editable. `PATCH /notes(<id>)` with a new `note` value overwrites the text of that note in place.

## Notes on a staged document follow it into history

Processing a staged document replaces it with a [processed document](https://eonesolutions.github.io/eone-bc-integration/core-processedDocuments.md). Its notes move across with its attachments, keeping their own `id`, so `GET /notes(<id>)` still returns the text afterwards and reports `parentType` `processedLedgerDocument` or `processedExpense` against the same `integrationId`. Discarding a staged document deletes its notes, and deleting a processed document, or ageing one out under a retention policy, deletes the notes that came to rest on it.

## Reading notes back

GET returns the `note` text plus the resolved `parentType`, `integrationId`, and `parentNumber`, and the audit fields `createdDateTime` / `createdBy`.

> **Caution:** Notes are **not** exposed as an `$expand` child of the parent record. Business Central stores a note's parent as an internal record reference with no external column to link on, so there is no per-parent server-side filter. `parentType` / `integrationId` are resolved per row for display, not queryable with `$filter`. Fetch a single note by `id`. This endpoint is primarily for **writing** notes onto records; to see them, open the record's Notes factbox in Business Central.

## Record Notes fields

_API column → BC field._

**Legend**

- _(req)_ required on create
- _(res)_ resolver
- _(cur)_ currency-translated
- _(ro)_ read-only
- _(ext)_ added to this endpoint by another extension (BC field name shown; its API column name is not known here)

| API | BC field | Notes |
| --- | --- | --- |
| `id` | SystemId | BC record GUID. _(ro)_ |
| `bcCompanyId` | bcCompanyId | The company this row belongs to - the same GUID that appears in the request URL. Present on every endpoint so a store pooling several companies can keep them apart without relying on which URL it called. _(ro)_ |
| `bcCompanyName` | bcCompanyName | The name of the company this row belongs to. _(ro)_ |
| `parentType` | parentType | Kind of record the note is on (camelCase: customer, item, salesOrder, postedSalesInvoice, stagedExpense, …); maps to the BC Table ID and, for documents, the document type. Notes on a staged document move to its processed document when it is processed. Set on create. _(req)_ |
| `integrationId` | integrationId | External key of the record to note; found by its EONEIntegrationKey. One of integrationId / parentNumber; wins if both sent. Set on create; echoed on read. |
| `parentNumber` | parentNumber | BC number of the record to note. Alternative to integrationId. Set on create; echoed on read. |
| `note` | note | The note text. Required on create; PATCH overwrites it in place. _(req)_ |
| `createdDateTime` | Created | When the note was created. _(ro)_ |
| `createdBy` | User ID | User that created the note. _(ro)_ |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |
