Skip to content

Get Country States

Retrieve all states or provinces for a specific country.

Endpoint

GET /api/shop/countries/{countryId}/states

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key

Path Parameters

ParameterTypeRequiredDescription
countryIdintegerYesCountry ID

Response Fields (200 OK)

FieldTypeDescription
idintegerState ID
countryIdintegerAssociated country ID
codestringState/province code
namestringState/province name

Use Cases

  • Populate state/province selector dropdowns
  • Load states when country is selected in forms
  • Validate shipping/billing addresses
  • Display state information

Released under the MIT License.