City List
Get a list of cities for a specific state.
Endpoint Information
Name: Get Cities List by State ID
Method: GET
URL: {{BASE_URL}}/api/v1/cities-by-state/{{state_id}}?merchantAccountId={{your_account_no}}
Authentication
Type: Basic Auth
- Username: App Key
- Password: Secret Key
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
state_id | integer | Yes | The ID of the state to fetch cities for (get this from State List) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantAccountId | string | Yes | Your merchant account ID |
Example Request
GET {{BASE_URL}}/api/v1/cities-by-state/1533?merchantAccountId=100001
Response
Success Response
{
"success": true,
"message": "Cities list",
"data": [
{
"id": 1533,
"name": "Gävleborg County",
"state_code": "X",
"country_code": "SE"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Request success status |
message | string | Response message |
data | array | Array of city objects |
data[].id | integer | City ID |
data[].name | string | City name |
data[].state_code | string | State code |
data[].country_code | string | Country code |
Usage
Use this endpoint to populate city dropdowns based on the selected state, ensuring accurate address data for payment requests.