States & Regions
List US states with order and revenue data.
Updated
On this page
Overview
DashForDevs provides geographic data for states and regions, used in shipping address forms, tax calculations, and location-based features.
Getting States
States are available through the shipping locations endpoint:
import dash from "@/lib/dash"
const { countries } = await dash.checkout.getShippingLocations()
// Each country includes its states/regions
const us = countries.find(c => c.code === "US")
us.states.forEach(state => {
console.log(state.name, state.code) // "Texas", "TX"
})
State Dropdown
export function StateSelect({ states, value, onChange }) {
return (
<select value={value} onChange={e => onChange(e.target.value)}>
<option value="">Select state</option>
{states.map(s => (
<option key={s.code} value={s.code}>{s.name}</option>
))}
</select>
)
}
Next Steps
- Geo Data in Orders — Location data on orders
- Shipping Locations — Available destinations
- Tax Rates — State-level tax rates