List states by country
Endpoint
Section titled “Endpoint”GET /api/locations/statesReturns states/territories for a country, plus flags for whether a state and/or postcode are required when addressing in that country.
Authentication
Section titled “Authentication”Public — no authentication required.
Query parameters
Section titled “Query parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | No | ISO country code (e.g. AU). Defaults depend on implementation; pass explicitly for international. |
Example
Section titled “Example”curl -G \ "https://www.transdirect.com.au/api/locations/states" \ --data-urlencode "country=AU"Response
Section titled “Response”A successful response includes the country code, whether state/postcode fields are required, and a list of states. Exact field names follow the locations contract (code, name, required flags). Use this when building international address forms so you know which fields to collect.