pixiSetItemCustomsInfo
Updates the customs data (tariff number, country of origin, tariff text, previous procedure) and the weight and dimensions of an item.
Updates customs-related fields and physical dimensions of one item, identified by ItemKey.
- If
CustomsCountryOfOriginISO2is passed and not empty, the two-letter ISO code is looked up in the country table. The Pixi country code (CntCode) found there replaces the value ofCustomsCountryOfOrigin. - The item is updated. Only parameters that are not
NULLoverwrite the stored value. A parameter that is left out or passed asNULLkeeps the current value. - The update runs only if at least one passed value differs from the stored value, or if a stored value is
NULLand a value is passed. - On an update,
UpdateEmpis set to<UserName> (API)andUpdateDateis set to the current date and time.
The call returns one status row:
200/OK: the item was changed.200/Accepted - no changes needed: the item exists, but all passed values already match the stored values.401/Not found: no item with thisItemKeyexists.
Notes
Weight,Heigth,WidthandLengthare declared as plainNUMERIC. Without precision and scale this meansnumeric(18,0), so decimal places are rounded away before the values are stored. Pass whole numbers in the unit Pixi uses for these fields.- The parameter for the height is spelled
Heigth, as is the column. - A field cannot be reset to
NULLwith this call, becauseNULLmeans "keep the current value". An empty string, however, is stored as an empty string. - If
CustomsCountryOfOriginISO2matches no country, the lookup assigns nothing. In that case the value passed inCustomsCountryOfOriginis used, or the stored value is kept if that parameter isNULLas well. No error is returned. - The code returns
401for a missing item, not404. - The update uses
ROWLOCK. The country lookup and the existence check read withNOLOCK. - If nothing changes,
UpdateEmpandUpdateDateare not touched.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
Required
|
int | – |
Internal key of the item to update. Example: |
UserName
Required
|
varchar(50) string |
– |
Name of the user or system that makes the change. It is stored in Example: |
CustomsTariffNumber
|
varchar(50) string |
NULL |
Customs tariff number (HS code). Example: |
CustomsCountryOfOrigin
|
varchar(3) string |
NULL |
Pixi country code of the country of origin. It is overridden if Example: |
CustomsCountryOfOriginISO2
|
varchar(2) string |
NULL |
ISO 3166-1 alpha-2 code of the country of origin. If it is not empty, it is translated into the Pixi country code and takes precedence over Example: |
Weight
|
numeric decimal |
NULL |
Weight of the item. Decimal places are lost because the parameter is Example: |
Heigth
|
numeric decimal |
NULL |
Height of the item (spelled Example: |
Width
|
numeric decimal |
NULL |
Width of the item. Decimal places are lost. Example: |
Length
|
numeric decimal |
NULL |
Length of the item. Decimal places are lost. Example: |
CustomsTariffText
|
varchar(max) string |
NULL |
Description of the goods for customs purposes. Example: |
CustomsPreviousProcess
|
varchar(10) string |
NULL |
Customs previous procedure code. Example: |
Result set 1 · Always
One status row that says whether the item was changed, was already up to date, or was not found.
| Column | Type | Description |
|---|---|---|
ResultCode
|
varchar(3) string |
|
ResultMessage
|
varchar(28) string |
|
Response example
<SqlRowSet1>
<row>
<ResultCode>200</ResultCode>
<ResultMessage>OK</ResultMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 401 | Not found | No item with the given `ItemKey` exists. Check the item key before calling. |
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:pixiSetItemCustomsInfo>
<ItemKey>12345</ItemKey>
<UserName>ShopSync</UserName>
<!-- <CustomsTariffNumber>61091000</CustomsTariffNumber> -->
<!-- <CustomsCountryOfOrigin>D</CustomsCountryOfOrigin> -->
<!-- <CustomsCountryOfOriginISO2>DE</CustomsCountryOfOriginISO2> -->
<!-- <Weight>250</Weight> -->
<!-- <Heigth>30</Heigth> -->
<!-- <Width>200</Width> -->
<!-- <Length>300</Length> -->
<!-- <CustomsTariffText>T-shirts, knitted, of cotton</CustomsTariffText> -->
<!-- <CustomsPreviousProcess>00</CustomsPreviousProcess> -->
</ns1:pixiSetItemCustomsInfo>
</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:pixiSetItemCustomsInfo>
<ItemKey>12345</ItemKey>
<UserName>ShopSync</UserName>
<!-- <CustomsTariffNumber>61091000</CustomsTariffNumber> -->
<!-- <CustomsCountryOfOrigin>D</CustomsCountryOfOrigin> -->
<!-- <CustomsCountryOfOriginISO2>DE</CustomsCountryOfOriginISO2> -->
<!-- <Weight>250</Weight> -->
<!-- <Heigth>30</Heigth> -->
<!-- <Width>200</Width> -->
<!-- <Length>300</Length> -->
<!-- <CustomsTariffText>T-shirts, knitted, of cotton</CustomsTariffText> -->
<!-- <CustomsPreviousProcess>00</CustomsPreviousProcess> -->
</ns1:pixiSetItemCustomsInfo>
</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',
'UserName' => 'ShopSync',
// 'CustomsTariffNumber' => '61091000',
// 'CustomsCountryOfOrigin' => 'D',
// 'CustomsCountryOfOriginISO2' => 'DE',
// 'Weight' => '250',
// 'Heigth' => '30',
// 'Width' => '200',
// 'Length' => '300',
// 'CustomsTariffText' => 'T-shirts, knitted, of cotton',
// 'CustomsPreviousProcess' => '00',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetItemCustomsInfo', $soapArguments);
- SQL object:
- dbo.pipiSetItemCustomsInfo