Get State

Retrieves state or province information based on the state name or two-letter code entered in the parameters. The response can be used to provide a valid state name or code in Company addresses. Use the `country` parameter to specify the country associated with the queried state. If left blank, the endpoint uses the United States by default. Note that only the countries listed below will return state or province values. When [creating](#create-a-company-address) or [updating](#update-an-address) addresses in these countries, you must include state information. * Argentina * Australia * Austria * Brazil * Canada * Chile * Germany * India * Indonesia * Ireland * Italy * Japan * Malaysia * Mexico * Myanmar * New Zealand * Philippines * Qatar * Romania * South Africa * Spain * Switzerland * United Arab Emirates * United States (default) Use the `searchType` parameter to specify whether you are searching by a state's name or its two-letter [ISO code](https://www.iso.org/obp/ui/#search), and then add the appropriate value for the state to the `q` parameter.

Authentication

X-Auth-Tokenstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
X-Store-Hashstring
### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

Query parameters

searchTypeenumRequired

Determines whether you are searching by a state or province’s name (0) or its two-letter ISO code (1). This parameter also defines the value type for the country parameter.

Allowed values:
qstringRequired

The state’s name or its two-letter ISO code, depending on the specified searchType.

Note: The state information entered for the parameter must correspond to the country specified in the country value.

countrystringOptionalDefaults to US / United States

The country’s name or its two-letter ISO code, depending on the specified searchType.

Response

OK
codedoubleDefaults to 200
dataobject
metaobject

Errors

404
Not Found Error