Skip to content

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.

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