pixiSetItemInfo
Updates master data of one or more items (name, description, category, price, VAT level, dimensions, customs data, manufacturer, internal item number).
Changes item master data in items and the internal item number in ItemCode. Two input channels can be used, alone or together:
ItemKey+ItemDescription: sets the description of a single item. An omitted or emptyItemDescriptionremoves the description.ItemInfoXML: any number ofItemelements below/ItemInfo(element-centric). Each entry identifies the item byItemKey; ifItemKeyis missing or0, the item is looked up byItemNrInt(item code of type 2).
Processing
- Empty elements are treated as not supplied.
- Entries whose
Enabledis not an integer or whosePriceVKis not numeric are discarded and reported with a status row. - Field mapping (fields that are not supplied keep their current value, except
ItemDescription):ItemName→ItemName,PicLinkSmall/PicLinkLarge,CustomsTariffNumber,CustomsCountryOfOrigin,CustomsTariffText→ same columns,Manufacturer→Artist.ItemDescription→ItemDescription, always written;NULLif the entry has none.Enabled→ bit (0= disabled, any other number = enabled).PriceVK→Price(money, decimal point).VATLevel:HIGH,LOW,ZERO→MwStSatz1, 2, 3; other values are ignored.Weight→ whole numberdecimal(10,0);Heigth,Width,Length→ whole numbersdecimal(4,0); values that cannot be converted are ignored.Category: looked up by text inTontrArten. Unknown categories are created with the next free hexadecimal code. The item getsCategoryIdandConfigTypeof that category.InternalItemNumber: item code of type 3 inItemCode; inserted if the item has none, updated if it differs.
- An item is updated only if it exists in
itemsand the entry contains at least one field other thanItemDescription/InternalItemNumber, or it is the item given in theItemKeyparameter. - If the same item appears in several entries with different data, it is not updated at all.
- Updated items get
UpdateDate= current time andUpdateEmp=API user SetItemInfo.
Result
If at least one item qualified for the update and no SQL error occurred, one row per entry is returned with Status = Updated or a reason why the entry was skipped. Otherwise a single row with Status (404 or 500) and ErrorMsg is returned. The rows are not sorted.
Notes
- Description is overwritten: every updated item gets
ItemDescriptionfrom its entry. An XML entry withoutItemDescriptiontherefore clears the existing description. Always send the description if it must be kept. - Sending the same item via the
ItemKeyparameter and in the XML usually produces two different entries and the item is reported asDuplicated entries found in input parameterswithout any change. - An entry that only contains
InternalItemNumber(and/orItemDescription) is not processed and reported asNo item/s found or have no data for update, unless it is the item of theItemKeyparameter. - New categories in
TontrArtenare created before the item update and independently of it, even if the item does not exist, the entry is a duplicate or the update later fails. - There is no explicit transaction: the
ItemCodechanges and theitemsupdate are separate statements inside oneTRYblock. If a later statement fails, earlier changes remain and the call returns500instead of the per-item rows. - During the
itemsupdateCONTEXT_INFOis set to0x11199to suppress the item triggers; the previous value is restored afterwards. - The element for height is spelled
Heigthin the XML. Weightand the dimensions are rounded to whole numbers; dimensions above 9999 are ignored.- Malformed XML or a conversion problem before the
TRYblock raises a SQL error (SqlMessage) instead of a status row. The code does not check explicitly whetherItemInfoXMLis empty. - If no entry qualifies for an update, only
404is returned, even when entries were discarded because of non-numericEnabled/PriceVK. - Reads from
items,ItemCode,TontrArtenandNumbersuseNOLOCK.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
|
int | NULL |
Key of a single item whose description is set from Example: |
ItemDescription
|
varchar(4000) string |
NULL |
New description for the item given in Example: |
ItemInfoXML
|
varchar(max) xml |
NULL |
XML document with one Example:
|
Result set 1 · If at least one item qualified for the update and no SQL error occurred (status 200)
One row per input entry with the processing result.
| Column | Type | Description |
|---|---|---|
ItemKey
Nullable |
int |
Item key of the entry; empty if it could not be determined. |
Status
|
varchar(255) string |
|
ItemNrInt
Nullable |
varchar(50) string |
Item number from the input; only filled for skipped entries. |
Result set 2 · Instead of the first result set if no item qualified (404) or a SQL error occurred during the update (500)
Single status row.
| Column | Type | Description |
|---|---|---|
Status
|
varchar(3) string |
|
ErrorMsg
Nullable |
varchar(2000) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<ItemKey>12345</ItemKey>
<Status>Updated</Status>
</row>
<row>
<Status>No item/s found or have no data for update</Status>
<ItemNrInt>ART-9999</ItemNrInt>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 404 | No item/s found. | No entry refers to an existing item with data to update (wrong `ItemKey`/`ItemNrInt`, only `InternalItemNumber` supplied, or all entries discarded). Check the keys and send at least one updatable field. |
| 500 | {ERROR_MESSAGE()} | A SQL error occurred while writing `ItemCode` or `items` (e.g. value too long, constraint violation). Changes made before the error remain. |
| 200 | Value for Enable or Price is not numeric | Per-entry row: `Enabled` is not an integer or `PriceVK` is not numeric (use a decimal point). The entry is skipped. |
| 200 | No item/s found or have no data for update | Per-entry row: the item does not exist, `ItemNrInt` could not be resolved, or the entry contains no updatable field. |
| 200 | Duplicated entries found in input parameters | Per-item row: the same item appears in several entries with different data (also when combined with the `ItemKey` parameter). The item is not updated; send each item only once. |
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:pixiSetItemInfo>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <ItemDescription>Robust stainless steel water bottle, 750 ml</ItemDescription> -->
<!-- <ItemInfoXML><![CDATA[<ItemInfo><Item><ItemKey>12345</ItemKey><ItemNrInt>ART-1001</ItemNrInt><ItemName>Water bottle steel 750 ml</ItemName><ItemDescription>Robust stainless steel water bottle, 750 ml</ItemDescription><InternalItemNumber>INT-1001</InternalItemNumber><Category>Outdoor</Category><Enabled>1</Enabled><PriceVK>19.90</PriceVK><PicLinkSmall>https://shop.example.com/img/1001_s.jpg</PicLinkSmall><PicLinkLarge>https://shop.example.com/img/1001_l.jpg</PicLinkLarge><VATLevel>HIGH</VATLevel><Weight>450</Weight><Heigth>26</Heigth><Width>8</Width><Length>8</Length><CustomsTariffNumber>73239300</CustomsTariffNumber><CustomsCountryOfOrigin>DE</CustomsCountryOfOrigin><CustomsTariffText>Table and kitchen articles of stainless steel</CustomsTariffText><Manufacturer>Example GmbH</Manufacturer></Item><Item><ItemNrInt>ART-1002</ItemNrInt><ItemDescription>Lid for water bottle</ItemDescription><PriceVK>4.50</PriceVK></Item></ItemInfo>]]></ItemInfoXML> -->
</ns1:pixiSetItemInfo>
</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:pixiSetItemInfo>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <ItemDescription>Robust stainless steel water bottle, 750 ml</ItemDescription> -->
<!-- <ItemInfoXML><![CDATA[<ItemInfo><Item><ItemKey>12345</ItemKey><ItemNrInt>ART-1001</ItemNrInt><ItemName>Water bottle steel 750 ml</ItemName><ItemDescription>Robust stainless steel water bottle, 750 ml</ItemDescription><InternalItemNumber>INT-1001</InternalItemNumber><Category>Outdoor</Category><Enabled>1</Enabled><PriceVK>19.90</PriceVK><PicLinkSmall>https://shop.example.com/img/1001_s.jpg</PicLinkSmall><PicLinkLarge>https://shop.example.com/img/1001_l.jpg</PicLinkLarge><VATLevel>HIGH</VATLevel><Weight>450</Weight><Heigth>26</Heigth><Width>8</Width><Length>8</Length><CustomsTariffNumber>73239300</CustomsTariffNumber><CustomsCountryOfOrigin>DE</CustomsCountryOfOrigin><CustomsTariffText>Table and kitchen articles of stainless steel</CustomsTariffText><Manufacturer>Example GmbH</Manufacturer></Item><Item><ItemNrInt>ART-1002</ItemNrInt><ItemDescription>Lid for water bottle</ItemDescription><PriceVK>4.50</PriceVK></Item></ItemInfo>]]></ItemInfoXML> -->
</ns1:pixiSetItemInfo>
</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' => '12345',
// 'ItemDescription' => 'Robust stainless steel water bottle, 750 ml',
// 'ItemInfoXML' => '<ItemInfo><Item><ItemKey>12345</ItemKey><ItemNrInt>ART-1001</ItemNrInt><ItemName>Water bottle steel 750 ml</ItemName><ItemDescription>Robust stainless steel water bottle, 750 ml</ItemDescription><InternalItemNumber>INT-1001</InternalItemNumber><Category>Outdoor</Category><Enabled>1</Enabled><PriceVK>19.90</PriceVK><PicLinkSmall>https://shop.example.com/img/1001_s.jpg</PicLinkSmall><PicLinkLarge>https://shop.example.com/img/1001_l.jpg</PicLinkLarge><VATLevel>HIGH</VATLevel><Weight>450</Weight><Heigth>26</Heigth><Width>8</Width><Length>8</Length><CustomsTariffNumber>73239300</CustomsTariffNumber><CustomsCountryOfOrigin>DE</CustomsCountryOfOrigin><CustomsTariffText>Table and kitchen articles of stainless steel</CustomsTariffText><Manufacturer>Example GmbH</Manufacturer></Item><Item><ItemNrInt>ART-1002</ItemNrInt><ItemDescription>Lid for water bottle</ItemDescription><PriceVK>4.50</PriceVK></Item></ItemInfo>',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetItemInfo', $soapArguments);
- SQL object:
- dbo.pipiSetItemInfo