States
Get All Countryʼs States
GET https://api.bigcommerce.com/stores/{store_hash}/v2/countries/{country_id}/statesRequest
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 - integerrequiredId of the country
- Accept in header with default of application/json - stringrequired
- Content-Type in header with default of application/json - stringrequired
- state in query - stringName of the state/province.
- state_abbreviation in query - stringAbbreviation for the state/province.
- page in query - numberNumber of pages.
- limit in query - numberCount 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
idinteger
Numeric ID of the state/province.Example: 208statestring
Name of the state/province.Example: Australian Capital Territorystate_abbreviationstring
Abbreviation for the state/province.Example: ACTcountry_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 https://api.bigcommerce.com/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
Parameters
- store_hash in path - string
- country_id in path - integerrequiredId of the country
- id in path - integerrequiredId of the states
- Accept in header with default of application/json - stringrequired
- Content-Type in header with default of application/json - stringrequired
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. idinteger
Numeric ID of the state/province.Example: 208statestring
Name of the state/province.Example: Australian Capital Territorystate_abbreviationstring
Abbreviation for the state/province.Example: ACTcountry_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 https://api.bigcommerce.com/stores/{store_hash}/v2/countries/states/countRequest
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
countinteger
Min: 1
response
{
"count": 241
}
Get All States
GET https://api.bigcommerce.com/stores/{store_hash}/v2/countries/statesRequest
Returns a list of all states.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- limit in query - integerThe number of results to return per request.
- page in query - integerThe 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
idinteger
Numeric ID of the state/province.Example: 208statestring
Name of the state/province.Example: Australian Capital Territorystate_abbreviationstring
Abbreviation for the state/province.Example: ACTcountry_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 https://api.bigcommerce.com/stores/{store_hash}/v2/countries/{country_id}/states/countRequest
Returns a count of a countryʼs states.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- country_id in path - integerrequired
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
countinteger
Min: 1
response
{
"count": 241
}
Did you find what you were looking for?