Fetch Locations (Countries, Provinces, Cities)
Retrieve countries, provinces, and cities available in your store.
Endpoint
json
https://api-stores.storeino.com/api/locations/searchQuery Parameters
| Name | Type | Description |
|---|---|---|
| country | string | (optional) Country ID. Returns provinces for the given country. |
| province | string | (optional) Province ID. Returns cities for the given province and country. |
Usage
Get all countries:
Call the endpoint with no query parameters.Get provinces for a country:
Add?country=<country_id>to the endpoint.Get cities for a province:
Add?country=<country_id>&province=<province_id>to the endpoint.
Example Requests
Get all countries:
Get cities in a province:
Example Responses
All Countries
json
https://api-stores.storeino.com/api/locations/searchjson
{
"results": [
{ "_id": "country_id_1", "name": "Country 1" },
{ "_id": "country_id_2", "name": "Country 2" }
]
}All Provinces
json
https://api-stores.storeino.com/api/locations/search?country=countryIdjson
{
"results": [
{ "_id": "province_id_1", "name": "Province 1" },
{ "_id": "province_id_2", "name": "Province 2" }
]
}json
https://api-stores.storeino.com/api/locations/search?country=country_Id&province=province_idAll Cities
json
{
"results": [
{ "_id": "city_id_1", "name": "City 1" },
{ "_id": "city_id_2", "name": "City 2" }
]
}