Skip to main content

List States

Retrieve a list of all states with optional filtering by country and other criteria.

HTTP Request

GET/api/locations/states

Authorization

Authorization

  • Required: Yes
  • Permission: Admin or Staff
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Query Parameters

ParameterTypeDefaultDescription
limitintegerNumber of results to return per page
offsetintegerNumber of results to skip before returning results
searchstringSearch term to filter results by `id`, `name` and `code`
orderingstringField to order results by (`id`, `active`, `name`, `code`, `country`)
country_idintegerFilter states by country ID
country_instringFilter states by comma-separated list of country IDs
activebooleanFilter states by active status (true or false)

Status Codes

CodeDescription
200Successfully retrieved states list
400Invalid query parameters
401Authentication required
403Insufficient permissions
500Server error occurred

Response Fields

FieldTypeDescription
idintegerUnique state identifier
namestringState name
codestringState code
countryobjectCountry information

Country Object Fields:

FieldTypeDescription
idIntegerUnique ID of the country
nameStringName of the country
codeStringISO code of the country (e.g., "US")