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

  • Country ID, as returned by the country list

Headers

  • Type of content accepted by the API (application/json in most cases)

  • Application key for specific client app

  • Version of the API to be used

  • Unique request identifier

Responses

  • application/json
  • 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"
      }
    ]
  }
}