pixiAddOrderComment
Sets the shop note (`Shop_Note`) of an order identified by its order number and returns 1 on success or 0 if the order is missing or masked.
Writes a comment into the shop note field of an order.
- The order is looked up in
OrderHeaderbyOrderNr. If no order exists, the call returns a row withReturnMessage=0and stops. - The call checks whether the order is editable. An order counts as not editable (masked) if it has an order header attribute of type
2with value2. For a masked order the call returnsReturnMessage=0and changes nothing. - Otherwise
Shop_Noteof the order is set to@Commentand the call returnsReturnMessage=1.
Despite the name, the comment is not appended: the existing content of Shop_Note is replaced completely.
Notes
- The existing shop note is overwritten. To keep previous text, read the current note first and send the combined text.
- If
CommentisNULLor omitted in the XML as nil, the note is set to an empty string (the blacklist function currently only replacesNULLwith''). ReturnMessage=0does not distinguish between "order not found" and "order masked".- The lookups of the order and its attributes use
NOLOCK. - The update runs in its own transaction, or in a savepoint if the caller already has an open transaction. On an error the transaction is rolled back and the error is logged via
log.InsertError(definition not attached); in that case noReturnMessagerow is returned by this procedure, and whether an error is passed on to the caller depends onlog.InsertError. - The order lookup by
OrderNris outside the error handling; if several orders shared the sameOrderNr, the subquery would fail with a SQL error.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNr
Required
|
int | – |
Order number of the order whose shop note is set. Example: |
Comment
Required
|
nvarchar(max) string |
– |
Text written into Example: |
Result set 1 · Always, unless an error occurs during the update
Single status row indicating whether the note was written.
| Column | Type | Description |
|---|---|---|
ReturnMessage
|
int |
|
Response example
<SqlRowSet1>
<row>
<ReturnMessage>1</ReturnMessage>
</row>
</SqlRowSet1>
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:pixiAddOrderComment>
<OrderNr>100245</OrderNr>
<Comment>Customer requests delivery after 2 pm.</Comment>
</ns1:pixiAddOrderComment>
</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:pixiAddOrderComment>
<OrderNr>100245</OrderNr>
<Comment>Customer requests delivery after 2 pm.</Comment>
</ns1:pixiAddOrderComment>
</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 = [
'OrderNr' => '100245',
'Comment' => 'Customer requests delivery after 2 pm.',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiAddOrderComment', $soapArguments);
- SQL object:
- dbo.pipiAddOrderComment