Skip to main content

State List

Get a list of states for a specific country.

Endpoint Information

Name: Get State List by Country ID
Method: GET
URL: {{BASE_URL}}/api/v1/states-by-country/{{country_id}}?merchantAccountId={{your_account_no}}

Authentication

Type: Basic Auth

  • Username: App Key
  • Password: Secret Key

Path Parameters

ParameterTypeRequiredDescription
country_idintegerYesThe ID of the country to fetch states for (get this from Country List)

Query Parameters

ParameterTypeRequiredDescription
merchantAccountIdstringYesYour merchant account ID

Example Request

GET {{BASE_URL}}/api/v1/states-by-country/213?merchantAccountId=100001

Response

Success Response

{
"success": true,
"message": "State list",
"data": [
{
"id": 1533,
"name": "Gävleborg County",
"country_code": "SE",
"iso2": "X"
}
]
}

Response Fields

FieldTypeDescription
successbooleanRequest success status
messagestringResponse message
dataarrayArray of state objects
data[].idintegerState ID (use this to fetch cities)
data[].namestringState name
data[].country_codestringISO 3166-1 alpha-2 country code
data[].iso2stringState ISO code

Usage

Use this endpoint to:

  1. Populate state/province dropdowns based on selected country.
  2. Get the id required to fetch cities using the City List API.