pixiReleaseOrder
Releases an on-hold order identified by its external order number and shop by setting its order lines from status HAL to ANG.
Releases an order that is on hold (status HAL) so it can be processed again.
- The internal order number (
OrderNr) is looked up inOrderlinesviaOrderNrExternal=@OrderNrExternal, joined toCustomerswithCustomerOf=@ShopId. - The internal procedure
GOS_ReleaseOnHoldis called with that order number and the userAPI. It sets every order line of the order that has statusHALtoANG, setsUpdateDateto the current date andUpdateEmptoAPI (payments). - Finally one status row is returned: the number of order lines with the given external order number and shop that now have status
ANG.ReturnCodeisOKif this number is greater than 0, otherwiseERROR.
Notes
AffectedRowsis not the number of lines actually released: it counts all lines with statusANG, including lines that already hadANGbefore the call. Calling the procedure for an order that was not on hold but hasANGlines therefore also returnsOK.- If no order is found, nothing is updated and the result is
ERRORwithAffectedRows= 0. The same happens if the order exists but none of its lines is in statusANGafterwards (e.g. lines in other statuses). - If several orders share the same external order number within the shop, only one of them (the last row read by the lookup) is released, while the count covers lines of all matching orders.
- Lookups and the final count use
NOLOCK, so the result can reflect uncommitted data. - The update runs inside a transaction (or savepoint if a transaction is already open). On an error the transaction is rolled back, the error details are written to
LogTableand the error is re-raised.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNrExternal
Required
|
varchar(50) string |
– |
External order number (e.g. the shop's order number) of the order to release. Example: |
ShopId
Required
|
char(3) string |
– |
Shop ID; compared with Example: |
Result set 1 · Always, unless an error is raised during the update.
Status row with the result of the release.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
|
AffectedRows
|
int |
Number of order lines with the given external order number and shop that are in status |
Response example
<SqlRowSet1>
<row>
<ReturnCode>OK</ReturnCode>
<AffectedRows>3</AffectedRows>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | ERROR | Returned as `ReturnCode` when no order line of the order is in status `ANG` after the call, e.g. the external order number does not exist for this shop or the lines are in another status. Check `OrderNrExternal` and `ShopId`. |
| RAISERROR | {error message} | Any SQL error during the status update in `GOS_ReleaseOnHold` (e.g. lock timeout or constraint violation). The transaction is rolled back, the details are logged to `LogTable`, and the original error message is re-raised. |
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:pixiReleaseOrder>
<OrderNrExternal>100012345</OrderNrExternal>
<ShopId>ABC</ShopId>
</ns1:pixiReleaseOrder>
</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:pixiReleaseOrder>
<OrderNrExternal>100012345</OrderNrExternal>
<ShopId>ABC</ShopId>
</ns1:pixiReleaseOrder>
</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 = [
'OrderNrExternal' => '100012345',
'ShopId' => 'ABC',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReleaseOrder', $soapArguments);
- SQL object:
- dbo.pipiReleaseOrder