Postman collection
Orders Read

pixiGetOrderTotals

Returns the order lines of an order together with the order totals, VAT and shipping amounts, matching what the invoice would produce.

Looks up an order and returns one row per order line, with the order header totals repeated on every row.

Selecting the order

  • If OrderNr is set (not 0/NULL), the lines of that Pixi order number are used. OrderNrExternal is then ignored.
  • Otherwise, if OrderNrExternal is not empty, the lines with that external order number are used.
  • If neither is given, nothing is found.
  • CustKey optionally restricts the result to lines of that customer. 0 or NULL disables this filter.

Joins

The lines must have a matching article, billing address, shipping address, customer, shop of the customer, payment method of the billing address, order header and order currency. Lines that miss any of these are not returned.

Status evaluation

  • If no lines are found, a single row with ErrorMessage = No results found is returned.
  • If all found lines have status STO (cancelled), a single row with ErrorMessage = Only orderlines with status STO found is returned.
  • Otherwise all lines whose status is not STO are returned with line values (EAN, supplier item number, name, quantity, price, net values, note) and header values (order total, discount, VAT total/high/low including shipping cost VAT, net total of the lines, shipping cost gross and net, tax rates, currency code).

No sort order is applied.

Notes

  • All tables are read with NOLOCK, so uncommitted data can be returned.
  • Header values (OrderTotal, Discount, VATTotal, ShipCost etc.) are repeated on every line row; do not sum them across rows.
  • VATTotal, VATHigh and VATLow include the VAT on shipping costs, while NettoTotal is the net total of the order lines only and does not include shipping.
  • Several amounts are rounded to 2 decimals and converted to float.
  • Lines with a NULL status are counted neither as cancelled nor as not cancelled and are not returned.
  • The first result set has a different structure depending on the outcome: either the line columns or a single ErrorMessage column. Check for ErrorMessage before reading the data.
  • Only cancelled lines are excluded from the output; the status itself is not returned.

Tables used

Orderlines · Read items · Read Addresses · Read Customers · Read Shops · Read Payments · Read OrderHeader · Read Currency · Read
SQL object:
dbo.pipiGetOrderTotals
Updated at 2026-10-30