Postman collection
Invoices Read

pixiGetUpdatedInvoices

Returns the invoices that were created or changed (including changes to their invoice lines) after a given point in time, with optional paging and payment filter.

Use this call for delta synchronisation of invoices.

  1. If Since is not passed, the start of the current day (00:00) is used. An empty PaymentType is treated like NULL.
  2. Candidates are collected from three sources, each restricted to an InvoiceKey greater than OffSet:
    • invoices whose CreateDate is later than Since,
    • invoices whose UpdateDate is later than Since,
    • invoice lines (Invlines) whose UpdateDate is later than Since; the invoice they belong to is the candidate.
  3. The candidates are grouped per invoice. UpdateDate in the result is the latest of the matching timestamps.
  4. If PaymentType is set, only invoices with this payment code are kept.
  5. The list is sorted by InvoiceKey ascending and limited to Rows invoices (0 = no limit).
  6. For every remaining invoice the call returns key, invoice number, change date, shop (CustomerOf of the customer) and payment code with payment text, sorted by InvoiceKey.

Paging: pass the highest InvoiceKey of the previous page as OffSet with the same Since to fetch the next page.

Notes

  • All tables are read WITH (NOLOCK); uncommitted changes may be visible.
  • The comparison with Since is strict (>); records changed exactly at Since are not returned.
  • UpdateDate only reflects timestamps later than Since, so it is the latest change within the requested window.
  • The Rows limit (via SET ROWCOUNT) is applied before the joins to Customers and Payments. Invoices without a matching customer or payment code are dropped afterwards, so a page can contain fewer than Rows rows even if more data exists. Always continue paging with the highest InvoiceKey returned until no rows come back.
  • Only the final select is wrapped in error handling; on an unexpected error a status row is returned and the procedure returns 3, otherwise 0.
  • Temporary tables are cleaned up with util.TempTableDrop (definition not attached).

Tables used

Invoices · Read Invlines · Read Customers · Read Payments · Read
SQL object:
dbo.pipiGetUpdatedInvoices
Updated at 2026-10-30