Postman collection
Orders Read

pixiGetOrdersReadyForPickup

Returns the orders with reserved order lines that customers can pick up at a given POS location, together with the customer reference.

Lists orders that are ready for pickup by the customer at a point-of-sale location.

An order is returned if it has at least one order line that meets all of these conditions:

  • the order line's LocationID equals LocationId;
  • the line's location exists in Location and has a reservation location (ResLocID) that also exists in Location;
  • the line's CustRef refers to an existing customer in Customers;
  • a reservation exists for the line in Reservation (ResOrderlineRef = order line key);
  • the line status is ANG or HAL;
  • the order date is not older than the reservation expiry in days: ResExpDays of the reservation location, or, if that is NULL, the value of the setting ReservationExpiry.

In addition, the whole order is excluded if any of its order lines refers to an item that has no ItemLocationSpecific record for the reservation location. Only the existence of that record is checked, not stock quantities.

The result is distinct per order number and customer and is sorted by order number in ascending order.

Notes

  • If LocationId is omitted (NULL), the comparison with LocationID never matches and the result is always empty. Always pass a location.
  • Pitfall with the expiry fallback: the code falls back to 14 days only if the setting ReservationExpiry returns an empty string. fPIXI_GetSetting returns '0' when the setting does not exist, so without the setting and without ResExpDays on the reservation location only orders dated today are returned.
  • The expiry is measured in calendar days between the order date and the current server date (DATEDIFF in days).
  • All tables are read with NOLOCK, so uncommitted data may appear.
  • Read only; no data is changed.

Tables used

Orderlines · Read Location · Read Customers · Read Reservation · Read ItemLocationSpecific · Read Settings · Read
SQL object:
dbo.pipiGetOrdersReadyForPickup
Updated at 2026-10-30