Knowledge Base
Categories: Customer Account Management API
Get the List of States for a Country Using the API
When you want to retrieve the list of states for a specific country. This article explains the required parameters and API request format for fetching state IDs and state names using the country code.
Description
Gets the list of States for a specified Country.
Parameters
| Name | Data Type | Required / Optional | Description |
|---|---|---|---|
| auth-userid | Integer | Required | Authentication Parameter |
| api-key | String | Required | Authentication Parameter |
| country-code | String | Required | Country Code as per ISO 3166-1 alpha-2 |
HTTP Method
GET
Example Test URL Request
https://test.httpapi.com/api/country/state-list.xml?auth-userid=0&api-key=key&country-code=nn
Response
Returns the list of States for the Specified Country with the below details:
-
State ID
-
State Name
Did you find this article helpful?