pixiSetItemCategory
Assigns a category (from the TontrArten category table) to an Artikel, identified by item key or internal item number.
Sets the category of a single Artikel.
- Identify the item: If
ItemKEyis given, it is used directly. If it isNULL, the item is looked up byItemNRInt(internal item number) initems. If several items match, an arbitrary one is taken (TOP (1)without sort order). - If no item key can be determined, a row with
Error=Item not found.is returned and nothing is changed. - Look up the category: The category is searched in
TontrArtenby its text (TontrText=Category). The fieldsTontrArt(config type) andTontrArtKey(category ID) of the first match are read. - If no category is found, or the matching row has no
TontrArt, a row withError=Category is not existing.is returned and nothing is changed. - Otherwise the columns
ConfigTypeandCategoryIdof the item are updated and a row withError=OKis returned.
The call always returns exactly one row with one column Error that holds the status text.
Notes
- If
ItemKEyis passed, its existence is not checked. For a non-existing key the update affects no row, but the call still returnsOK. - If both
ItemKEyandItemNRIntare passed,ItemNRIntis ignored. - The category is matched by its display text, not by key. If several categories share the same text, an arbitrary one is used.
- Lookups use
NOLOCK(dirty reads possible); the update usesROWLOCK. No explicit transaction is used. - The status column is named
Erroreven on success (OK).
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKEy
|
int | NULL |
Internal key of the Artikel ( Example: |
ItemNRInt
|
varchar(50) string |
NULL |
Internal item number ( Example: |
Category
Required
|
varchar(50) string |
– |
Text of the category as stored in Example: |
Result set 1 · Always (exactly one row)
Status row of the operation.
| Column | Type | Description |
|---|---|---|
Error
|
varchar(25) string |
|
Response example
<SqlRowSet1>
<row>
<Error>OK</Error>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| Error | Item not found. | `ItemKEy` is `NULL` and no item with the given `ItemNRInt` exists (or `ItemNRInt` is also `NULL`). Pass a valid item key or internal item number. |
| Error | Category is not existing. | No row in `TontrArten` has `TontrText` equal to `Category`, or the matching row has no `TontrArt`. Use the exact category text as defined in Pixi. |
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:pixiSetItemCategory>
<!-- <ItemKEy>10234</ItemKEy> -->
<!-- <ItemNRInt>ART-100245</ItemNRInt> -->
<Category>Textilien</Category>
</ns1:pixiSetItemCategory>
</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:pixiSetItemCategory>
<!-- <ItemKEy>10234</ItemKEy> -->
<!-- <ItemNRInt>ART-100245</ItemNRInt> -->
<Category>Textilien</Category>
</ns1:pixiSetItemCategory>
</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 = [
// 'ItemKEy' => '10234',
// 'ItemNRInt' => 'ART-100245',
'Category' => 'Textilien',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetItemCategory', $soapArguments);
- SQL object:
- dbo.pipiSetItemCategory