Get All Country's States
GET /stores/{store_hash}/v2/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 - required
Parameters
- store_hash in path - string
- country_id in path - integer - required
Id of the country
- Accept in header - string - required
- Content-Type in header - 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: xxxxxxxxxxxxxxxxx'
Response
Body
idinteger
Numeric ID of the state/province.
Example: 208
statestring
Name of the state/province.
Example: Australian Capital Territory
state_abbreviationstring
Abbreviation for the state/province.
Example: ACT
country_idinteger
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 /stores/{store_hash}/v2/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 - required
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: xxxxxxxxxxxxxxxxx'
Response
Body
Refers to the state returned in GET
states requests.
idinteger
Numeric ID of the state/province.
Example: 208
statestring
Name of the state/province.
Example: Australian Capital Territory
state_abbreviationstring
Abbreviation for the state/province.
Example: ACT
country_idinteger
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 /stores/{store_hash}/v2/countries/states/count
Request
Returns a count of all states.
Authentication
- X-Auth-Token in header - required
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: xxxxxxxxxxxxxxxxx'
Response
Body
countinteger
response
{ "count": 241 }
Get All States
GET /stores/{store_hash}/v2/countries/states
Request
Returns a list of all states.
Authentication
- X-Auth-Token in header - required
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: xxxxxxxxxxxxxxxxx'
Response
Body
Refers to the state returned in GET
states requests.
idinteger
Numeric ID of the state/province.
Example: 208
statestring
Name of the state/province.
Example: Australian Capital Territory
state_abbreviationstring
Abbreviation for the state/province.
Example: ACT
country_idinteger
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 /stores/{store_hash}/v2/countries/{country_id}/states/count
Request
Returns a count of a country's states.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- country_id in path - string - 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: xxxxxxxxxxxxxxxxx'
Response
Body
countinteger
response
{ "count": 241 }