Skip to main content

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

ParameterTypeRequiredDescription
state_idintegerYesThe ID of the state to fetch cities for (get this from State List)

Query Parameters

ParameterTypeRequiredDescription
merchantAccountIdstringYesYour 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

FieldTypeDescription
successbooleanRequest success status
messagestringResponse message
dataarrayArray of city objects
data[].idintegerCity ID
data[].namestringCity name
data[].state_codestringState code
data[].country_codestringCountry code

Usage

Use this endpoint to populate city dropdowns based on the selected state, ensuring accurate address data for payment requests.