pixiSetItemEan
Sets a new EAN/UPC code for exactly one item identified by item key, internal item number, supplier item number or current EAN.
Replaces the EAN/UPC code of a single item.
-
At least one identifier must be passed:
ItemKey,ItemNrInt,OldEanorItemNrSuppl. Otherwise the result is401 No item ID provided. -
The procedure counts the items that match any of the passed identifiers. The identifiers are combined with
OR, not withAND.- No match:
402 Item not found. - More than one match:
403 More than one item is found. This also happens when several identifiers are passed that point to different items.
- No match:
-
If exactly one item matches, the setting
BMECatImport_Update_EANUPCis checked. If it is0or missing, nothing is changed and the result is405 .... -
Otherwise, inside a transaction,
EANUPCis set toNewEan:- in
Itemsfor the item, - in
AddItemsfor all records whoseItemRefpoints to the item.
On success the result is
200 Item updated. On an SQL error the transaction is rolled back and the result is404 Unexpected error: .... - in
The result text is always written to the output parameter ResultMessage. It is also returned as a one-row result set unless SupressDataset = 1.
Notes
- Errors are not raised. They are returned as text whose first three characters are a status code (
200,401–405). Callers should evaluate this prefix. - The setting
BMECatImport_Update_EANUPCis read viafpixi_GetSetting. A missing setting counts as0, so the setting must exist with a value other than0. NewEanis not validated:- no check digit or format check,
- no uniqueness check against other items,
NULLis not rejected and would clear the EAN.
- Because
ItemKeyis compared with'', anItemKeyof0is treated as "not provided". - Item lookups use
NOLOCK. - The text of a
404message is truncated to 256 characters.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
|
int | NULL |
Internal key of the item ( Example: |
ItemNrInt
|
varchar(50) string |
NULL |
Internal item number ( Example: |
OldEan
|
varchar(13) string |
NULL |
Current EAN/UPC of the item ( Example: |
ItemNrSuppl
|
varchar(50) string |
NULL |
Supplier item number ( Example: |
NewEan
Required
|
varchar(13) string |
– |
New EAN/UPC code to store in Example: |
SupressDataset
|
bit boolean |
0 |
Controls whether the result is also returned as a result set. Allowed values
Example: |
ResultMessage
OUTPUT
|
varchar(256) string |
NULL |
Output: status code followed by a message text, e.g. |
Result set 1 · If SupressDataset is 0 or NULL
One row with the result message, both for success and for errors.
| Column | Type | Description |
|---|---|---|
ResultMessage
|
varchar(256) string |
Status code ( |
Response example
<SqlRowSet1>
<row>
<ResultMessage>200 Item updated</ResultMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 401 | 401 No item ID provided | None of `ItemKey`, `ItemNrInt`, `OldEan` or `ItemNrSuppl` was passed (or all are empty or 0). Pass at least one identifier. |
| 402 | 402 Item not found | No item matches any of the passed identifiers. |
| 403 | 403 More than one item is found | The identifiers match more than one item, e.g. a non-unique EAN or supplier item number, or several identifiers pointing to different items. Use a unique identifier such as `ItemKey`. |
| 404 | 404 Unexpected error: {ErrorNumber} {ErrorMessage} | An SQL error occurred during the update. The transaction is rolled back and nothing is changed. |
| 405 | 405 Setting BMECatImport_Update_EANUPC is off which is preventing the EAN from being updated | The setting `BMECatImport_Update_EANUPC` is `0` or does not exist. Enable the setting to allow EAN updates. |
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:pixiSetItemEan>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <ItemNrInt>ART-10001</ItemNrInt> -->
<!-- <OldEan>4006381333931</OldEan> -->
<!-- <ItemNrSuppl>SUP-778899</ItemNrSuppl> -->
<NewEan>4012345678901</NewEan>
<!-- <SupressDataset>0</SupressDataset> -->
<!-- <ResultMessage>?</ResultMessage> -->
</ns1:pixiSetItemEan>
</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:pixiSetItemEan>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <ItemNrInt>ART-10001</ItemNrInt> -->
<!-- <OldEan>4006381333931</OldEan> -->
<!-- <ItemNrSuppl>SUP-778899</ItemNrSuppl> -->
<NewEan>4012345678901</NewEan>
<!-- <SupressDataset>0</SupressDataset> -->
<!-- <ResultMessage>?</ResultMessage> -->
</ns1:pixiSetItemEan>
</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',
// 'ItemNrInt' => 'ART-10001',
// 'OldEan' => '4006381333931',
// 'ItemNrSuppl' => 'SUP-778899',
'NewEan' => '4012345678901',
// 'SupressDataset' => '0',
// 'ResultMessage' => '?',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetItemEan', $soapArguments);
- SQL object:
- dbo.pipiSetItemEan