Postman collection
Suppliers Write

pixiCreateSupplierOrderFromProfile

Creates supplier (purchase) orders from a stored supplier order suggestion profile and returns the numbers of the created orders.

Runs the supplier order suggestion (Bestellvorschlag) for a saved profile and confirms the result in one step, which creates or extends supplier orders.

Steps:

  1. Checks that ProfileId is given and that a Pixi user named API exists. This user is passed on as the acting user.
  2. Reads the profile XML from pixi.SupplierOrderSuggestionProfile.Data for the given Id. If there is no profile or no data, an error row is returned.
  3. Maps the profile settings below /SuggestionProfileDbo to the suggestion parameters:
    • OrderMethod: OrderOnDemand = 1, OrderForTargetStock = 2, OrderOnStockTurnover = 3.
    • SupplierPriority: LowestPrice = 1 (default), FastestDelivery = 2, LatestDelivery = 3.
    • CalculationSuggestionLocation: CalculateSuggestionForEachLocationSeparately = 0 (default), CalculateSuggestionsBasedOnSummarizedParametersForSelectedLocations = 1.
    • ConsiderationOfSuppliers: FromSelectedSuppliers = 0 (default), IfSelectedSupplierIsOptimal = 1.
    • SupplierOrdersCreation: CreateOnlyNewSupplierOrders = 0 (default), AddSuggestedItemsToOpenSupplierOrders = 1.
    • SelectedLocations/int, SelectedSuppliers/int and the tag ids in TagKeysOr, TagKeysAnd, TagKeysNot are joined to comma-separated lists.
    • ConsiderPackagingUnit, ConsiderMinimumOrderAmount, DeliveryLocationId, OrderLocationId, ExcludeSuppliersWithZeroPrice and IncludeOversoldItems are taken over directly.
    • Only for OrderOnStockTurnover: TurnoverInDays, ConsiderReorderLevel and the sales period. With StockTurnoverSalesOption = SalesPerDayForLastXDays the period is the last SalesForLastXDays days up to now; otherwise SalesFrom/SalesTo are used.
  4. Generates a suggestion run number from the current time (yyMMddHHmmss) and calls pixi.SupplierOrderSuggestionPrepareData and then pixi.SupplierOrderSuggestionConfirmData. Validation is skipped in the confirm step.
  5. Returns one row per supplier order linked to this run, with the order's internal number and the supplier number. If no order was linked, an INFO row is returned.

Notes

  • The actual creation of supplier orders happens in pixi.SupplierOrderSuggestionPrepareData and pixi.SupplierOrderSuggestionConfirmData. Their definitions are not attached, so the tables they write and their exact rules are not documented here. Both are called with @ShowOutputSet = 0, which presumably suppresses their own result sets.
  • All work runs in a transaction. If the caller already has an open transaction, a savepoint is used instead. On an exception the work is rolled back and an ERROR row is returned instead of a SQL error.
  • The user API must exist in UCS_USERS. There is no fallback to another user.
  • The run number is derived from the current time to the second. Two calls started in the same second may get the same number and mix up their results.
  • Values in the profile that do not match the listed texts leave the defaults in place. An unknown OrderMethod leaves the order method NULL.
  • Without any tags in a tag list, NULL (not an empty string) is passed for that list.
  • Profile and result reads use NOLOCK.

Tables used

SupplierOrderSuggestionProfile · Read SupplierOrderSuggestionNrOfOrder · Read SupplierOrder · Read Suppliers · Read UCS_USERS · Read
SQL object:
dbo.pipiCreateSupplierOrderFromProfile
Updated at 2026-10-30