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
| Parameter | Type | Required | Description |
|---|---|---|---|
country_id | integer | Yes | The ID of the country to fetch states for (get this from Country List) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantAccountId | string | Yes | Your 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
| Field | Type | Description |
|---|---|---|
success | boolean | Request success status |
message | string | Response message |
data | array | Array of state objects |
data[].id | integer | State ID (use this to fetch cities) |
data[].name | string | State name |
data[].country_code | string | ISO 3166-1 alpha-2 country code |
data[].iso2 | string | State ISO code |
Usage
Use this endpoint to:
- Populate state/province dropdowns based on selected country.
- Get the
idrequired to fetch cities using the City List API.