Postman collection
Payments Write

pixiGetPosJournal

Returns the POS cash journal (register events with amounts, invoices and running register value) for a date range, location and register.

Returns the cash journal (Kassenbuch) of the Pixi POS module. The work is done by the internal procedure CR_POS_Kassenbuch. Its rows are buffered, and a reduced set of columns is returned.

Steps:

  1. The common API envelope checks the call frequency. If the minimum interval configured for this function has not passed, only a status row with ResultCode 502 is returned and no journal data is read.
  2. Defaults are applied:
    • FromDate and ToDate default to today.
    • FromDate is used as given, including its time.
    • ToDate is extended to the end of its day.
  3. POS session events in the range are selected. Events of type I are excluded.
    • LocID limits the result to one location. NULL or empty means all locations.
    • RegisterID limits the result to one register. '' or NULL means all registers.
  4. Each event is joined with the POS invoice header, if one exists, and with a description of the event type:
    • S = POS Start
    • E = POS Stop
    • P = Invoice
    • D = Drawer Open
  5. RegisterValue is the running total of AmountIn - AmountOut over all selected events with an EventTime up to and including the current one.
  6. EventComment combines the event comment and the invoice comment, separated by a line break.

The internal procedure sorts by EventTime.

Notes

  • Call statistics: the API envelope writes the time of the call into API_STATISTICS. This is the only write access.
  • Reads: all reads of journal data use NOLOCK, so uncommitted data may appear.
  • Sort order: the final SELECT reads from a table variable without its own ORDER BY. The order by EventTime is therefore not strictly guaranteed.
  • Running total: RegisterValue is calculated over all selected events, not per register or per location. When several registers or locations are queried at once, the value mixes them. It also starts at 0 at FromDate; there is no opening balance from before the range.
  • End of range: ToDate is converted with CAST(... AS INTEGER). For datetime values this rounds to the nearest day, so a ToDate with a time of 12:00 or later extends the range to the end of the following day. Pass ToDate without a time.
  • VAT rates: events are inner-joined with VAT rates from fPixi_GetVATRate (not attached). If that function returns no rate for a location, the events of that location are missing from the result.
  • Always empty: CreatedBy and UpdatedBy are always NULL.
  • Unknown types: EventDescription is NULL for event types other than S, E, P and D.

Tables used

POSSession_event · Read POSSession · Read POSheader2 · Read API_STATISTICS · Write API_CONTROL · Read
SQL object:
dbo.pipiGetPosJournal
Updated at 2026-10-30