pixiGetItemCustomsInfo
Returns customs data (tariff number, country of origin, weight, dimensions) of one item, identified by item key, internal item number or EAN/UPC.
Returns the customs-relevant master data of a single item from the item master data.
- If none of
ItemKey,ItemNrIntandEanUpcis supplied, one status row is returned. All data columns areNULL,ResultCodeis501and the call stops. - If
ItemKeyisNULLor0, the item key is looked up byItemNrInt, which is the internal item number. - If no item key has been found yet, it is looked up by
EanUpc. - The item with the resolved key is returned. The country of origin
CustomsCountryOfOriginis joined to the country table to also return its ISO2 code. On success,ResultCodeis200andResultMessageisOK.
Identifier priority: ItemKey, then ItemNrInt, then EanUpc. If no matching item exists, the result set is empty and no error row is returned.
Notes
- All reads use
NOLOCK, so uncommitted data may be returned. - If a non-zero
ItemKeyis supplied that does not exist,ItemNrIntandEanUpcare not used as fallback. The result is simply empty. - The lookups by
ItemNrIntandEanUpcuseTOP 1without anORDER BY. If several items share the same EAN, which item is returned is not defined. - Passing only
ItemKey = 0passes the parameter check but returns an empty result set. - The column name
Heigthis misspelled in the source and must be read exactly like this. CustomsCountryOfOriginISO2isNULLif the country code is not found in the country table.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
|
int | NULL |
Internal key of the item. Takes priority over the other identifiers. Example: |
ItemNrInt
|
varchar(50) string |
NULL |
Internal item number. Used only if Example: |
EanUpc
|
varchar(50) string |
NULL |
EAN/UPC of the item. Used only if no item was found by Example: |
Result set 1 · If ItemKey, ItemNrInt and EanUpc are all NULL
Status row with the error code 501. All data columns are NULL.
| Column | Type | Description |
|---|---|---|
ItemKey
Nullable |
int |
Always NULL. |
CustomsTariffNumber
Nullable |
int string |
Always NULL. |
CustomsCountryOfOrigin
Nullable |
int string |
Always NULL. |
CustomsCountryOfOriginISO2
Nullable |
int string |
Always NULL. |
Weight
Nullable |
int decimal |
Always NULL. |
Heigth
Nullable |
int decimal |
Always NULL. |
Width
Nullable |
int decimal |
Always NULL. |
Length
Nullable |
int decimal |
Always NULL. |
CustomsTariffText
Nullable |
int string |
Always NULL. |
CustomsPreviousProcess
Nullable |
int string |
Always NULL. |
ResultCode
|
varchar(3) string |
Always |
ResultMessage
|
varchar(34) string |
Always |
Result set 2 · If at least one identifier is supplied; empty if no matching item exists
Customs data of the resolved item.
| Column | Type | Description |
|---|---|---|
ItemKey
|
int |
Internal key of the item. |
CustomsTariffNumber
Nullable |
string |
Customs tariff number (HS code) of the item. |
CustomsCountryOfOrigin
Nullable |
string |
Pixi country code of the country of origin. |
CustomsCountryOfOriginISO2
Nullable |
string |
ISO2 code of the country of origin from the country table. NULL if the country code is not found. |
Weight
Nullable |
decimal |
Weight of the item. |
Heigth
Nullable |
decimal |
Height of the item. The column name is misspelled in the source. |
Width
Nullable |
decimal |
Width of the item. |
Length
Nullable |
decimal |
Length of the item. |
CustomsTariffText
Nullable |
string |
Description of the goods for customs purposes. |
CustomsPreviousProcess
Nullable |
string |
Previous customs procedure of the item. |
ResultCode
|
varchar(3) string |
Always |
ResultMessage
|
varchar(2) string |
Always |
Response example
<SqlRowSet1>
<row>
<ItemKey>4711</ItemKey>
<CustomsTariffNumber>85176200</CustomsTariffNumber>
<CustomsCountryOfOrigin>CN</CustomsCountryOfOrigin>
<CustomsCountryOfOriginISO2>CN</CustomsCountryOfOriginISO2>
<Weight>0.350</Weight>
<Heigth>5.00</Heigth>
<Width>15.00</Width>
<Length>20.00</Length>
<CustomsTariffText>Network router</CustomsTariffText>
<CustomsPreviousProcess>00</CustomsPreviousProcess>
<ResultCode>200</ResultCode>
<ResultMessage>OK</ResultMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 501 | One of parameters must be supplied | None of `ItemKey`, `ItemNrInt` and `EanUpc` was supplied. Pass at least one item identifier. |
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:pixiGetItemCustomsInfo>
<!-- <ItemKey>4711</ItemKey> -->
<!-- <ItemNrInt>ART-10023</ItemNrInt> -->
<!-- <EanUpc>4006381333931</EanUpc> -->
</ns1:pixiGetItemCustomsInfo>
</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:pixiGetItemCustomsInfo>
<!-- <ItemKey>4711</ItemKey> -->
<!-- <ItemNrInt>ART-10023</ItemNrInt> -->
<!-- <EanUpc>4006381333931</EanUpc> -->
</ns1:pixiGetItemCustomsInfo>
</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' => '4711',
// 'ItemNrInt' => 'ART-10023',
// 'EanUpc' => '4006381333931',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetItemCustomsInfo', $soapArguments);
- SQL object:
- dbo.pipiGetItemCustomsInfo