WRDAddressVerificationBase::CheckAddress (open)
Check the validity of an address
Syntax
LOADLIB "mod::wrd/lib/address.whlib";
RECORD FUNCTION CheckAddress(RECORD addressdata, RECORD options)
Parameters
RECORD addressdata
The address to check
STRING city
City
STRING country
Two-letter country code
STRING nr_detail
House number and addition
STRING street
Street name
STRING zip
ZIP or postal code
RECORD options
Options
BOOLEAN alwaysverify
Always verify the address, even if it appears complete (potentially costs extra API calls)
Return value
RECORD
The validation result
RECORD data
The (normalized) input data
RECORD looked_up
The result of the address lookup, contains the complete address if the status is "incomplete"
STRING status
Lookup Status
- "ok" (the address is valid or addresses for this country cannot be checked)
- "not_enough_data" (NL: not enough data to do an address lookup)
- "invalid_city" city is not correct (eg a number)
- "invalid_zip" (NL: the supplied zip is invalid)
- "invalid_nr_detail" (NL: the nr_detail is invalid)
- "different_citystreet" (NL: given city and street are different from the city and street that are found for the given zip and nr_detail)
- "incomplete" (NL: the input data was incomplete - the looked_up field contains the missing fields)
- "zip_not_found" (NL: there is no address with the given zip and nr_detail)
- "address_not_found" (NL: there is no address with the given street nr_detail and city),
- "lookup_failed" (there was an error looking up data - maybe the service is not configured correctly or was unavailable)
- "not_supported" (the operation is not supported for this service)