SmartyStreets.verifyCityStateZip()

Look up and verify city, state, and ZIP Code combinations

Read the docs here: https://smartystreets.com/docs/city-state-zip. Each combination of city/state or ZIP is accepted, except for city alone.

Usage

Hover over inputs/exits for more info.

var SmartyStreets = require('machinepack-smartystreets');


// Look up and verify city, state, and ZIP Code combinations

SmartyStreets.verifyCityStateZip({

authId: 'ffffffff-1111-37f9-aaa2-abcdefghijkl',

authToken: 'ljadfolaj2lkjasdiosadfhlksdalkdasjfsdlkfjklsjf8yoihaksdfh/USDF',

city: 'Doylestown',

state: 'PA or Pennsylvania',

zipcode: '18901',

input_id: 'address-123',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// You must provide a ZIP code and/or City/State combination

missingParams: function () {

 

},

// You cannot just provide a city

cityAlone: function () {

 

},

// Blank lookup (you must provide a ZIP code and/or City/State combination

blank: function () {

 

},

// Invalid State name or abbreviation.

invalidState: function () {

 

},

// Invalid City for the given State.

invalidCity: function () {

 

},

// Invalid ZIP Code

invalidZipcode: function () {

 

},

// Conflicting ZIP Code/City/State information

conflict: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

authId required

Your SmartyStreet Auth ID

'ffffffff-1111-37f9-aaa2-abcdefghijkl'
authToken required

Your SmartyStreet Auth Token

'ljadfolaj2lkjasdiosadfhlksdalkdasjfsdlkfjklsjf8yoihaksdfh/USDF'
city

The city name

'Doylestown'
state

The state name or abbreviation

'PA or Pennsylvania'
zipcode

The 5-digit ZIP Code

'18901'
input_id

A unique identifier for this address used in your application; this field will be copied into the output.

'address-123'

Exits

error

An unexpected error occurred.

missingParams

You must provide a ZIP code and/or City/State combination

cityAlone

You cannot just provide a city

blank

Blank lookup (you must provide a ZIP code and/or City/State combination

invalidState

Invalid State name or abbreviation.

invalidCity

Invalid City for the given State.

invalidZipcode

Invalid ZIP Code

conflict

Conflicting ZIP Code/City/State information

success

OK.