pixiSupplierOrderDelete
Deletes one or more supplier orders (purchase orders), identified by ID or internal number, and returns a status row.
Deletes supplier orders (purchase orders). The orders to delete can be passed in four ways, which can be combined freely:
SupplierOrderId: a single supplier order ID.SupplierOrderIds: a comma-separated list of supplier order IDs.SupplierOrderNr: a single internal supplier order number (SupplierOrder.InternalNumber). It is resolved to the matching ID.SupplierOrderNrs: a comma-separated list of internal supplier order numbers. They are resolved to IDs.
Values of 0, NULL or an empty string are treated as "not given". All IDs collected from these parameters are merged into one candidate list. The list is passed as a comma-separated string to the internal procedure pixi.SupplierOrderDelete, which performs the actual deletion.
The call then checks whether any of the candidate IDs still exists in SupplierOrder:
- If none of them exists, it returns
ReturnCode=SUCCESSand an emptyErrorMessage. - If at least one still exists, it returns
ReturnCode=WARNINGwith the message Some Purchase Orders from list were not deleted. The call does not say which orders were kept.
If an error occurs, the transaction is rolled back and a row with ReturnCode = ERROR and the SQL error text is returned.
Notes
- The deletion logic itself (which orders may be deleted, which dependent data is removed) lives in
pixi.SupplierOrderDelete, which is not attached. Its rules and any result sets it might return are unknown. - The work runs in a transaction. If the caller already has an open transaction, a savepoint is used instead, and no status row is returned on success; only the error row is returned in that case. A normal SOAP call has no outer transaction and always gets a status row.
AppNameis declared but not used.- IDs passed in
SupplierOrderIdsare not checked for existence. IDs that do not exist do not cause a warning, because the final check only looks for candidates that still exist. - Non-numeric entries in
SupplierOrderIdsorSupplierOrderNrscause a conversion error and anERRORrow; nothing is deleted. - If no parameter identifies an order, an empty list (
NULL) is passed topixi.SupplierOrderDelete. What that procedure does with it is not visible. - Lookups of internal numbers and the final existence check use
NOLOCK. SupplierOrderIdsandSupplierOrderNrsare limited to 8000 characters.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
AppName
|
varchar(255) string |
NULL |
Name of the calling application. Declared but not used by the code. Example: |
SupplierOrderId
|
int | NULL |
ID of a single supplier order to delete. Example: |
SupplierOrderIds
|
varchar(8000) string |
– |
Comma-separated list of supplier order IDs to delete. Spaces around entries are trimmed. Empty means not given. Example: |
SupplierOrderNr
|
int | NULL |
Internal number ( Example: |
SupplierOrderNrs
|
varchar(8000) string |
– |
Comma-separated list of internal supplier order numbers to delete. Each entry must be an integer. Empty means not given. Example: |
Result set 1 · On success or warning, only if the call was not made inside an outer transaction.
Status row of the deletion.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(20) string |
|
ErrorMessage
Nullable |
varchar(100) string |
|
Result set 2 · On error.
Error row after the transaction (or savepoint) was rolled back.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
Always |
ErrorMessage
Nullable |
nvarchar(4000) string |
SQL error message of the failure. |
Response example
<SqlRowSet1>
<row>
<ReturnCode>SUCCESS</ReturnCode>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| WARNING | Some Purchase Orders from list were not deleted. | At least one of the requested supplier orders still exists after `pixi.SupplierOrderDelete` ran, e.g. because its rules prevent deletion. Check the orders individually. |
| ERROR | {ERROR_MESSAGE()} | Any SQL error during processing, e.g. a non-numeric entry in `SupplierOrderIds` or `SupplierOrderNrs` (conversion error) or an error raised by `pixi.SupplierOrderDelete`. All changes are 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:pixiSupplierOrderDelete>
<!-- <AppName>ShopConnector</AppName> -->
<!-- <SupplierOrderId>1532</SupplierOrderId> -->
<!-- <SupplierOrderIds>1533,1534,1540</SupplierOrderIds> -->
<!-- <SupplierOrderNr>20345</SupplierOrderNr> -->
<!-- <SupplierOrderNrs>20346,20347</SupplierOrderNrs> -->
</ns1:pixiSupplierOrderDelete>
</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:pixiSupplierOrderDelete>
<!-- <AppName>ShopConnector</AppName> -->
<!-- <SupplierOrderId>1532</SupplierOrderId> -->
<!-- <SupplierOrderIds>1533,1534,1540</SupplierOrderIds> -->
<!-- <SupplierOrderNr>20345</SupplierOrderNr> -->
<!-- <SupplierOrderNrs>20346,20347</SupplierOrderNrs> -->
</ns1:pixiSupplierOrderDelete>
</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 = [
// 'AppName' => 'ShopConnector',
// 'SupplierOrderId' => '1532',
// 'SupplierOrderIds' => '1533,1534,1540',
// 'SupplierOrderNr' => '20345',
// 'SupplierOrderNrs' => '20346,20347',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSupplierOrderDelete', $soapArguments);
- SQL object:
- dbo.pipiSupplierOrderDelete