Postman collection
Direct-Fulfillment Write

pixiDFSetStatus

Sets the direct fulfillment status of orderlines from an XML list of order history keys and can optionally create the DF invoices afterwards.

Used by direct fulfillment suppliers to report back the processing state of orderlines (shipped, cancelled, not deliverable) together with shipping date, tracking ID, external invoice number, batch, best-before date and serial number.

Steps

  1. Authentication: looks up a supplier in Suppliers with SupplNr = @SupplNr, CustNr = @Secret, not disabled and CanDoDirectFulfillment = 1. If none is found and the setting DFAPIAllowFullAccessWithoutSecret is 0 or missing, the call stops with the message 403 Not Authorized… and returns no rows.
  2. XML parsing: reads all /SETDFSTATUS/ITEM elements (element-centric) into a work table. Missing ERROR/ERRORMSG default to 200/empty.
  3. Duplicate check: if the same ORDERHISTORYKEY appears more than once with the same STATUS, the call raises 500 Duplicate Orderhistorykey and Status. and nothing is changed.
  4. Processing per item (inside one transaction): the orderline is found via OrderHistory.OrderHistKey → OrderLineRef, then the internal procedure Pixi_UpdateOrderlineDFStatusByOrderlineKey is executed. It:
    • rejects the item if the orderline does not exist, is already in status FUS or in a final state, if QTY < 1 or larger than the orderline quantity, or if batch number / best-before date are missing for items tagged with the system tags (only when setting DFRequiredDataForSystemTags is active);
    • splits the orderline if QTY is smaller than the current quantity (the reported quantity stays on the original line, the rest goes to a new line in the old status);
    • maps STATUS: STO → STO, NLB → NLB, any other value → FUS for DF type 1, 3 or empty, otherwise BES (then a reservation for the Auftrag is created);
    • updates the orderline with status, ship date, tracking ID, external invoice number, batch number, best-before date and serial number (UpdateEmp = DF API).
  5. The result text of each item is written to ERRORMSG; ERROR becomes 500 if the text contains error, otherwise 200. Each item is also logged in LogTable.
  6. All items are returned as one result set and the transaction is committed.
  7. If @CreateInvoices = Y, pipiDFCreateInvoices is executed afterwards without parameters.

Notes

  • Partial processing: item errors do not roll back the other items. The internal error counter is never increased, so the transaction is always committed; check ERROR per row.
  • @SupplNr/@Secret only authenticate the caller. The code does not check that the orderlines belong to that supplier.
  • The 403 message is raised with severity 0, i.e. as an informational message, not as an SQL error. Clients must check for it explicitly when no rows are returned.
  • STATUS is read with up to 13 characters but processed as varchar(3); longer values are truncated and the result row may then not be updated (keeps ERROR 200).
  • Ship date, tracking ID and external invoice number are always overwritten; omitted elements set these fields to NULL. Batch number, best-before date and serial number keep their existing values when empty.
  • BESTBEFOREDATE is converted implicitly to a date; invalid values cause an exception.
  • If an exception occurs, the transaction is rolled back, the error is logged via log.InsertError and no result set is returned. Errors caught inside the internal procedure may not show up in ERROR.
  • If several error conditions apply to one item, only the last message set is returned.
  • @CreateInvoices = 'Y' runs pipiDFCreateInvoices for all DF orderlines ready for invoicing, not only the ones in this call; it runs after the commit and returns no rows. The invoice creation itself (Pixi_CreateFulfillmentIncoices) is not attached.
  • Reads use NOLOCK.

Tables used

Suppliers · Read Settings · Read OrderHistory · Read Orderlines · Write TagMatch · Read OrderStates · Read LogTable · Write
SQL object:
dbo.pipiDFSetStatus
Updated at 2026-10-30