pixiSetItemInfo
The API call updates the item information. One single item or multiple items can be updated.
Since pixi version: AVA 17.02 (8.4.26.28957) Additional notes: Using parameter @ItemKey and @ItemDescription we allow to update or remove the whole ItemDescription. ItemDescription will get updated when parameter @ItemKey is present. To remove ItemDescription, we send value for @ItemKey and empty value for @ItemDescription.
**Important**
When you send XMLs via API it can happen that some information gets lost or the call cannot be executed because some characters in the XML itself.
Please wrap your XML into CDATA to cover everything which is in the XML tag.
<![CDATA[ /** � */ ]]>
Example:
<ItemDescription><![CDATA[START your text <& and END]]></ItemDescription>
**XML parts**
To update values in fields you can send a new value, on empty value we do not UPDATE this field:
- ItemName
- InternalItemNumber
- Category
- Enabled
- PriceVK
- PicLinkSmall
- PicLinkLarge
Specialties:
When all parameters are empty (except ItemKey and ItemNrInt), item will not be updated.
When item exists more times in XML, parameters for item are checked:
- when they are equal, item will get updated
Example (equal VATLevel):
<Item> <ItemKey>123</ItemKey> <VATLevel>ZERO</VATLevel> </Item>
<Item> <ItemKey>123</ItemKey> <VATLevel>ZERO</VATLevel> </Item>
- when have different parameters, item will not get updated
Example (different VATLevel):
<Item> <ItemKey>123</ItemKey> <VATLevel>HIGH</VATLevel> </Item>
<Item> <ItemKey>123</ItemKey> <VATLevel>LOW</VATLevel> </Item>
Parameters **ItemKey** and **ItemNrInt** cannot be changed as it influences business logic and can break order.
To update **ItemDescription** you can send an empty value to remove the whole item description or a new value to update it. In case all XML parameters are NULL we will not update/remove **ItemDescripton**.
**InternalItemNumber** will be updated only when item will be updated.
For parameter **Enabled** send numeric value:
- 0 for Disabled
- 1 for Enabled
For parameter **PriceVK** send numeric value, dot (.) is delimiter (Example: 13.13).
When **Enabled** or **PriceVK** is not numeric, item will not get updated.
To properly update **VATLevel** send one of the values:
- HIGH
- LOW
- ZERO
**XML example (1 item):**
<ItemInfo>
<Item>
<ItemKey>123</ItemKey>
<ItemNrInt>2021SetItem333</ItemNrInt>
<ItemName>Test item Nr.5</ItemName>
<ItemDescription><![CDATA[Some nice description & S��]]></ItemDescription>
<InternalItemNumber>12345</InternalItemNumber>
<Category>Cat555</Category>
<Enabled>1</Enabled>
<PriceVK>13.13</PriceVK>
<PicLinkSmall>http://www.madgeniuses.net/133_0.jpg</PicLinkSmall>
<PicLinkLarge></PicLinkLarge>
<VATLevel>HIGH</VATLevel>
</Item>
</ItemInfo>
**XML example (more items):**
<ItemInfo>
<Item>
...use parameters for item 1
</Item>
<Item>
...use parameters for item 2
</Item>
</ItemInfo>
**Return result**
On success, we return a list of what was updated and what was wrong with the data.
We add an additional column ItemNrInt so in case there is no ItemKey we return ItemNrInt so the customer can know which item was send wrong.
We return data in ItemNrInt only in case for Value for Enable or Price is not numeric or No item/s found or have no data for an update.
We do not check if ItemNrInt really belongs to the item (if both values are entered), we only seek for an ItemKey when it is NULL and ItemNrInt exists.
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
ItemKey | integer | false | Item ID. Type: int Default value: Example: 123 Available from: AVA 17.02 (8.4.26.28957) |
ItemInfoXML | string | false | XML with multiple defined filters. See additional information for XML structure. Type: varchar(-1) Default value: Example: abcdefg Available from: AVA 17.02 (8.4.26.28957) |
ItemDescription | string | false | Item description text. If the value is not provided, it will update/remove the whole item description. Type: varchar(4000) Default value: Example: abcdefg Available from: AVA 17.02 (8.4.26.28957) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiSetItemInfo>
<ItemKey>0</ItemKey>
<ItemDescription>string</ItemDescription>
<ItemInfoXML>string</ItemInfoXML>
</pixiSetItemInfo>
</Body>
</Envelope>
Response
1. Successfull response
Name | Type | Description |
---|---|---|
Status | string | Description of the item status Type: varchar(255) Available from: 25.06 (25.6.0.58802) |
ItemKey | integer | Item ID or ItemNrInt when ItemKey is empty. Type: INT Available from: 25.06 (25.6.0.58802) |
ItemNrInt | string | When something is wrong with data, we also return return ItemNrInt if it is not empty. Type: varchar(50) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSetItemInfoPost200TextXmlResponse>
<ItemKey>0</ItemKey>
<Status>string</Status>
<ItemNrInt>string</ItemNrInt>
</PixiSetItemInfoPost200TextXmlResponse>
2. Error response
Name | Type | Description |
---|---|---|
Status | string | Execution status (Info/Error) Type: varchar(20) Available from: 25.06 (25.6.0.58802) |
Message | string | Description of the status Type: varchar(200) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSetItemInfoPost200TextXmlResponse>
<ItemKey>0</ItemKey>
<Status>string</Status>
<ItemNrInt>string</ItemNrInt>
</PixiSetItemInfoPost200TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?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/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiSetItemInfo>
<ItemKey xsi:type="xsd:integer">123</ItemKey>
<ItemInfoXML xsi:type="xsd:string">abcdefg</ItemInfoXML>
<ItemDescription xsi:type="xsd:string">abcdefg</ItemDescription>
</ns1:pixiSetItemInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiSetItemInfo', [
'ItemKey' => '123', // integer
'ItemInfoXML' => 'abcdefg', // string
'ItemDescription' => 'abcdefg', // string
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}