Postman collection
Customers Read

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 Email and ZIP must 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:
    • Email matches the address field CustomerNrExternal or eMail.
    • ZIP matches the address field ZIP.
  • 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 no ORDER 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 whose eMail, CustomerNrExternal or ZIP is an empty string matches any input of sufficient length. Stored NULL values do not match.
  • Substring matching is fuzzy: e.g. ZIP 1234 also matches a stored 12345. Wildcard characters in the input (%, _, [) are interpreted by LIKE.
  • LEN ignores 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

Customers · Read Addresses · Read
SQL object:
dbo.pipiWebLogin
Updated at 2026-11-13