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

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/[country_id]/states' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

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

[
{
"id": 208,
"state": "Australian Capital Territory",
"state_abbreviation": "ACT",
"country_id": 13
}
]

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

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/[country_id]/states/[id]' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

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

{
"id": 208,
"state": "Australian Capital Territory",
"state_abbreviation": "ACT",
"country_id": 13
}

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

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/states/count' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
  • count
    integer

    Min: 1

response

{
"count": 241
}

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

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/states' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

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

[
{
"id": 208,
"state": "Australian Capital Territory",
"state_abbreviation": "ACT",
"country_id": 13
}
]

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

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v2/countries/[country_id]/states/count' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
  • count
    integer

    Min: 1

response

{
"count": 241
}
Did you find what you were looking for?