Postal Address Verification API
VerifyAddress
Use the VerifyAddress
method to verify and correct a given address. This method provides a single “best” match. Use VerifyAddressAdvanced
to get all possible matches.
Endpoint
GET:https://pav3.esendex.us/PavService.svc/VerifyAddress?FirmOrRecipient={FIRMORRECIPIENT}&PrimaryAddressLine={PRIMARYADDRESSLINE}&SecondaryAddressLine={SECONDARYADDRESSLINE}&Urbanization={URBANIZATION}&CityName={CITYNAME}&State={STATE}&ZipCode={ZIPCODE}&LicenseKey={LICENSEKEY}
Syntax
VerifyAddress(FirmOrRecipient, PrimaryAddressLine, SecondaryAddressLine, Urbanization, CityName, State, ZipCode, LicenseKey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
FirmOrRecipient | Firm name or recipient. | String | False | Esendex |
PrimaryAddressLine | First line of the address. | String | True | 505 Independence Parkway |
SecondaryAddressLine | Second line of the address. | String | False | Suite 300 |
Urbanization | Urbanization name (used in Puerto Rico only). | String | False | BOSQUE DE LAS FLORES |
CityName | City name. | String | True | Chesapeake |
State | The state or 2-character state abbreviation. | String | True | VA |
ZipCode | 5-digit ZIP Code. | String | False | 23320 |
LicenseKey | Your license key. | String | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: Address
object
Code Samples
You can use any programming language you want with our API, as long as it can make a REST or SOAP call. Here are examples for some of the most common platforms.
C#
// https://pav3.esendex.us/PavService.svc?wsdl was added as a Service Reference and given the name WSDL
using System;
using WSDL;
var config = PavServiceClient.EndpointConfiguration.pavws_secure;
var client = new PavServiceClient(config);
var firmOrRecipient = "Esendex";
var primaryAddressLine = "505 Independence Parkway";
var secondaryAddressLine = "Suite 300";
var urbanization = "";
var city = "Chesapeake";
var state = "VA";
var zipCode = "23320";
var licenseKey = "YOUR_LICENSE_KEY";
var response = await client.VerifyAddressAsync(
firmOrRecipient, primaryAddressLine, secondaryAddressLine, urbanization, city, state, zipCode, licenseKey);
var returnCodeDescription = response.ReturnCode switch
{
1 => "Invalid input",
2 => "Invalid license key",
10 => "Input address is not found",
100 => "Input address is DPV-confirmed for all components",
101 => "Input address is found, but not DPV-confirmed",
102 => "Input address primary number is DPV-confirmed, secondary number is present but not DPV-confirmed",
103 => "Input address primary number is DPV-confirmed, secondary number is missing",
200 => "Canadian address on input, verified on city level only",
_ => "Unknown return code"
};
Console.WriteLine($"Return Code: {response.ReturnCode} - {returnCodeDescription}");
Console.WriteLine(
response.FirmNameOrRecipient + "\n" +
response.PrimaryAddressLine + "\n" +
response.CityName + ", " +
response.StateAbbreviation + " " +
response.ZipCode + "\n" +
response.Country);
Console.ReadLine();
Java
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.Properties;
import javax.xml.namespace.QName;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.http.HTTPBinding;
import org.w3c.dom.Document;
public final class VerifyAddress{
public static void main(String[] args) {
String LicenseKey = "(Your License Key)";
try {
URL url = new URL("https://pav3.esendex.us/PavService.svc/VerifyAddress?FirmOrRecipient=Cdyne+Corporation&PrimaryAddressLine=2125+Smith+Ave&SecondaryAddressLine=&Urbanization=&CityName=Chesapeake&State=VA&ZipCode=23320&LicenseKey="+LicenseKey);
try {
InputStream in = url.openStream();
StreamSource source = new StreamSource(in);
printResult(source);
} catch (java.io.IOException e) {
e.printStackTrace();
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
private static void printResult(Source source) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
StreamResult sr = new StreamResult(bos);
Transformer trans = TransformerFactory.newInstance().newTransformer();
Properties oprops = new Properties();
oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
trans.setOutputProperties(oprops);
trans.transform(source, sr);
System.out.println("**** Response ******");
System.out.println(bos.toString());
bos.close();
System.out.println();
} catch (Exception e) {
e.printStackTrace();
}
}
}
JavaScript
const params = new URLSearchParams({
'FirmOrRecipient': 'Esendex',
'PrimaryAddressLine': '505 Independence Parkway',
'SecondaryAddressLine': 'Suite 300',
'CityName': 'Chesapeake',
'State': 'VA',
'ZipCode': '23320',
'LicenseKey': '00000000-0000-0000-0000-000000000000'
});
const url = 'https://pav3.esendex.us/PavService.svc/VerifyAddress?' + params.toString();
const options = {
headers: {
'Accept': 'application/json'
}
};
const response = await fetch(url, options);
const json = await response.json();
console.log(json);
JSON Response
{
"CityName": "CHESAPEAKE",
"Country": "USA",
"County": "CHESAPEAKE CITY",
"FirmNameOrRecipient": "ESENDEX",
"PrimaryAddressLine": "505 INDEPENDENCE PKWY STE 300",
"ReturnCode": 100,
"SecondaryAddressLine": "",
"StateAbbreviation": "VA",
"Urbanization": "",
"ZipCode": "23320-5178"
}
PHP with cURL
<?php
// Request parameters in JSON format
$param = array(
'FirmOrRecipient' => 'Esendex'
, 'PrimaryAddressLine' => '505 Independence Parkway'
, 'SecondaryAddressLine' => 'Suite 300'
, 'Urbanization' => ''
, 'CityName' => 'Chesapeake'
, 'State' => 'VA'
, 'ZipCode' => '23320'
, 'LicenseKey' => '00000000-0000-0000-0000-000000000000'
);
$queryString = http_build_query($param);
// Method
$url = 'https://pav3.esendex.us/PavService.svc/VerifyAddress' . '?' . $queryString;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
$response = curl_exec($ch);
curl_close($ch);
$array = json_decode($response);
print_r($array);
?>
Python
import httpx
headers = {"Accept": "application/json"}
url = "https://pav3.esendex.us/PavService.svc/VerifyAddress"
request = {
"FirmOrRecipient": "Esendex",
"PrimaryAddressLine": "505 Independence Parkway",
"SecondaryAddressLine": "Suite 300",
"CityName": "Chesapeake",
"State": "VA",
"ZipCode": "23320",
"LicenseKey": "00000000-0000-0000-0000-000000000000",
}
with httpx.Client(headers=headers) as client:
response = client.get(url=url, params=request)
response.raise_for_status()
print(response.json())
Ruby
require 'json'
require 'net/http'
headers = { Accept: 'application/json', 'Content-Type': 'application/json' }
uri = URI('https://pav3.esendex.us/PavService.svc/VerifyAddress')
params = {
'FirmOrRecipient': 'Esendex',
'PrimaryAddressLine': '505 Independence Parkway',
'SecondaryAddressLine': 'Suite 300',
'CityName': 'Chesapeake',
'State': 'VA',
'ZipCode': '23320',
'LicenseKey': '00000000-0000-0000-0000-000000000000'
}
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get(uri, headers)
raise response.message if response.is_a?(Net::HTTPClientError) || response.is_a?(Net::HTTPServerError)
puts JSON.parse(response)
XML Response
<Address xmlns="pav3.esendex.us" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CityName>CHESAPEAKE</CityName>
<Country>USA</Country>
<County>CHESAPEAKE CITY</County>
<FirmNameOrRecipient>ESENDEX</FirmNameOrRecipient>
<PrimaryAddressLine>505 INDEPENDENCE PKWY STE 300</PrimaryAddressLine>
<ReturnCode>100</ReturnCode>
<SecondaryAddressLine/>
<StateAbbreviation>VA</StateAbbreviation>
<Urbanization/>
<ZipCode>23320-5178</ZipCode>
</Address>
Let’s start sending, together.