pixiSetOrderShippingInformation
Sets the shipping vendor and the DHL product, procedure and extras on an order header, identified by Pixi order number or external order number.
Updates the shipping information of one order in OrderHeader.
- The order is looked up with
OrderNr = @OrderNr OR OrderNrExternal = @OrderNrExternal. If no order matches (including when both parameters are NULL), a row withStatus400 is returned and nothing is changed. - If an order is found, the order row is read with
UPDLOCK, ROWLOCK.OrderNrandOrderNrExternalare taken from the stored order. Each ofShipVendor,DHLProdukt,DHLVerfahrenandDHLExtrathat is passed as NULL or left out keeps its current value (ShipVendorCode,Product,Verfahren,Extras). - The order is updated by its
OrderNr. The update runs in its own transaction, or in a savepoint if the caller already has an open transaction. - The call returns one status row with the current values of the order:
Status200 withData updated in pixiif a row was updated.Status500 withData could not be updated in pixiif no row was updated, for example because an SQL error occurred.
Notes
- A value cannot be reset to NULL with this call: NULL means "keep the current value". An empty string is written as such.
- Because the lookup uses
OR, passing bothOrderNrandOrderNrExternalcan match two different orders, or an external number can match several orders. In that case the variables are assigned from one of the matching rows without a defined order, and only that order is updated. Pass only one identifier to avoid ambiguity. - SQL errors are caught, the transaction (or savepoint) is rolled back and the error is logged via
log.InsertError(definition not attached). NoSqlMessageis returned; the caller only seesStatus500. If the transaction becomes uncommittable, a fullROLLBACKis executed, which also rolls back an outer transaction of the caller. - The existence check and the final status row read
OrderHeaderwithNOLOCK. - The column types of
Product,VerfahrenandExtrasare not visible in the code; values longer than the column size cause an error and thereforeStatus500.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNr
|
int | NULL |
Pixi order number of the order to update. Either this or Example: |
OrderNrExternal
|
varchar(50) string |
NULL |
External order number (e.g. from the shop) used to find the order if Example: |
ShipVendor
|
varchar(3) string |
NULL |
Shipping vendor code written to Example: |
DHLProdukt
|
varchar(50) string |
NULL |
DHL product written to Example: |
DHLVerfahren
|
varchar(50) string |
NULL |
DHL procedure (Verfahren) written to Example: |
DHLExtra
|
varchar(50) string |
NULL |
DHL extras written to Example: |
Result set 1 · Always; one status row (200 on success, 500 if no row was updated, 400 if the order was not found).
Status row with the current shipping information of the order. For status 400 all order columns are NULL.
| Column | Type | Description |
|---|---|---|
Status
|
int |
200 = updated, 500 = not updated, 400 = order not found. |
Message
|
varchar(33) string |
Status text. |
OrderNr
Nullable |
int |
Pixi order number. |
OrderNrExternal
Nullable |
string |
External order number. |
ShipVendor
Nullable |
string |
Current shipping vendor code ( |
DHLProdukt
Nullable |
string |
Current DHL product ( |
DHLVerfahren
Nullable |
string |
Current DHL procedure ( |
DHLExtra
Nullable |
string |
Current DHL extras ( |
Response example
<SqlRowSet1>
<row>
<Status>200</Status>
<Message>Data updated in pixi</Message>
<OrderNr>123456</OrderNr>
<OrderNrExternal>SHOP-100234</OrderNrExternal>
<ShipVendor>DHL</ShipVendor>
<DHLProdukt>V01PAK</DHLProdukt>
<DHLVerfahren>01</DHLVerfahren>
<DHLExtra>Premium</DHLExtra>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 400 | Order could not be found in pixi | No order matches `OrderNr` or `OrderNrExternal`, or both were left empty. Pass an existing order number. |
| 500 | Data could not be updated in pixi | The update changed no row, typically because an SQL error (e.g. a value too long for the column, a lock timeout) occurred; the error is logged via `log.InsertError` and the change is rolled back. |
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:pixiSetOrderShippingInformation>
<!-- <OrderNr>123456</OrderNr> -->
<!-- <OrderNrExternal>SHOP-100234</OrderNrExternal> -->
<!-- <ShipVendor>DHL</ShipVendor> -->
<!-- <DHLProdukt>V01PAK</DHLProdukt> -->
<!-- <DHLVerfahren>01</DHLVerfahren> -->
<!-- <DHLExtra>Premium</DHLExtra> -->
</ns1:pixiSetOrderShippingInformation>
</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:pixiSetOrderShippingInformation>
<!-- <OrderNr>123456</OrderNr> -->
<!-- <OrderNrExternal>SHOP-100234</OrderNrExternal> -->
<!-- <ShipVendor>DHL</ShipVendor> -->
<!-- <DHLProdukt>V01PAK</DHLProdukt> -->
<!-- <DHLVerfahren>01</DHLVerfahren> -->
<!-- <DHLExtra>Premium</DHLExtra> -->
</ns1:pixiSetOrderShippingInformation>
</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-100234',
// 'ShipVendor' => 'DHL',
// 'DHLProdukt' => 'V01PAK',
// 'DHLVerfahren' => '01',
// 'DHLExtra' => 'Premium',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetOrderShippingInformation', $soapArguments);
- SQL object:
- dbo.pipiSetOrderShippingInformation