Location Data — List States by Country
Returns a list of all states or provinces belonging to a specific country. You must provide the countryId as a path parameter. This endpoint is typically used to populate state dropdowns when creating addresses or profiles.
Limitations: The list is static and based on predefined data; no filters or pagination are supported.
GET{gateway}/us/api/v1/states/{countryId}
Payload
| Attribute | Type | Description | Required |
|---|---|---|---|
| countryId | Integer | ID of the country for which states or provinces are to be fetched. Passed as a path parameter. | Yes |
Response
| Attribute | Type | Description |
|---|---|---|
| data | Array<Object> | List of state or province objects. |
| data[].id | Integer | State ID. |
| data[].name | String | State or province name. |
| data[].latitude | String | Latitude of the state’s approximate center. |
| data[].longitude | String | Longitude of the state’s approximate center. |
| data[].countryId | Integer | ID of the associated country. |
200 — SUCCESS
{
"data": [
{
"id": 3172,
"name": "Azad Kashmir",
"latitude": "33.92590550",
"longitude": "73.78103340",
"countryId": 167
},
{
"id": 3174,
"name": "Balochistan",
"latitude": "28.49073320",
"longitude": "65.09577920",
"countryId": 167
}
]
}400 — FAILED
{
"code": 1401,
"message": "Invalid or missing countryId parameter.",
"type": "BAD_REQUEST"
}