States

Get All Countryʼs States

GET /countries/{country_id}/states

Request

Returns a list of States belonging to a Country. A state or province, identifiable by an ISO 3166 subdivision code.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • country_id in path - integer
    required
    Id of the country
  • Accept in header with default of application/json - string
    required
  • Content-Type in header with default of application/json - string
    required
  • state in query - string
    Name of the state/province.
  • state_abbreviation in query - string
    Abbreviation for the state/province.
  • page in query - number
    Number of pages.
  • limit in query - number
    Count per page.

example

Response

Body

array | application/json
  • id
    integer

    Numeric ID of the state/province.
    Example: 208
  • state
    string

    Name of the state/province.
    Example: Australian Capital Territory
  • state_abbreviation
    string

    Abbreviation for the state/province.
    Example: ACT
  • country_id
    integer

    Numeric ID of the state’s/province’s associated country.
    Example: 13

example

Get a Countryʼs State

GET /countries/{country_id}/states/{id}

Request

Returns a State. A state or province, identifiable by an ISO 3166 subdivision code.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • country_id in path - integer
    required
    Id of the country
  • id in path - integer
    required
    Id of the states
  • Accept in header with default of application/json - string
    required
  • Content-Type in header with default of application/json - string
    required

example

Response

Body

object | application/json
Refers to the state returned in GET states requests.
  • id
    integer

    Numeric ID of the state/province.
    Example: 208
  • state
    string

    Name of the state/province.
    Example: Australian Capital Territory
  • state_abbreviation
    string

    Abbreviation for the state/province.
    Example: ACT
  • country_id
    integer

    Numeric ID of the state’s/province’s associated country.
    Example: 13

example

Get a Count of All States

GET /countries/states/count

Request

Returns a count of all states.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string

example

Response

Body

object | application/json
  • count
    integer

    Min: 1

response

Get All States

GET /countries/states

Request

Returns a list of all states.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • limit in query - integer
    The number of results to return per request.
  • page in query - integer
    The ordered grouping of results to return.

example

Response

Body

array | application/json
  • id
    integer

    Numeric ID of the state/province.
    Example: 208
  • state
    string

    Name of the state/province.
    Example: Australian Capital Territory
  • state_abbreviation
    string

    Abbreviation for the state/province.
    Example: ACT
  • country_id
    integer

    Numeric ID of the state’s/province’s associated country.
    Example: 13

example

Get a Count of Country’s States

GET /countries/{country_id}/states/count

Request

Returns a count of a countryʼs states.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • country_id in path - integer
    required

example

Response

Body

object | application/json
  • count
    integer

    Min: 1

response

Did you find what you were looking for?