pixiGetComments
Returns the comments of a customer (from the customer history) and/or of an order, newest first, with offset-based paging.
Collects comments for a customer, an order or both and returns them in one list.
- If both
CustomerNrExternalandOrderNrareNULLor empty, a single error row (ReturnCode=ERROR) is returned and nothing else happens. - If
CustomerNrExternalis notNULL, all entries of the customer history whose note text is notNULLare collected for the customer with this external customer number, as typeCustomerComment. They are numbered newest first by history update date. - If
OrderNris notNULL, all order comments of this order number are appended as typeOrderComment(no defined order within this group). - Each collected row gets a running number
Offsetstarting at 0, in the order of collection (customer comments first, then order comments). - The result returns at most
RowCountrows whoseOffsetis greater than or equal to@Offset, sorted byDatedescending.
Both filters can be combined; the comments are then merged into one result set.
Notes
- The
Offsetnumbering follows the collection order (customer comments by date descending, then order comments in undefined order), while the output is sorted byDatedescending. With both filters set, paging via@Offsettherefore does not necessarily correspond to the displayed date order. SET ROWCOUNTlimits the output;RowCount= 0 returns all rows.- The empty-check only rejects the call if both values are empty. An empty string (not
NULL) for one parameter still runs that branch, e.g.CustomerNrExternal= '' searches for customers with an empty external number. Offsetis asmallint; more than 32,767 collected comments would cause an overflow error.- No
NOLOCKhints are used.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
CustomerNrExternal
|
varchar(255) string |
NULL |
External customer number. If set, the customer's history comments are returned. Example: |
OrderNr
|
varchar(50) string |
NULL |
Order number. If set, the comments of this order are returned. Example: |
Offset
|
int | 0 |
Zero-based running number from which rows are returned (paging). Example: |
RowCount
|
int | 300 |
Maximum number of rows returned; 0 means no limit. Example: |
Result set 1 · If both CustomerNrExternal and OrderNr are NULL or empty
Error row.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
Always |
ErrorMsg
|
varchar(60) string |
Error text. |
Result set 2 · If at least one of CustomerNrExternal or OrderNr is given
Comments of the customer and/or order, sorted by date descending.
| Column | Type | Description |
|---|---|---|
Offset
|
smallint int |
Zero-based running number in collection order, used for paging. |
TypeOfComment
|
varchar(20) string |
|
Date
Nullable |
datetime dateTime |
Update date of the customer history entry or creation date of the order comment. |
Employee
Nullable |
varchar(50) string |
Employee who changed the history entry or created the order comment. |
Comment
Nullable |
varchar(max) string |
Comment text. |
Response example
<SqlRowSet1>
<row>
<Offset>0</Offset>
<TypeOfComment>CustomerComment</TypeOfComment>
<Date>2024-03-12T10:15:00</Date>
<Employee>MM</Employee>
<Comment>Kunde wünscht Lieferung nur vormittags.</Comment>
</row>
<row>
<Offset>1</Offset>
<TypeOfComment>CustomerComment</TypeOfComment>
<Date>2023-11-02T14:40:00</Date>
<Employee>AS</Employee>
<Comment>Rechnungsadresse geändert.</Comment>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | Please specify at least the CustomerNrExternal or a OrderNr | Neither `CustomerNrExternal` nor `OrderNr` was passed (or both are empty). Pass at least one of them. |
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:pixiGetComments>
<!-- <CustomerNrExternal>K-100234</CustomerNrExternal> -->
<!-- <OrderNr>4711</OrderNr> -->
<!-- <Offset>0</Offset> -->
<!-- <RowCount>50</RowCount> -->
</ns1:pixiGetComments>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?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:pixiGetComments>
<!-- <CustomerNrExternal>K-100234</CustomerNrExternal> -->
<!-- <OrderNr>4711</OrderNr> -->
<!-- <Offset>0</Offset> -->
<!-- <RowCount>50</RowCount> -->
</ns1:pixiGetComments>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'CustomerNrExternal' => 'K-100234',
// 'OrderNr' => '4711',
// 'Offset' => '0',
// 'RowCount' => '50',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetComments', $soapArguments);
- SQL object:
- dbo.pipiGetComments