# Posted Documents

Read-only feeds of posted sales and purchase invoices, the posted-transaction counterpart of the writable document endpoints. `integrationId` is mirrored from the source order at post time, so you can find a posted document by the store's own key.

## Two line collections: pick by cost

Each posted invoice exposes two selectable line collections; `$expand` whichever you need:

- `salesInvoiceLines`: lightweight posted lines, no tracking, no per-line resolution cost.
- `salesInvoiceTrackingLines`: the same lines plus `serialNumbers` / `lotNumbers` / `packageNumbers`.

## Why tracking is a separate, heavier collection

Serial/lot/package numbers are not a column on the invoice line. They live on the item ledger entries created by the *inventory* posting, which is stamped with the shipment/receipt document, not the invoice, when goods ship and invoice separately. A direct join would miss them, and the only in-database bridge is many-per-entry (it would emit duplicate rows). So a codeunit walks Business Central's item-tracking application chain per line and flattens the result into de-duplicated lists.

> **Caution:** That walk is a lookup **per line**. Only expand `…TrackingLines` when you actually consume serial/lot numbers; otherwise use the lightweight collection.

## Related

- [Posted Sales Invoices](https://eonesolutions.github.io/eone-bc-integration/core-postedSalesInvoices.md) and [Posted Purchase Invoices](https://eonesolutions.github.io/eone-bc-integration/core-postedPurchaseInvoices.md), the feeds themselves.
- [Realtime integrations](https://eonesolutions.github.io/eone-bc-integration/realtime.md): be told when a document posts instead of polling for it.
- [Archiving & cancelling](https://eonesolutions.github.io/eone-bc-integration/archive.md): snapshots of documents that never posted.
