Overview
An address is where something goes or who gets billed. Every cart collects a shipping and a billing address, and signed-in customers can keep an address book. Addresses matter beyond the label on a parcel: the shipping address decides which delivery options a customer sees and how much tax they pay.Address fields
Countries and states are named by their ISO codes —
country_code: "US", state_code: "CA" — never by an ID. A code means the same thing everywhere, so you can send one without looking anything up first.The older names country_iso and state_abbr still work but are going away. Use country_code and state_code in new code.Address forms that adapt
Address formats are not universal. The United States wants a state and a ZIP code; Hong Kong wants neither. A form that demands both everywhere will block real customers from checking out. Every country tells you what it needs:states_required is false, let the customer type a state_name instead of picking a state_code.
Only countries you actually sell to are listed — that’s decided by your Markets.
The customer address book
A signed-in customer can save addresses and mark defaults, so checkout is one tap next time.Addresses at checkout
On a cart you can point at a saved address or send a new one inline:Validating addresses
Spree checks that required fields are present and that the state and postal code make sense for the country. Anything it rejects comes back as a422 naming the field, so you can put the message next to the input.
For real-world verification — that a street exists, that a unit number is missing — connect an address validation service. See Providers.
How geography flows through a purchase
1
A customer arrives
Their country resolves to a Market, which sets the currency and locale, and whether prices are shown with tax included.
2
They fill in an address
The form adapts to the country using
states_required and zipcode_required.3
Delivery options appear
The shipping address decides which delivery methods can reach them, and what each costs.
4
Tax is worked out
The same address decides the tax charged.
5
The order is placed
Both addresses are copied onto the order as a permanent record.
Related
- Markets — where you sell, in which currency
- Fulfillments — how the address shapes delivery options
- Taxes — how the address shapes tax
- Carts — the checkout flow end to end

