Skip to main content
Published: June 28 2005, 12:18:00 PMUpdated: July 21 2022, 10:08:18 AM

I am seeing data in varying formats in the StateOrProvince field in a ShippingAddress. Is there a standard format that we should expect? How do I handle the data?

The StateOrProvince field in a user's address has legacy data from the time it was free form text entry field. It can also come from PayPal addresses which at one time were free form text fields.
Therefore we cannot guarantee that it will meet any single format or sets of formats.
You should see very few variations other than the 2 character abbreviation of a State or the full name of a State ... mixed case being a possibility ... you may also see substrings such as Calif.  This makes it difficult since some substrings such as Ala can match more than 1 state.

What we suggest for addresses is to check the Zip code and do a lookup on zip code to find the state where the zip code resides in if you cannot do a successful match on either the 2 letter abbreviation or the full name.
Checking the Zip Code is also a sanity check for substring matches that match more than 1 state.

Attachments
How well did this answer your question?
Answers others found helpful