GET Country States
Returns the states or provinces of a country, for the address forms in checkout and in a customer's saved addresses.
The code is what you send back in an address; the name is what you show. Countries with no subdivisions return an empty array.
Path Parameters
- Type: integercountry
_id requiredCountry ID, as returned by the country list
Headers
- Type: stringAcceptrequired
Type of content accepted by the API (application/json in most cases)
- Type: stringApplicationrequired
Application key for specific client app
- Type: stringA
P I - V E R S I O N requiredVersion of the API to be used
- Type: stringX
- Request - I D requiredUnique request identifier
Responses
- application/json
- 404
Unknown country.
Request Example for get/countries/{country_id}/states
curl https://api-public-demo.menu.app/api/countries/840/states \
--header 'Accept: application/json' \
--header 'Application: application-key' \
--header 'API-VERSION: ' \
--header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937'
{
"status": "OK",
"code": 200,
"data": {
"states": [
{
"id": 5,
"name": "California",
"code": "CA"
},
{
"id": 6,
"name": "Colorado",
"code": "CO"
}
]
}
}