pixiGetCountriesInvoice
Returns the distinct list of countries (code and name) that appear in the invoice addresses of all invoices.
Collects the country of the address linked to each invoice and returns each country once, with its code and name.
- Every invoice in
Invoicesis joined to its address inAddressesviaAddrRef=AddrKey. Invoices without a matching address are left out. - The country value of the address is looked up in the
countriestable byCntCode. - The result is deduplicated (
DISTINCT) and sorted byCntNameascending.
The call has no parameters and always covers all invoices in the database.
Notes
- The lookup in
countriesis aLEFT JOIN. If an address contains a country value that does not exist incountries(or is empty/NULL), a row withCntCodeandCntNameboth NULL is returned. Because of the ascending sort onCntName, this row appears first. - The unmatched country value itself is not returned, only the NULL columns.
InvoicesandAddressesare read withNOLOCK(dirty reads possible);countriesis read without a locking hint.- The query scans all invoices; on large databases the call can take some time.
Tables used
This call has no parameters.
Result set 1 · Always
One row per distinct country found in invoice addresses, sorted by CntName ascending.
| Column | Type | Description |
|---|---|---|
CntCode
Nullable |
string |
Country code from |
CntName
Nullable |
string |
Country name from |
Response example
<SqlRowSet1>
<row>
<CntCode>AT</CntCode>
<CntName>Austria</CntName>
</row>
<row>
<CntCode>DE</CntCode>
<CntName>Germany</CntName>
</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:pixiGetCountriesInvoice/>
</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:pixiGetCountriesInvoice/>
</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 = [
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetCountriesInvoice', $soapArguments);
- SQL object:
- dbo.pipiGetCountriesInvoice