Postman collection
Orderlines Read

pixiCanAddOrderlines

Checks whether new order lines may still be added to an order, based on the payment type and the status of its existing order lines.

Determines for the order PixiOrderNr whether further order lines can be added. It sets the output parameter CanAdd, optionally returns a status row and also uses the value as the procedure return value.

The order header (OrderHeader) is joined to its address (Addresses, via AddrRef). The decision depends on the payment type column APayment:

  • Payment type other than K or C: CanAdd = 1 if the order has no order lines with status EIN or AUS. Otherwise 0.
  • Payment type K or C: CanAdd = 1 only if all order lines of the order have one of the statuses NEW, ANG, HAL, MIN, OPH, BES, STO, NLB. As soon as one line has a different status, the result is 0.
  • An order without any order lines therefore always returns 1, provided the payment type is set.
  • If APayment is NULL, neither condition is met and the result is 0.

If SupressOutput = 0 (default), one row with CanAdd, OrderNr and ErrorMessage (always NULL) is returned. With SupressOutput = 1 no result set is returned and only the output parameter and the return value carry the result.

Notes

  • All reads use NOLOCK, so the result can reflect uncommitted changes.
  • If the order does not exist (or has no matching address record), no value is assigned: CanAdd keeps the value the caller passed in (typically NULL), and the returned row shows that value. No error message is produced; ErrorMessage is always NULL. Treat a NULL CanAdd as "order not found".
  • CanAdd is declared as OUTPUT without a default, so it must be sent in the request (e.g. empty or 0).
  • The column APayment is referenced without a table alias; it is resolved from OrderHeader or Addresses. The meaning of the payment types K and C is not defined in the code.
  • Order lines with a NULL status are not counted in the check for payment types K/C.
  • The procedure does not change any data.

Parameters

Parameter Type Default Description
PixiOrderNr
Required
int –

Pixi order number (OrderHeader.OrderNr) of the order to check.

Example: 104523

CanAdd
OUTPUT
bit
boolean
–

Output: 1 if order lines can be added, 0 if not. Keeps the passed value if the order is not found.

Allowed values

  • 1 – Order lines can be added.
  • 0 – Order lines cannot be added.

Example: 0

SupressOutput
bit
boolean
0

Controls whether the result row is returned.

Allowed values

  • 0 – Return the result row (default).
  • 1 – Return no result set; result only in the output parameter and return value.

Example: 0

Response

Result set 1 · If SupressOutput = 0 (default)

One row with the check result for the order.

Column Type Description
CanAdd
Nullable
bit
boolean

1 if order lines can be added, 0 if not; the passed input value (usually NULL) if the order was not found.

OrderNr int

The checked order number (echo of PixiOrderNr).

ErrorMessage
Nullable
int
string

Always NULL; no error message is produced.

Examples

POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
  <SOAP-ENV:Body>
    <ns1:pixiCanAddOrderlines>
      <PixiOrderNr>104523</PixiOrderNr>
      <!-- <CanAdd>0</CanAdd> -->
      <!-- <SupressOutput>0</SupressOutput> -->
    </ns1:pixiCanAddOrderlines>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Tables used

OrderHeader · Read Addresses · Read Orderlines · Read
SQL object:
dbo.pipiCanAddOrderlines
Procedure last changed on 2026-10-05
Documentation written by claude-opus-5-5 on 2026-10-30