pixiGetCountries
Returns one country or all countries from the Pixi country master data, optionally only countries that are used in addresses.
Reads the country master data from the Countries table.
- If
CntCodeis set, only the country with this code is returned. - If
CntCodeis empty orNULL, all countries are returned. An empty string is treated likeNULL. - If
OnlyActive=1and noCntCodeis given, the list is limited to countries whose code appears in theCountrycolumn of at least one record inAddresses. - If
OnlyActive=1and aCntCodeis given, the country is returned whether or not it is used in an address.
The result is sorted by CntName. Each row contains the internal country code, the name, the default shipping cost, the date format, the language code, the ISO-2 and ISO-3 codes, VAT settings and the EU flag.
Notes
- "Active" in
OnlyActivedoes not refer to an active flag in the country data. It only means that the country is used in at least one address inAddresses. - The ISO-3 column is returned with the alias
CntCodeIsO3(lowercases). XML element names are case-sensitive, so clients must read exactly this name. - Both tables are read with
NOLOCK. The result can contain uncommitted data. - The column types are not visible in the code. The SQL types are therefore given as
unknown.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
CntCode
|
varchar(3) string |
NULL |
Internal Pixi country code of the country to return. If empty or Example: |
OnlyActive
|
bit boolean |
0 |
If Allowed values
Example: |
Result set 1 · Always
Country master data, one row per country, sorted by CntName.
| Column | Type | Description |
|---|---|---|
CntCode
|
string |
Internal Pixi country code |
CntName
Nullable |
string |
Country name |
DefShipCost
Nullable |
decimal |
Default shipping cost for the country |
DateFormat
Nullable |
string |
Date format used for the country |
LangCode
Nullable |
string |
Language code of the country |
LocationID
Nullable |
int |
Location ID assigned to the country |
CntCodeISO2
Nullable |
string |
ISO 3166-1 alpha-2 country code |
CntCodeIsO3
Nullable |
string |
ISO 3166-1 alpha-3 country code (source column |
ChargeVAT
Nullable |
boolean |
Indicates whether VAT is charged for this country |
CntNames
Nullable |
string |
Alternative or localized country names |
VATLimit
Nullable |
decimal |
VAT threshold for the country |
IsEU
Nullable |
boolean |
Indicates whether the country is an EU member |
Response example
<SqlRowSet1>
<row>
<CntCode>A</CntCode>
<CntName>Österreich</CntName>
<DefShipCost>9.90</DefShipCost>
<DateFormat>dd.mm.yyyy</DateFormat>
<LangCode>DE</LangCode>
<LocationID>1</LocationID>
<CntCodeISO2>AT</CntCodeISO2>
<CntCodeIsO3>AUT</CntCodeIsO3>
<ChargeVAT>1</ChargeVAT>
<CntNames>Austria</CntNames>
<VATLimit>35000.00</VATLimit>
<IsEU>1</IsEU>
</row>
<row>
<CntCode>D</CntCode>
<CntName>Deutschland</CntName>
<DefShipCost>4.90</DefShipCost>
<DateFormat>dd.mm.yyyy</DateFormat>
<LangCode>DE</LangCode>
<LocationID>1</LocationID>
<CntCodeISO2>DE</CntCodeISO2>
<CntCodeIsO3>DEU</CntCodeIsO3>
<ChargeVAT>1</ChargeVAT>
<CntNames>Germany</CntNames>
<VATLimit>0.00</VATLimit>
<IsEU>1</IsEU>
</row>
</SqlRowSet1>
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:pixiGetCountries>
<!-- <CntCode>D</CntCode> -->
<!-- <OnlyActive>1</OnlyActive> -->
</ns1:pixiGetCountries>
</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:pixiGetCountries>
<!-- <CntCode>D</CntCode> -->
<!-- <OnlyActive>1</OnlyActive> -->
</ns1:pixiGetCountries>
</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 = [
// 'CntCode' => 'D',
// 'OnlyActive' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetCountries', $soapArguments);
- SQL object:
- dbo.pipiGetCountries