pixiOrderSetInfo
Updates the sub-shop name, sub-shop logo and referrer of an order, identified by Pixi order number or external order number.
Sets informational fields in the header of an existing order.
-
Order lookup: The procedure searches
Orderlinesfor rows whereOrderNrExternalequals@OrderNrExternalorOrderNrequals@OrderNr, and takes theOrderNrfrom a matching row. If no row matches,@OrderNrkeeps the value that was passed in. -
Check: If there is not exactly one
OrderHeaderrecord with the resultingOrderNr, an error row withErrorNr404is returned and nothing is changed. -
Update: Otherwise the
OrderHeaderrecord is updated:SubShopNameis set to@SubShopName,SubShopLogois set to@SubShopLogo,Referreris set to@Referrer.
A parameter that is omitted or
NULLleaves the existing value unchanged. This allows partial updates. -
If the update fails, an error row with
ErrorNr500is returned.
On success the call returns no result set.
Notes
- The lookup by
@OrderNrExternalgoes throughOrderlines, notOrderHeader. An order without order lines cannot be found by its external number and returns404. Lookup by@OrderNralone still works in that case, because the passed value is kept. - If both
@OrderNrand@OrderNrExternalare passed and they point to different orders, the code does not detect the conflict, although the error text suggests it does. The lookup then takes theOrderNrfrom one of the matching order lines, and the row that is used is not defined. That order is updated. Pass only one of the two identifiers. - The lookup reads with
NOLOCK. - An empty string is not
NULL. It overwrites the field with an empty value. OnlyNULLor an omitted parameter keeps the existing value. - Values longer than 50 characters can make the update fail, which returns the
500row. Whether this happens depends on the column sizes inOrderHeader, which are not visible in the code. - The error texts mention an "invoice", but the call works on orders.
- No transaction is opened explicitly. The update is a single statement.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNr
|
int | NULL |
Pixi order number. Alternative to Example: |
OrderNrExternal
|
varchar(50) string |
NULL |
External order number, for example from the shop. It is resolved through Example: |
SubShopName
|
varchar(50) string |
NULL |
New sub-shop name. Example: |
SubShopLogo
|
varchar(50) string |
NULL |
New sub-shop logo reference. Example: |
Referrer
|
varchar(50) string |
NULL |
New referrer, i.e. the source of the order. Example: |
Result set 1 · Only on error: order not found or not unique (404), or the update failed (500). No result set on success.
Error row with an error number and a message.
| Column | Type | Description |
|---|---|---|
ErrorNr
|
varchar(3) string |
Error number: |
ErrorMessage
|
varchar(75) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<ErrorNr>404</ErrorNr>
<ErrorMessage>Invoice does not exist or two different invoice parameters were specified.</ErrorMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 404 | Invoice does not exist or two different invoice parameters were specified. | The resolved order number does not match exactly one record in `OrderHeader`. This happens if no identifier was passed, if the order does not exist, or if `OrderNrExternal` cannot be found in `Orderlines`. Pass a valid `OrderNr` or `OrderNrExternal`. |
| 500 | Technical problems during update of the order information | The update of `OrderHeader` raised an error, for example because a value is too long for the column or a constraint was violated. Check the length and content of the passed values. |
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:pixiOrderSetInfo>
<!-- <OrderNr>123456</OrderNr> -->
<!-- <OrderNrExternal>SHOP-100023</OrderNrExternal> -->
<!-- <SubShopName>Outlet Shop</SubShopName> -->
<!-- <SubShopLogo>outlet_logo.png</SubShopLogo> -->
<!-- <Referrer>google-ads</Referrer> -->
</ns1:pixiOrderSetInfo>
</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:pixiOrderSetInfo>
<!-- <OrderNr>123456</OrderNr> -->
<!-- <OrderNrExternal>SHOP-100023</OrderNrExternal> -->
<!-- <SubShopName>Outlet Shop</SubShopName> -->
<!-- <SubShopLogo>outlet_logo.png</SubShopLogo> -->
<!-- <Referrer>google-ads</Referrer> -->
</ns1:pixiOrderSetInfo>
</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' => '123456',
// 'OrderNrExternal' => 'SHOP-100023',
// 'SubShopName' => 'Outlet Shop',
// 'SubShopLogo' => 'outlet_logo.png',
// 'Referrer' => 'google-ads',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiOrderSetInfo', $soapArguments);
- SQL object:
- dbo.pipiOrderSetInfo