Postman collection
Returns Read

pixiGetReturns

Returns a paged list of returns (Retouren) modified within a date range, optionally filtered by status and invoice number, including the related credit note.

Reads returns from the pixi.Return table and returns one row per return.

Filters

  • StatusId: only returns with this status ID. NULL returns all statuses.
  • InvoiceNr: the invoice number is first resolved to its invoice key. Only returns of that invoice are listed.
  • ChangeDateFrom / ChangeDateTo: the return's RecordModifiedOn must lie between both values, inclusive.
    • If ChangeDateFrom is NULL, the range starts at 00:00 on the same day one month ago.
    • If ChangeDateTo is NULL, the range ends at the end of today (23:59:59.997).

Credit note The credit note referenced by the return (CreditInvoiceId) is joined optionally. Its number and total are returned as CreditNumber and CreditedAmount. Both are empty if the return has no credit note.

Paging and sort order

  • All matching returns are numbered in ascending order of their Id.
  • Rows with a row number greater than Offset are returned, at most RowCount of them.
  • The result is sorted by Id.

Additional data Each row also contains:

  • the status code,
  • the invoice number and customer reference of the original invoice,
  • the names of the users who created and last modified the return.

Notes

  • Unknown invoice number: If InvoiceNr does not match any invoice, the invoice filter is silently ignored. The call then returns all returns that match the other filters. The same happens for an empty string that matches no invoice.
  • Duplicate invoice numbers: If several invoices share the same number, only one of them is used; which one is not defined.
  • Paging gaps: Row numbers are assigned before the status, invoice and user data are joined. These joins are inner joins. A return whose status, original invoice, creating user or modifying user cannot be found is dropped from the output. A page can therefore contain fewer than RowCount rows even though later pages still have data. For paging, increase Offset by RowCount each time; do not use the number of rows received.
  • Time precision: RecordModifiedOn is held as smalldatetime (minute precision).
  • Dirty reads: All tables are read with NOLOCK, so uncommitted data may appear.

Tables used

Return · Read Invoices · Read Status · Read UCS_USERS · Read
SQL object:
dbo.pipiGetReturns
Updated at 2026-10-30