Postman collection
General Write

pixiImportAddXML

Stores an order or item import XML in the Pixi XML log (`C_XMLLog`) with status `XIM` and returns the key of the new log entry.

Hands an import document over to Pixi's new import mechanism by writing it into the XML log.

  1. If ParameterXML is not empty, its content replaces XML. An empty OperationType or XML is treated as NULL.
  2. OperationType is compared case-insensitively:
    • order resolves to the operation type OrderImport
    • item resolves to the operation type ItemImport
    • any other value, including NULL, is rejected. The operation type key is read from C_OperationTypes.
  3. ChannelRef is looked up in C_Channels.
  4. The input is then checked in this order: channel is NULL, operation type unknown, XML missing. The first failed check returns a single row with ErrorNr = 500 and ErrorMsg.
  5. If all checks pass, the XML is written to C_XMLLog with Source = API, Status = XIM, user API, the resolved operation type and the channel. The text is cleaned up and converted to the XML data type. If the conversion fails, the raw text is stored together with the conversion error number and message. The call does not report this as an error.
  6. The call returns the key of the new log entry. It does not import the order or item itself. That happens later in the import processing, which is not part of this call.

Notes

  • Two result sets on success: the internal procedure Pixi_C_InsertXML already returns the new key as XMLLogKey (SqlRowSet1). The call then returns the same value again as XMLKey (SqlRowSet2). On error only one row (ErrorNr/ErrorMsg) is returned, in SqlRowSet1.
  • Channel check is weak: if ChannelRef does not exist in C_Channels, the variable keeps the value that was passed. The error Channel not defined therefore only occurs when ChannelRef is explicitly NULL. A non-existent channel, including the default 0, is stored without an error.
  • If order or item is passed but the matching row (OrderImport/ItemImport) is missing in C_OperationTypes, the operation type stays NULL. The entry is then stored with an empty operation type instead of being rejected.
  • Invalid XML is not rejected. A failed XML conversion is only recorded in the log columns XmlResponseCastErrorNr/XmlResponseCastErrorMessage. Check the XML before sending it.
  • The XML is cleaned by fPixi_CleanupXmlText, whose definition is not attached.
  • No explicit transaction is used. The lookups in C_OperationTypes and C_Channels use NOLOCK.
  • Send the XML document escaped (or as CDATA) inside the SOAP element, because the parameter is a varchar(max) string.

Tables used

C_OperationTypes · Read C_Channels · Read C_XMLLog · Write
SQL object:
dbo.pipiImportAddXML
Updated at 2026-10-30