Get List of State/Province/County by Country ID
Get List of State/Province/County by Country ID API EndpointGet List of State/Province/County by Country ID
This API retrieves a list of state, province, or county information based on the provided country ID.
GET
/v1/common/country/{id}/geo-location
Request Content Type
application/json
Response Content Type
application/json
Request Header
-
Authorization: X-API-Key string required
X-API-Key is a string of letters and numbers used to authenticate and control access to the API. It can be generated in the StoRegister management application.
Query Parameters
-
id integer required
id is a integer which represents country.
Response Payload:
-
succeeded boolean
Indicates whether the request to retrieve state/province/county information was successful. -
status string
Describes the status of the request to retrieve state/province/county information. -
data object
Array containing state/province/county information. -
pagination object
Details about pagination, including current page number, total number of pages, and overall count of items. -
errors array
Holds any error information if applicable.
state/province/county Details
Details about the state/province/county option.
array data
-
id integer
Id representing the State id. -
name string
Name of the Geo-Location/State/Province.
Request Header
Authorization: X-API-Key --api-key--
API Response
{
"data": [
{
"id": 0,
"name": "Auvergne-Rhône-Alpes",
},
// ... (Additional Geo-Location/State/Province information)
],
"pagination": {
"pageNumber": 1,
"pageCount": 1,
"totalCount": 1
},
"succeeded": true,
"status": "SUCCESS",
"errors": null
}
Error Codes
-
NO_RECORDS_FOUND
NO_RECORDS_FOUND means there is no relevant information found. -
FAILED
FAILED refers to an unsuccessful API call. -
SOMETHING_WENT_WRONG
SOMETHING_WENT_WRONG refers to technical glitch. Please contact administrator.