How should a checkout address form work?
A checkout address form should collect name, street address, city, state or province, postal code and country, in that order, and validate each field as the shopper types. The postal code field should accept the format of the selected country, and the form should never ask for a ZIP code when the country is not the United States.
Field order that works
Name, street line 1, street line 2 (optional), city, state or province, postal code, country. Putting country first lets the form switch the postal-code pattern and the state list before the shopper types anything.
Validation that helps instead of blocking
Check the postal code against the selected state or province, and check the city against the postal code. Show a specific message — for example that the ZIP belongs to a different city — instead of a generic “invalid address” error.
Testing the form
Test with addresses from several countries and with edge cases: an apartment number, a PO Box, a long street name, and a postal code with letters. Use test addresses with 555-01xx phone numbers and example.com emails so no real person's data ever enters your test orders.
Frequently asked questions
Should the country field come first or last?
First. The country decides the postal-code format, the state list and the address layout, so choosing it early prevents most validation errors.
Is address line 2 required?
No. Make it optional and label it “Apartment, suite, unit (optional)” so shoppers without one can skip it without an error.
Can I test a checkout with a test address?
Yes — that is exactly what test addresses are for. Use a generated test address with a matching ZIP and a Stripe test card for payment, and keep it in a sandbox or test environment.
Test data — not a real person. All addresses on this page are test data for software testing only. No address belongs to a real person; no SSN is generated; phone numbers use the 555-0100–555-0199 test range and emails use example.com.