pixiWebLogin
Returns the customer key (`CustKey`) of a customer whose billing or shipping address matches the given e-mail/customer number and ZIP code.
Simple web login lookup: identifies a customer by an e-mail address (or external customer number) combined with a ZIP code and returns the customer's CustKey.
How the match works:
- Both
EmailandZIPmust be at least 4 characters long (LEN), otherwise no customer is found. - The customer's billing address (
Customers.AddrRef) and shipping address (Customers.ShipRef) are checked separately. A customer matches if one of the two addresses satisfies both conditions:Emailmatches the address fieldCustomerNrExternaloreMail.ZIPmatches the address fieldZIP.
- Each comparison is a bidirectional substring match: the input contains the stored value, or the stored value contains the input (
LIKE '%…%'in both directions). - The first matching customer (
TOP 1) is returned. There is noORDER BY, so with several matches the returned customer is not deterministic.
If no customer matches, the function returns NULL.
Notes
- Not a secure authentication. There is no password; knowledge of e-mail (or customer number) and ZIP code is enough. Use it only as a lightweight identification.
- Pitfall with empty stored values: because of the reverse match (input
LIKE '%' + stored + '%'), an address whoseeMail,CustomerNrExternalorZIPis an empty string matches any input of sufficient length. StoredNULLvalues do not match. - Substring matching is fuzzy: e.g.
ZIP1234also matches a stored12345. Wildcard characters in the input (%,_,[) are interpreted byLIKE. LENignores trailing spaces, so they do not count towards the minimum length of 4.- Tables are read with
NOLOCK; uncommitted data may be returned. - Matching with leading wildcards cannot use indexes and may be slow on large customer tables.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
Email
Required
|
varchar(60) string |
– |
E-mail address or external customer number ( Example: |
ZIP
Required
|
varchar(10) string |
– |
ZIP code of the customer's billing or shipping address. Must be at least 4 characters long. Example: |
Result set 1 · Always (single scalar value; NULL if no customer matches)
Return value of the scalar function: the key of the matching customer.
| Column | Type | Description |
|---|---|---|
CustKey
Nullable |
int |
|
Response example
<SqlRowSet1>
<row>
<CustKey>4711</CustKey>
</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:pixiWebLogin>
<Email>max.mustermann@example.com</Email>
<ZIP>80331</ZIP>
</ns1:pixiWebLogin>
</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:pixiWebLogin>
<Email>max.mustermann@example.com</Email>
<ZIP>80331</ZIP>
</ns1:pixiWebLogin>
</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 = [
'Email' => 'max.mustermann@example.com',
'ZIP' => '80331',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiWebLogin', $soapArguments);
- SQL object:
- dbo.pipiWebLogin