Postman collection
Invoices Read

pixiReadInvlines

Returns invoice lines, either one line by key or a list filtered by creation and/or update date, with key-based paging.

Reads invoice lines from Invlines. Each line is joined to its invoice (Invoices) and to the invoice currency (pixi.Currency). Only one filter mode is used. The procedure checks the modes in this order:

  1. Create or update date: CreateAndUpdateDateFrom or CreateAndUpdateDateTo is set. A line matches if CreateDate or UpdateDate is >= the from value, and CreateDate or UpdateDate is < the to value.
  2. Create date: CreateDateFrom or CreateDateTo is set. Filters on CreateDate (from inclusive, to exclusive).
  3. Update date: UpdateDateFrom or UpdateDateTo is set. Filters on UpdateDate (from inclusive, to exclusive).
  4. Key range: RowCount is passed (any non-NULL value). Returns all lines with InvLineKey greater than InvlineKey.
  5. Single key: none of the above applies. Returns the line whose InvLineKey equals InvlineKey.

In modes 1–4 only lines with InvLineKey > InvlineKey are returned, sorted by InvLineKey ascending. InvlineKey defaults to 0, so all keys qualify by default.

A non-zero RowCount limits the number of rows (SET ROWCOUNT). This enables paging: pass the last InvLineKey received as InvlineKey in the next call.

Notes

  • All reads use NOLOCK. Uncommitted data can be returned.
  • Lines are returned only if their invoice exists and the invoice's CurrencyId resolves to a currency (inner joins).
  • Calling without any parameters returns no rows: InvlineKey becomes 0 and the single-key mode looks for key 0.
  • Passing RowCount = 0 switches to key-range mode without a row limit. This returns all invoice lines above InvlineKey.
  • Date filter modes exclude each other. For example, when CreateAndUpdateDate* is set, the CreateDate* and UpdateDate* parameters are ignored.
  • In the combined date mode, from and to are checked independently against either date. A line can therefore match even if neither date lies within the range.
  • ItemPrice_OrderCurr and ShipCost_OrderCurr are copies of ItemPrice and ShipCost. Code comments mark them for removal, so new integrations should not rely on them.
  • The final fallback branch of the code (empty result) can never be reached, because InvlineKey is never NULL at that point.

Tables used

Invoices · Read Currency · Read Invlines · Read
SQL object:
dbo.pipiReadInvlines
Updated at 2026-10-30