pixiDeleteOrderline
Deletes an orderline (or the whole bundle it belongs to) and removes the order if no orderlines remain.
Deletes the orderline identified by OrderlineKey inside one transaction.
- Check: the orderline must exist in
Orderlinesand have one of the statusesHAL,ANG,STO,NLBorFUT. Otherwise anERRORrow is returned and nothing is changed. - Bundle handling: if the orderline has a
BundleOrderlineRef, the whole bundle is deleted, not only the given line. - Status reset: the orderline (or all lines of the bundle) of the same order that have no
BoxNrare set to statusNEWwithUpdateEmp=API. - Deletion: all affected lines in status
NEWare detached from the order:OrderNr,CustRef,AddrRef,ShipAdrRef,Qty, prices, discounts andShipCostare set to 0,ItemRef,ShipRef,Order_IdandBundleOrderlineRefto NULL. The bundle header inBundleOrderlinesis deleted if it has statusNEW. Reservations (Reservation) of the affected lines are deleted. - Empty order: if the order has no orderlines left afterwards, the order header is deleted together with its entries in
PL_NotReservedOrdersCheck,TagMatchandOrderHeaderAttribute.
The call returns exactly one row with ReturnCode (OK or ERROR) and a text in ErrorMessage. For bundles the success text names both the given orderline and the bundle key.
Notes
- All changes run in one transaction; on an error caught by the call it is rolled back and an
ERRORrow is returned. - The orderline rows are not physically deleted. They are reset (
OrderNr= 0 etc.); according to a code comment a job removes them overnight. That job is not part of this call. - The status check uses
NOLOCK, so it may read uncommitted data. - Triggers on
OrderlinesandReservationare suppressed viaCONTEXT_INFOduring the update/delete. - Only the given orderline is checked for an allowed status. For bundles, all other component lines without
BoxNrare set toNEWregardless of their current status and deleted. Lines that already have aBoxNrkeep their status and are not deleted. - The called sub-procedures catch their own errors and write them to
log.InsertErrorwithout re-raising. Depending on the transaction state, a failure inside them may surface as a transaction-count error in theERRORrow, or the call may reportOKalthough the sub-step was rolled back to its savepoint.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
Required
|
int | – |
Key of the orderline to delete. It must be in status Example: |
Result set 1 · Always; one row with ReturnCode = OK on success or ERROR on failure.
Status row of the call.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
|
ErrorMessage
Nullable |
nvarchar(4000) string |
Success text (mentions the bundle if a whole bundle was deleted) or the SQL error message. |
Response example
<SqlRowSet1>
<row>
<ReturnCode>OK</ReturnCode>
<ErrorMessage>Orderline with OrderlineKey 123456 has been deleted successfully.</ErrorMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | Orderline with OrderlineKey {OrderlineKey} does not exist or doesn't have the right status (HAL, ANG, STO, NLB, FUT). | No orderline with this key exists, or its status is not one of `HAL`, `ANG`, `STO`, `NLB`, `FUT`. Check the key and the current status of the orderline. |
| ERROR | {ERROR_MESSAGE()} | Any other SQL error during processing (for example a transaction-count mismatch after a failing sub-procedure). The transaction 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:pixiDeleteOrderline>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiDeleteOrderline>
</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:pixiDeleteOrderline>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiDeleteOrderline>
</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 = [
'OrderlineKey' => '123456',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiDeleteOrderline', $soapArguments);
- SQL object:
- dbo.pipiDeleteOrderline